What configuration is the above dev->dma_mask checking supposed to handle?On Fri, May 23, 2014 at 12:35:10PM -0500,suravee.suthikulpanit@xxxxxxx wrote:
> >>From: Suravee Suthikulpanit<Suravee.Suthikulpanit@xxxxxxx>
> >>
> >>The current platform AHCI drier does not set the dma_mask correctly
> >>for 64-bit DMA capable AHCI controller. This patch checks the AHCI
> >>capability bit and set the dma_mask and coherent_dma_mask accordingly.
> >>
> >>Signed-off-by: Suravee Suthikulpanit<Suravee.Suthikulpanit@xxxxxxx>
> >>---
> >> drivers/ata/libahci_platform.c | 9 +++++++++
> >> 1 file changed, 9 insertions(+)
> >>
> >>diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
> >>index 7cb3a85..85049ef 100644
> >>--- a/drivers/ata/libahci_platform.c
> >>+++ b/drivers/ata/libahci_platform.c
> >>@@ -368,6 +368,15 @@ int ahci_platform_init_host(struct platform_device *pdev,
> >> ahci_init_controller(host);
> >> ahci_print_info(host, "platform");
> >>
> >>+ if (hpriv->cap & HOST_CAP_64) {
> >>+ if (!dev->dma_mask)
Is it really needed? If not the current dma_set_mask_and_coherent() call
can be replaced by dma_coerce_mask_and_coherent() one.
Shouldn't we try to set DMA masks to 32-bit ones on error (like it is done> >>+ dev->dma_mask = &dev->coherent_dma_mask;
> >>+
> >>+ rc = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
> >>+ if (rc)
> >>+ return rc;
in ahci_configure_dma_masks()) instead of failing the initialization?
BTW It seems that after DMA masks handling is fixed in the generic AHCI> >>+ }
> >>+
> >> return ata_host_activate(host, irq, ahci_interrupt, IRQF_SHARED,
> >> &ahci_platform_sht);
> >> }
> >>--
> >>1.9.0
platform code the driver specific code in ahci_xgene.c can be removed.
--
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics