* [PATCH 1/1] ata: Check and set 64-bit DMA mask for platform AHCI driver
@ 2014-05-23 17:35 ` suravee.suthikulpanit
0 siblings, 0 replies; 14+ 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] 14+ messages in thread
* [PATCH 1/1] ata: Check and set 64-bit DMA mask for platform AHCI driver
@ 2014-05-23 17:35 ` suravee.suthikulpanit
0 siblings, 0 replies; 14+ 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] 14+ messages in thread
* Re: [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
-1 siblings, 0 replies; 14+ messages in thread
From: Suravee Suthikulpanit @ 2014-06-01 18:23 UTC (permalink / raw)
To: tj; +Cc: linux-ide, linux-kernel
Hi Tejun,
I am following up on this patch.
Thank you,
Suravee
On 05/23/2014 12:35 PM, suravee.suthikulpanit@amd.com wrote:
> 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);
> }
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/1] ata: Check and set 64-bit DMA mask for platform AHCI driver
@ 2014-06-01 18:23 ` Suravee Suthikulpanit
0 siblings, 0 replies; 14+ messages in thread
From: Suravee Suthikulpanit @ 2014-06-01 18:23 UTC (permalink / raw)
To: tj; +Cc: linux-ide, linux-kernel
Hi Tejun,
I am following up on this patch.
Thank you,
Suravee
On 05/23/2014 12:35 PM, suravee.suthikulpanit@amd.com wrote:
> 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);
> }
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/1] ata: Check and set 64-bit DMA mask for platform AHCI driver
2014-05-23 17:35 ` suravee.suthikulpanit
(?)
(?)
@ 2014-06-03 17:58 ` Tejun Heo
2014-06-06 16:10 ` Suravee Suthikulanit
-1 siblings, 1 reply; 14+ messages in thread
From: Tejun Heo @ 2014-06-03 17:58 UTC (permalink / raw)
To: suravee.suthikulpanit
Cc: linux-ide, linux-kernel, Hans de Goede, Bartlomiej Zolnierkiewicz
Hans, Bartlomiej, can you guys please review this patch?
Thanks.
On Fri, May 23, 2014 at 12:35:10PM -0500, suravee.suthikulpanit@amd.com wrote:
> 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
>
> --
> 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
--
tejun
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/1] ata: Check and set 64-bit DMA mask for platform AHCI driver
2014-06-03 17:58 ` Tejun Heo
@ 2014-06-06 16:10 ` Suravee Suthikulanit
0 siblings, 0 replies; 14+ messages in thread
From: Suravee Suthikulanit @ 2014-06-06 16:10 UTC (permalink / raw)
To: Tejun Heo, Hans de Goede, Bartlomiej Zolnierkiewicz
Cc: linux-ide, linux-kernel
Hans/Bartlomiej,
Do you guys have any questions about this patch?
Thank you,
Suravee
On 6/3/2014 12:58 PM, Tejun Heo wrote:
> Hans, Bartlomiej, can you guys please review this patch?
>
> Thanks.
>
> On Fri, May 23, 2014 at 12:35:10PM -0500, suravee.suthikulpanit@amd.com wrote:
>> 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
>>
>> --
>> 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
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/1] ata: Check and set 64-bit DMA mask for platform AHCI driver
@ 2014-06-06 16:10 ` Suravee Suthikulanit
0 siblings, 0 replies; 14+ messages in thread
From: Suravee Suthikulanit @ 2014-06-06 16:10 UTC (permalink / raw)
To: Tejun Heo, Hans de Goede, Bartlomiej Zolnierkiewicz
Cc: linux-ide, linux-kernel
Hans/Bartlomiej,
Do you guys have any questions about this patch?
Thank you,
Suravee
On 6/3/2014 12:58 PM, Tejun Heo wrote:
> Hans, Bartlomiej, can you guys please review this patch?
>
> Thanks.
>
> On Fri, May 23, 2014 at 12:35:10PM -0500, suravee.suthikulpanit@amd.com wrote:
>> 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
>>
>> --
>> 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
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/1] ata: Check and set 64-bit DMA mask for platform AHCI driver
2014-05-23 17:35 ` suravee.suthikulpanit
` (2 preceding siblings ...)
(?)
@ 2014-06-10 21:54 ` David Milburn
2014-06-11 9:30 ` Bartlomiej Zolnierkiewicz
-1 siblings, 1 reply; 14+ messages in thread
From: David Milburn @ 2014-06-10 21:54 UTC (permalink / raw)
To: suravee.suthikulpanit; +Cc: tj, linux-ide, linux-kernel
On 05/23/2014 12:35 PM, suravee.suthikulpanit@amd.com wrote:
> 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,
Hi Suravee,
Would it be better to do the following before ahci_reset_controller()?
/* initialize adapter */
rc = ahci_configure_dma_masks(pdev, hpriv->cap & HOST_CAP_64);
if (rc)
return rc;
Thanks,
David
> 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);
> }
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/1] ata: Check and set 64-bit DMA mask for platform AHCI driver
2014-06-10 21:54 ` David Milburn
@ 2014-06-11 9:30 ` Bartlomiej Zolnierkiewicz
2014-06-12 6:36 ` Suravee Suthikulpanit
0 siblings, 1 reply; 14+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2014-06-11 9:30 UTC (permalink / raw)
To: David Milburn; +Cc: suravee.suthikulpanit, tj, linux-ide, linux-kernel
Hi,
On Tuesday, June 10, 2014 04:54:01 PM David Milburn wrote:
> On 05/23/2014 12:35 PM, suravee.suthikulpanit@amd.com wrote:
> > 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,
>
> Hi Suravee,
>
> Would it be better to do the following before ahci_reset_controller()?
>
> /* initialize adapter */
> rc = ahci_configure_dma_masks(pdev, hpriv->cap & HOST_CAP_64);
> if (rc)
> return rc;
ahci_configure_dma_masks() is currently for PCI controllers only
so it can't be used for libahci_platform.c.
When it comes to setting DMA masks before ahci_reset_controller()
I don't think that it matters but it will make platform code more
similar to PCI one which is a good thing.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> Thanks,
> David
>
>
>
> > 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);
> > }
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/1] ata: Check and set 64-bit DMA mask for platform AHCI driver
2014-06-06 16:10 ` Suravee Suthikulanit
(?)
@ 2014-06-11 9:41 ` Bartlomiej Zolnierkiewicz
2014-06-12 6:22 ` Suravee Suthikulpanit
-1 siblings, 1 reply; 14+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2014-06-11 9:41 UTC (permalink / raw)
To: Suravee Suthikulanit; +Cc: Tejun Heo, Hans de Goede, linux-ide, linux-kernel
Hi,
On Friday, June 06, 2014 11:10:58 AM Suravee Suthikulanit wrote:
> Hans/Bartlomiej,
>
> Do you guys have any questions about this patch?
Sorry for the delay, some questions regarding the patch below.
> Thank you,
>
> Suravee
>
> On 6/3/2014 12:58 PM, Tejun Heo wrote:
> > Hans, Bartlomiej, can you guys please review this patch?
> >
> > Thanks.
> >
> > On Fri, May 23, 2014 at 12:35:10PM -0500, suravee.suthikulpanit@amd.com wrote:
> >> 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)
What configuration is the above dev->dma_mask checking supposed to handle?
Is it really needed? If not the current dma_set_mask_and_coherent() call
can be replaced by dma_coerce_mask_and_coherent() one.
> >> + dev->dma_mask = &dev->coherent_dma_mask;
> >> +
> >> + rc = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
> >> + if (rc)
> >> + return rc;
Shouldn't we try to set DMA masks to 32-bit ones on error (like it is done
in ahci_configure_dma_masks()) instead of failing the initialization?
> >> + }
> >> +
> >> return ata_host_activate(host, irq, ahci_interrupt, IRQF_SHARED,
> >> &ahci_platform_sht);
> >> }
> >> --
> >> 1.9.0
BTW It seems that after DMA masks handling is fixed in the generic AHCI
platform code the driver specific code in ahci_xgene.c can be removed.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/1] ata: Check and set 64-bit DMA mask for platform AHCI driver
2014-06-11 9:41 ` Bartlomiej Zolnierkiewicz
@ 2014-06-12 6:22 ` Suravee Suthikulpanit
0 siblings, 0 replies; 14+ messages in thread
From: Suravee Suthikulpanit @ 2014-06-12 6:22 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: Tejun Heo, Hans de Goede, linux-ide, linux-kernel, lho, tphan, stripathi
On 06/11/2014 04:41 AM, Bartlomiej Zolnierkiewicz wrote:
>>> On Fri, May 23, 2014 at 12:35:10PM -0500,suravee.suthikulpanit@amd.com wrote:
>>>> > >>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)
> What configuration is the above dev->dma_mask checking supposed to handle?
> Is it really needed? If not the current dma_set_mask_and_coherent() call
> can be replaced by dma_coerce_mask_and_coherent() one.
I was just trying to be safe and not always assuming that dev->dma_mask
is pointing to the dev->coherent_dma_mask. If you think this is not
necessary, I can remove this.
>
>>>> > >>+ dev->dma_mask = &dev->coherent_dma_mask;
>>>> > >>+
>>>> > >>+ rc = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
>>>> > >>+ if (rc)
>>>> > >>+ return rc;
> Shouldn't we try to set DMA masks to 32-bit ones on error (like it is done
> in ahci_configure_dma_masks()) instead of failing the initialization?
I can also add the additional logic to try for 32-bit.
>
>>>> > >>+ }
>>>> > >>+
>>>> > >> return ata_host_activate(host, irq, ahci_interrupt, IRQF_SHARED,
>>>> > >> &ahci_platform_sht);
>>>> > >> }
>>>> > >>--
>>>> > >>1.9.0
> BTW It seems that after DMA masks handling is fixed in the generic AHCI
> platform code the driver specific code in ahci_xgene.c can be removed.
I am including Loc Ho, Tuan Phan, and Suman Tripathi to help verifying
if code could be removed. If so, I'll send out the change in V2.
Suravee
>
> Best regards,
> --
> Bartlomiej Zolnierkiewicz
> Samsung R&D Institute Poland
> Samsung Electronics
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/1] ata: Check and set 64-bit DMA mask for platform AHCI driver
@ 2014-06-12 6:22 ` Suravee Suthikulpanit
0 siblings, 0 replies; 14+ messages in thread
From: Suravee Suthikulpanit @ 2014-06-12 6:22 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: Tejun Heo, Hans de Goede, linux-ide, linux-kernel, lho, tphan, stripathi
On 06/11/2014 04:41 AM, Bartlomiej Zolnierkiewicz wrote:
>>> On Fri, May 23, 2014 at 12:35:10PM -0500,suravee.suthikulpanit@amd.com wrote:
>>>> > >>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)
> What configuration is the above dev->dma_mask checking supposed to handle?
> Is it really needed? If not the current dma_set_mask_and_coherent() call
> can be replaced by dma_coerce_mask_and_coherent() one.
I was just trying to be safe and not always assuming that dev->dma_mask
is pointing to the dev->coherent_dma_mask. If you think this is not
necessary, I can remove this.
>
>>>> > >>+ dev->dma_mask = &dev->coherent_dma_mask;
>>>> > >>+
>>>> > >>+ rc = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
>>>> > >>+ if (rc)
>>>> > >>+ return rc;
> Shouldn't we try to set DMA masks to 32-bit ones on error (like it is done
> in ahci_configure_dma_masks()) instead of failing the initialization?
I can also add the additional logic to try for 32-bit.
>
>>>> > >>+ }
>>>> > >>+
>>>> > >> return ata_host_activate(host, irq, ahci_interrupt, IRQF_SHARED,
>>>> > >> &ahci_platform_sht);
>>>> > >> }
>>>> > >>--
>>>> > >>1.9.0
> BTW It seems that after DMA masks handling is fixed in the generic AHCI
> platform code the driver specific code in ahci_xgene.c can be removed.
I am including Loc Ho, Tuan Phan, and Suman Tripathi to help verifying
if code could be removed. If so, I'll send out the change in V2.
Suravee
>
> Best regards,
> --
> Bartlomiej Zolnierkiewicz
> Samsung R&D Institute Poland
> Samsung Electronics
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/1] ata: Check and set 64-bit DMA mask for platform AHCI driver
2014-06-11 9:30 ` Bartlomiej Zolnierkiewicz
@ 2014-06-12 6:36 ` Suravee Suthikulpanit
0 siblings, 0 replies; 14+ messages in thread
From: Suravee Suthikulpanit @ 2014-06-12 6:36 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz, David Milburn; +Cc: tj, linux-ide, linux-kernel
On 06/11/2014 04:30 AM, Bartlomiej Zolnierkiewicz wrote:
>
> Hi,
>
> On Tuesday, June 10, 2014 04:54:01 PM David Milburn wrote:
>> On 05/23/2014 12:35 PM, suravee.suthikulpanit@amd.com wrote:
>>> 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,
>>
>> Hi Suravee,
>>
>> Would it be better to do the following before ahci_reset_controller()?
>>
>> /* initialize adapter */
>> rc = ahci_configure_dma_masks(pdev, hpriv->cap & HOST_CAP_64);
>> if (rc)
>> return rc;
>
> ahci_configure_dma_masks() is currently for PCI controllers only
> so it can't be used for libahci_platform.c.
>
> When it comes to setting DMA masks before ahci_reset_controller()
> I don't think that it matters but it will make platform code more
> similar to PCI one which is a good thing.
I can move this logic before ahci_reset_controller() in V2.
Suravee
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/1] ata: Check and set 64-bit DMA mask for platform AHCI driver
@ 2014-06-12 6:36 ` Suravee Suthikulpanit
0 siblings, 0 replies; 14+ messages in thread
From: Suravee Suthikulpanit @ 2014-06-12 6:36 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz, David Milburn; +Cc: tj, linux-ide, linux-kernel
On 06/11/2014 04:30 AM, Bartlomiej Zolnierkiewicz wrote:
>
> Hi,
>
> On Tuesday, June 10, 2014 04:54:01 PM David Milburn wrote:
>> On 05/23/2014 12:35 PM, suravee.suthikulpanit@amd.com wrote:
>>> 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,
>>
>> Hi Suravee,
>>
>> Would it be better to do the following before ahci_reset_controller()?
>>
>> /* initialize adapter */
>> rc = ahci_configure_dma_masks(pdev, hpriv->cap & HOST_CAP_64);
>> if (rc)
>> return rc;
>
> ahci_configure_dma_masks() is currently for PCI controllers only
> so it can't be used for libahci_platform.c.
>
> When it comes to setting DMA masks before ahci_reset_controller()
> I don't think that it matters but it will make platform code more
> similar to PCI one which is a good thing.
I can move this logic before ahci_reset_controller() in V2.
Suravee
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2014-06-12 6:36 UTC | newest]
Thread overview: 14+ 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-05-23 17:35 ` suravee.suthikulpanit
2014-06-01 18:23 ` 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-06 16:10 ` Suravee Suthikulanit
2014-06-11 9:41 ` Bartlomiej Zolnierkiewicz
2014-06-12 6:22 ` Suravee Suthikulpanit
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
2014-06-12 6:36 ` Suravee Suthikulpanit
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.