From: <suravee.suthikulpanit@amd.com>
To: <tj@kernel.org>, <b.zolnierkie@samsung.com>
Cc: <hdegoede@redhat.com>, <lho@apm.com>, <tphan@apm.com>,
<stripathi@apm.com>, <linux-ide@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Subject: [PATCH 1/2] ahci: Check and set 64-bit DMA mask for platform AHCI driver
Date: Thu, 12 Jun 2014 12:40:23 -0500 [thread overview]
Message-ID: <1402594824-4151-2-git-send-email-suravee.suthikulpanit@amd.com> (raw)
In-Reply-To: <1402594824-4151-1-git-send-email-suravee.suthikulpanit@amd.com>
From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
The current platform AHCI driver 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>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/ata/libahci_platform.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
index 3a5b4ed..a958a2b 100644
--- a/drivers/ata/libahci_platform.c
+++ b/drivers/ata/libahci_platform.c
@@ -364,6 +364,19 @@ int ahci_platform_init_host(struct platform_device *pdev,
ap->ops = &ata_dummy_port_ops;
}
+ if (hpriv->cap & HOST_CAP_64) {
+ rc = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(64));
+ if (rc) {
+ rc = dma_coerce_mask_and_coherent(dev,
+ DMA_BIT_MASK(32));
+ if (rc) {
+ dev_err(dev, "Failed to enable 64-bit DMA.\n");
+ return rc;
+ }
+ dev_warn(dev, "Enable 32-bit DMA instead of 64-bit.\n");
+ }
+ }
+
rc = ahci_reset_controller(host);
if (rc)
return rc;
--
1.9.0
next prev parent reply other threads:[~2014-06-12 17:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-12 17:40 [PATCH 0/2] ahci: Add support for 64-bit DMA mask driver suravee.suthikulpanit
2014-06-12 17:40 ` suravee.suthikulpanit [this message]
2014-06-12 17:47 ` [PATCH 1/2] ahci: Check and set 64-bit DMA mask for platform AHCI driver Sergei Shtylyov
2014-06-13 12:45 ` Suravee Suthikulanit
2014-06-13 8:40 ` Hans de Goede
2014-06-13 20:21 ` Hans de Goede
2014-06-17 19:03 ` Tejun Heo
2014-06-12 17:40 ` [PATCH 2/2] ahci/xgene: Remove logic to set 64-bit DMA mask suravee.suthikulpanit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1402594824-4151-2-git-send-email-suravee.suthikulpanit@amd.com \
--to=suravee.suthikulpanit@amd.com \
--cc=b.zolnierkie@samsung.com \
--cc=hdegoede@redhat.com \
--cc=lho@apm.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stripathi@apm.com \
--cc=tj@kernel.org \
--cc=tphan@apm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).