Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753555AbaFMUV3 (ORCPT ); Fri, 13 Jun 2014 16:21:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46732 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751074AbaFMUV2 (ORCPT ); Fri, 13 Jun 2014 16:21:28 -0400 Message-ID: <539B5D36.7010201@redhat.com> Date: Fri, 13 Jun 2014 22:21:10 +0200 From: Hans de Goede User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: suravee.suthikulpanit@amd.com, tj@kernel.org, b.zolnierkie@samsung.com CC: lho@apm.com, tphan@apm.com, stripathi@apm.com, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] ahci: Check and set 64-bit DMA mask for platform AHCI driver References: <1402594824-4151-1-git-send-email-suravee.suthikulpanit@amd.com> <1402594824-4151-2-git-send-email-suravee.suthikulpanit@amd.com> In-Reply-To: <1402594824-4151-2-git-send-email-suravee.suthikulpanit@amd.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 06/12/2014 07:40 PM, suravee.suthikulpanit@amd.com wrote: > From: Suravee Suthikulpanit > > 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 > Reviewed-by: Bartlomiej Zolnierkiewicz > Reviewed-by: Hans de Goede I see no adverse effects from this on sunxi, please drop the Reviewed-by: Hans .... tag and replace it with: Tested-by: Hans de Goede Regards, Hans > --- > 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; > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/