linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] ata: Check and set 64-bit DMA mask for platform AHCI driver
@ 2014-05-23 17:35 suravee.suthikulpanit
  2014-06-01 18:23 ` Suravee Suthikulpanit
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: suravee.suthikulpanit @ 2014-05-23 17:35 UTC (permalink / raw)
  To: tj; +Cc: linux-ide, linux-kernel, Suravee Suthikulpanit

From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>

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@amd.com>
---
 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)
+			dev->dma_mask = &dev->coherent_dma_mask;
+
+		rc = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
+		if (rc)
+			return rc;
+	}
+
 	return ata_host_activate(host, irq, ahci_interrupt, IRQF_SHARED,
 				 &ahci_platform_sht);
 }
-- 
1.9.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-06-12  6:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-23 17:35 [PATCH 1/1] ata: Check and set 64-bit DMA mask for platform AHCI driver suravee.suthikulpanit
2014-06-01 18:23 ` Suravee Suthikulpanit
2014-06-03 17:58 ` Tejun Heo
2014-06-06 16:10   ` Suravee Suthikulanit
2014-06-11  9:41     ` Bartlomiej Zolnierkiewicz
2014-06-12  6:22       ` Suravee Suthikulpanit
2014-06-10 21:54 ` David Milburn
2014-06-11  9:30   ` Bartlomiej Zolnierkiewicz
2014-06-12  6:36     ` Suravee Suthikulpanit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).