lkml.org 
[lkml]   [2014]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] ahci: Check and set 64-bit DMA mask for platform AHCI driver
Hello.

On 06/12/2014 09:40 PM, suravee.suthikulpanit@amd.com wrote:

> 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");

Not 32-bit?

> + return rc;
> + }
> + dev_warn(dev, "Enable 32-bit DMA instead of 64-bit.\n");
> + }
> + }
> +

WBR, Sergei



\
 
 \ /
  Last update: 2014-06-12 21:21    [W:0.067 / U:1.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site