Message ID | 1402594824-4151-2-git-send-email-suravee.suthikulpanit@amd.com |
---|---|
State | Not Applicable |
Delegated to: | David Miller |
Headers | show |
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 -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi, On 06/12/2014 07: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> I did not review this patch, just because you CC-ed me does not mean I've reviewed it. Please don't add my Reviewed-by unless you've gotten a mail from me saying something along these lines: This patch is: Reviewed-by: Hans de Goede <hdegoede@redhat.com> More in general please do not add any tags, other then Cc or your own Signed-off-by, unless you've actually received those tags in an email from people. Regards, Hans p.s. About the patch itself, I'll try to test this on sunxi devices to make sure that it does not break anything this weekend. > --- > 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-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 6/12/2014 12:47 PM, Sergei Shtylyov wrote: >> 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? Actually, I intended to say 64 since this is supposed to be setting up 64-bit DMA mask. Or we could just say failed to set up DMA mask. Suravee -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi, On 06/12/2014 07: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> 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 <hdegoede@redhat.com> 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-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Jun 12, 2014 at 12:40:23PM -0500, 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> Applied 1-2 to libata/for-3.17. Thanks.
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;