diff mbox

[1/3] Honor ACPI _CCA attribute setting

Message ID 1439416290-21228-2-git-send-email-jeremy.linton@arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jeremy Linton Aug. 12, 2015, 9:51 p.m. UTC
ACPI configurations can now mark devices as noncoherent,
support that choice.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
---
 include/acpi/acpi_bus.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Suravee Suthikulpanit Aug. 14, 2015, 1:45 a.m. UTC | #1
Hi Jeremy,

On 8/13/15 04:51, Jeremy Linton wrote:
> ACPI configurations can now mark devices as noncoherent,
> support that choice.
>
> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
> ---
>   include/acpi/acpi_bus.h | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> index 83061ca..7ecb8e4 100644
> --- a/include/acpi/acpi_bus.h
> +++ b/include/acpi/acpi_bus.h
> @@ -399,7 +399,7 @@ static inline bool acpi_check_dma(struct acpi_device *adev, bool *coherent)
>   	 * case 1. Do not support and disable DMA.
>   	 * case 2. Support but rely on arch-specific cache maintenance for
>   	 *         non-coherence DMA operations.
> -	 * Currently, we implement case 1 above.
> +	 * Currently, we implement case 2 above.
>   	 *
>   	 * For the case when _CCA is missing (i.e. cca_seen=0) and
>   	 * platform specifies ACPI_CCA_REQUIRED, we do not support DMA,
> @@ -407,7 +407,8 @@ static inline bool acpi_check_dma(struct acpi_device *adev, bool *coherent)
>   	 *
>   	 * See acpi_init_coherency() for more info.
>   	 */
> -	if (adev->flags.coherent_dma) {
> +	if (adev->flags.coherent_dma ||
> +	    (adev->flags.cca_seen && IS_ENABLED(CONFIG_ARM64))) {
>   		ret = true;
>   		if (coherent)
>   			*coherent = adev->flags.coherent_dma;
>

This change was in my earlier revisions for the original patch series to 
add ACPI CCA support. At the time, this was pushed back since we were 
not sure whether this would be a useful case, and whether such hardware 
exists.

Would it be useful to document somewhere (may be in the GIT commit 
message) about which hardware might need this?

Arnd/Catalin, any feedback on this?

Thanks,

Suravee
Catalin Marinas Aug. 14, 2015, 1:14 p.m. UTC | #2
On Fri, Aug 14, 2015 at 08:45:22AM +0700, Suravee Suthikulpanit wrote:
> On 8/13/15 04:51, Jeremy Linton wrote:
> >ACPI configurations can now mark devices as noncoherent,
> >support that choice.
> >
> >Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
> >---
> >  include/acpi/acpi_bus.h | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> >diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> >index 83061ca..7ecb8e4 100644
> >--- a/include/acpi/acpi_bus.h
> >+++ b/include/acpi/acpi_bus.h
> >@@ -399,7 +399,7 @@ static inline bool acpi_check_dma(struct acpi_device *adev, bool *coherent)
> >  	 * case 1. Do not support and disable DMA.
> >  	 * case 2. Support but rely on arch-specific cache maintenance for
> >  	 *         non-coherence DMA operations.
> >-	 * Currently, we implement case 1 above.
> >+	 * Currently, we implement case 2 above.
> >  	 *
> >  	 * For the case when _CCA is missing (i.e. cca_seen=0) and
> >  	 * platform specifies ACPI_CCA_REQUIRED, we do not support DMA,
> >@@ -407,7 +407,8 @@ static inline bool acpi_check_dma(struct acpi_device *adev, bool *coherent)
> >  	 *
> >  	 * See acpi_init_coherency() for more info.
> >  	 */
> >-	if (adev->flags.coherent_dma) {
> >+	if (adev->flags.coherent_dma ||
> >+	    (adev->flags.cca_seen && IS_ENABLED(CONFIG_ARM64))) {
> >  		ret = true;
> >  		if (coherent)
> >  			*coherent = adev->flags.coherent_dma;
> >
> 
> This change was in my earlier revisions for the original patch series to add
> ACPI CCA support. At the time, this was pushed back since we were not sure
> whether this would be a useful case, and whether such hardware exists.
> 
> Would it be useful to document somewhere (may be in the GIT commit message)
> about which hardware might need this?

So far, it's the ARM Juno development board (the emphasis here is on
being able to use it for development, not a production system).

I think the commit log should also give you credit for the original
implementation.

> Arnd/Catalin, any feedback on this?

That's where it was left in the previous thread:

https://lkml.org/lkml/2015/5/21/376

(and I'll refrain from further comments ;))
Jeremy Linton Aug. 14, 2015, 2:12 p.m. UTC | #3
Hello Suravee,

On 08/13/2015 08:45 PM, Suravee Suthikulpanit wrote:
> On 8/13/15 04:51, Jeremy Linton wrote:
>> ACPI configurations can now mark devices as noncoherent,
>> support that choice.
>
> This change was in my earlier revisions for the original patch series to
> add ACPI CCA support. At the time, this was pushed back since we were
> not sure whether this would be a useful case, and whether such hardware
> exists.

Yes, I was made aware of that conversation during the review here.

Basically, the ARM Juno development platform has a mix of coherent and 
noncoherent devices. The EHCI being one of the primary noncoherent 
peripherals. Without which, the usefulness of the platform for 
developing with an ACPI kernel is limited.


Thanks,
Huang Shijie Aug. 18, 2015, 3:36 a.m. UTC | #4
On Fri, Aug 14, 2015 at 09:12:28AM -0500, Jeremy Linton wrote:
> Hello Suravee,
> 
> On 08/13/2015 08:45 PM, Suravee Suthikulpanit wrote:
> > On 8/13/15 04:51, Jeremy Linton wrote:
> >> ACPI configurations can now mark devices as noncoherent,
> >> support that choice.
> >
> > This change was in my earlier revisions for the original patch series to
> > add ACPI CCA support. At the time, this was pushed back since we were
> > not sure whether this would be a useful case, and whether such hardware
> > exists.
> 
> Yes, I was made aware of that conversation during the review here.
> 
> Basically, the ARM Juno development platform has a mix of coherent and 
> noncoherent devices. The EHCI being one of the primary noncoherent 
> peripherals. Without which, the usefulness of the platform for 
> developing with an ACPI kernel is limited.
> 
Tesed-by: Huang Shijie <shijie.huang@arm.com>
diff mbox

Patch

diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 83061ca..7ecb8e4 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -399,7 +399,7 @@  static inline bool acpi_check_dma(struct acpi_device *adev, bool *coherent)
 	 * case 1. Do not support and disable DMA.
 	 * case 2. Support but rely on arch-specific cache maintenance for
 	 *         non-coherence DMA operations.
-	 * Currently, we implement case 1 above.
+	 * Currently, we implement case 2 above.
 	 *
 	 * For the case when _CCA is missing (i.e. cca_seen=0) and
 	 * platform specifies ACPI_CCA_REQUIRED, we do not support DMA,
@@ -407,7 +407,8 @@  static inline bool acpi_check_dma(struct acpi_device *adev, bool *coherent)
 	 *
 	 * See acpi_init_coherency() for more info.
 	 */
-	if (adev->flags.coherent_dma) {
+	if (adev->flags.coherent_dma ||
+	    (adev->flags.cca_seen && IS_ENABLED(CONFIG_ARM64))) {
 		ret = true;
 		if (coherent)
 			*coherent = adev->flags.coherent_dma;