diff mbox

[1/2] arm/arm64: ACPI: Introduce CONFIG_ACPI_MUST_HAVE_CCA

Message ID 1430315049-4663-2-git-send-email-Suravee.Suthikulpanit@amd.com (mailing list archive)
State New, archived
Headers show

Commit Message

Suravee Suthikulpanit April 29, 2015, 1:44 p.m. UTC
From ACPIv6 (http://www.uefi.org/sites/default/files/resources/ACPI_6.0.pdf),
section 6.2.17 _CCA states that ARM platforms require ACPI _CCA object to be
specified for DMA-cabpable devices. This patch introduces ACPI_MUST_HAVE_CCA
in arm and arm64 Kconfig to specify such requirement.

Note that when _CCA is required, if it is missing in the DSDT. ACPI driver
will default to setting up devices as non-coherent.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
---
 arch/arm/Kconfig     | 1 +
 arch/arm64/Kconfig   | 1 +
 drivers/acpi/Kconfig | 3 +++
 3 files changed, 5 insertions(+)

Comments

Catalin Marinas April 29, 2015, 2:04 p.m. UTC | #1
On Wed, Apr 29, 2015 at 08:44:08AM -0500, Suravee Suthikulpanit wrote:
> From ACPIv6 (http://www.uefi.org/sites/default/files/resources/ACPI_6.0.pdf),
> section 6.2.17 _CCA states that ARM platforms require ACPI _CCA object to be
> specified for DMA-cabpable devices. This patch introduces ACPI_MUST_HAVE_CCA
> in arm and arm64 Kconfig to specify such requirement.
> 
> Note that when _CCA is required, if it is missing in the DSDT. ACPI driver
> will default to setting up devices as non-coherent.
> 
> Signed-off-by: Mark Salter <msalter@redhat.com>
> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> ---
>  arch/arm/Kconfig     | 1 +
>  arch/arm64/Kconfig   | 1 +
>  drivers/acpi/Kconfig | 3 +++
>  3 files changed, 5 insertions(+)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 45df48b..2a0d036 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1,6 +1,7 @@
>  config ARM
>  	bool
>  	default y
> +	select ACPI_MUST_HAVE_CCA if ACPI
>  	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
>  	select ARCH_HAS_ELF_RANDOMIZE
>  	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST

Any plans for ACPI on 32-bit ARM?
Suravee Suthikulpanit April 29, 2015, 2:31 p.m. UTC | #2
On 04/29/2015 09:04 AM, Catalin Marinas wrote:
> On Wed, Apr 29, 2015 at 08:44:08AM -0500, Suravee Suthikulpanit wrote:
>>  From ACPIv6 (http://www.uefi.org/sites/default/files/resources/ACPI_6.0.pdf),
>> section 6.2.17 _CCA states that ARM platforms require ACPI _CCA object to be
>> specified for DMA-cabpable devices. This patch introduces ACPI_MUST_HAVE_CCA
>> in arm and arm64 Kconfig to specify such requirement.
>>
>> Note that when _CCA is required, if it is missing in the DSDT. ACPI driver
>> will default to setting up devices as non-coherent.
>>
>> Signed-off-by: Mark Salter <msalter@redhat.com>
>> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
>> ---
>>   arch/arm/Kconfig     | 1 +
>>   arch/arm64/Kconfig   | 1 +
>>   drivers/acpi/Kconfig | 3 +++
>>   3 files changed, 5 insertions(+)
>>
>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>> index 45df48b..2a0d036 100644
>> --- a/arch/arm/Kconfig
>> +++ b/arch/arm/Kconfig
>> @@ -1,6 +1,7 @@
>>   config ARM
>>   	bool
>>   	default y
>> +	select ACPI_MUST_HAVE_CCA if ACPI
>>   	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
>>   	select ARCH_HAS_ELF_RANDOMIZE
>>   	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
>
> Any plans for ACPI on 32-bit ARM?
>

Not that I am aware, but I could be totally wrong. The reason I am 
adding this here for 32-bit ARM is because the ACPI spec mentioned this.

If you think this is not necessary until we introduce ACPI for ARM32, it 
can be removed.

Thanks,

Suravee
Catalin Marinas April 29, 2015, 2:42 p.m. UTC | #3
On Wed, Apr 29, 2015 at 09:31:03AM -0500, Suravee Suthikulpanit wrote:
> 
> 
> On 04/29/2015 09:04 AM, Catalin Marinas wrote:
> >On Wed, Apr 29, 2015 at 08:44:08AM -0500, Suravee Suthikulpanit wrote:
> >> From ACPIv6 (http://www.uefi.org/sites/default/files/resources/ACPI_6.0.pdf),
> >>section 6.2.17 _CCA states that ARM platforms require ACPI _CCA object to be
> >>specified for DMA-cabpable devices. This patch introduces ACPI_MUST_HAVE_CCA
> >>in arm and arm64 Kconfig to specify such requirement.
> >>
> >>Note that when _CCA is required, if it is missing in the DSDT. ACPI driver
> >>will default to setting up devices as non-coherent.
> >>
> >>Signed-off-by: Mark Salter <msalter@redhat.com>
> >>Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> >>---
> >>  arch/arm/Kconfig     | 1 +
> >>  arch/arm64/Kconfig   | 1 +
> >>  drivers/acpi/Kconfig | 3 +++
> >>  3 files changed, 5 insertions(+)
> >>
> >>diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> >>index 45df48b..2a0d036 100644
> >>--- a/arch/arm/Kconfig
> >>+++ b/arch/arm/Kconfig
> >>@@ -1,6 +1,7 @@
> >>  config ARM
> >>  	bool
> >>  	default y
> >>+	select ACPI_MUST_HAVE_CCA if ACPI
> >>  	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
> >>  	select ARCH_HAS_ELF_RANDOMIZE
> >>  	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
> >
> >Any plans for ACPI on 32-bit ARM?
> 
> Not that I am aware, but I could be totally wrong. The reason I am adding
> this here for 32-bit ARM is because the ACPI spec mentioned this.
> 
> If you think this is not necessary until we introduce ACPI for ARM32, it can
> be removed.

I think it should be removed (as long as ACPI cannot be selected on
arm32).
Suravee Suthikulpanit April 29, 2015, 2:44 p.m. UTC | #4
On 04/29/2015 09:42 AM, Catalin Marinas wrote:
> On Wed, Apr 29, 2015 at 09:31:03AM -0500, Suravee Suthikulpanit wrote:
>>
>>
>> On 04/29/2015 09:04 AM, Catalin Marinas wrote:
>>> On Wed, Apr 29, 2015 at 08:44:08AM -0500, Suravee Suthikulpanit wrote:
>>>>  From ACPIv6 (http://www.uefi.org/sites/default/files/resources/ACPI_6.0.pdf),
>>>> section 6.2.17 _CCA states that ARM platforms require ACPI _CCA object to be
>>>> specified for DMA-cabpable devices. This patch introduces ACPI_MUST_HAVE_CCA
>>>> in arm and arm64 Kconfig to specify such requirement.
>>>>
>>>> Note that when _CCA is required, if it is missing in the DSDT. ACPI driver
>>>> will default to setting up devices as non-coherent.
>>>>
>>>> Signed-off-by: Mark Salter <msalter@redhat.com>
>>>> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
>>>> ---
>>>>   arch/arm/Kconfig     | 1 +
>>>>   arch/arm64/Kconfig   | 1 +
>>>>   drivers/acpi/Kconfig | 3 +++
>>>>   3 files changed, 5 insertions(+)
>>>>
>>>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>>>> index 45df48b..2a0d036 100644
>>>> --- a/arch/arm/Kconfig
>>>> +++ b/arch/arm/Kconfig
>>>> @@ -1,6 +1,7 @@
>>>>   config ARM
>>>>   	bool
>>>>   	default y
>>>> +	select ACPI_MUST_HAVE_CCA if ACPI
>>>>   	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
>>>>   	select ARCH_HAS_ELF_RANDOMIZE
>>>>   	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
>>>
>>> Any plans for ACPI on 32-bit ARM?
>>
>> Not that I am aware, but I could be totally wrong. The reason I am adding
>> this here for 32-bit ARM is because the ACPI spec mentioned this.
>>
>> If you think this is not necessary until we introduce ACPI for ARM32, it can
>> be removed.
>
> I think it should be removed (as long as ACPI cannot be selected on
> arm32).
>

Ok, I'll remove that in V2.

Thanks,

Suravee
Hanjun Guo April 30, 2015, 1:47 p.m. UTC | #5
On 2015?04?29? 22:42, Catalin Marinas wrote:
> On Wed, Apr 29, 2015 at 09:31:03AM -0500, Suravee Suthikulpanit wrote:
>>
>>
>> On 04/29/2015 09:04 AM, Catalin Marinas wrote:
>>> On Wed, Apr 29, 2015 at 08:44:08AM -0500, Suravee Suthikulpanit wrote:
>>>>  From ACPIv6 (http://www.uefi.org/sites/default/files/resources/ACPI_6.0.pdf),
>>>> section 6.2.17 _CCA states that ARM platforms require ACPI _CCA object to be
>>>> specified for DMA-cabpable devices. This patch introduces ACPI_MUST_HAVE_CCA
>>>> in arm and arm64 Kconfig to specify such requirement.
>>>>
>>>> Note that when _CCA is required, if it is missing in the DSDT. ACPI driver
>>>> will default to setting up devices as non-coherent.
>>>>
>>>> Signed-off-by: Mark Salter <msalter@redhat.com>
>>>> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
>>>> ---
>>>>   arch/arm/Kconfig     | 1 +
>>>>   arch/arm64/Kconfig   | 1 +
>>>>   drivers/acpi/Kconfig | 3 +++
>>>>   3 files changed, 5 insertions(+)
>>>>
>>>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>>>> index 45df48b..2a0d036 100644
>>>> --- a/arch/arm/Kconfig
>>>> +++ b/arch/arm/Kconfig
>>>> @@ -1,6 +1,7 @@
>>>>   config ARM
>>>>   	bool
>>>>   	default y
>>>> +	select ACPI_MUST_HAVE_CCA if ACPI
>>>>   	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
>>>>   	select ARCH_HAS_ELF_RANDOMIZE
>>>>   	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
>>>
>>> Any plans for ACPI on 32-bit ARM?
>>
>> Not that I am aware, but I could be totally wrong. The reason I am adding
>> this here for 32-bit ARM is because the ACPI spec mentioned this.
>>
>> If you think this is not necessary until we introduce ACPI for ARM32, it can
>> be removed.
>
> I think it should be removed (as long as ACPI cannot be selected on
> arm32).

I agree.

Now there is no plan for ARM32 ACPI as I know, ACPI for ARM targets
for ARM64 based enterprise system at now.

Thanks
Hanjun
Will Deacon April 30, 2015, 1:50 p.m. UTC | #6
On Thu, Apr 30, 2015 at 02:47:13PM +0100, Hanjun Guo wrote:
> On 2015?04?29? 22:42, Catalin Marinas wrote:
> > On Wed, Apr 29, 2015 at 09:31:03AM -0500, Suravee Suthikulpanit wrote:
> >> On 04/29/2015 09:04 AM, Catalin Marinas wrote:
> >>> On Wed, Apr 29, 2015 at 08:44:08AM -0500, Suravee Suthikulpanit wrote:
> >>> Any plans for ACPI on 32-bit ARM?
> >>
> >> Not that I am aware, but I could be totally wrong. The reason I am adding
> >> this here for 32-bit ARM is because the ACPI spec mentioned this.
> >>
> >> If you think this is not necessary until we introduce ACPI for ARM32, it can
> >> be removed.
> >
> > I think it should be removed (as long as ACPI cannot be selected on
> > arm32).
> 
> I agree.
> 
> Now there is no plan for ARM32 ACPI as I know, ACPI for ARM targets
> for ARM64 based enterprise system at now.

While we're at it, do we *really* need to support CONFIG_ACPI_PROCFS_POWER
on arm64? It's a deprecated /proc/acpi interface and it would be nice to
avoid introducing deprecated behaviour if we can avoid it.

Will
Hanjun Guo April 30, 2015, 2:14 p.m. UTC | #7
On 2015?04?30? 21:50, Will Deacon wrote:
> On Thu, Apr 30, 2015 at 02:47:13PM +0100, Hanjun Guo wrote:
>> On 2015?04?29? 22:42, Catalin Marinas wrote:
>>> On Wed, Apr 29, 2015 at 09:31:03AM -0500, Suravee Suthikulpanit wrote:
>>>> On 04/29/2015 09:04 AM, Catalin Marinas wrote:
>>>>> On Wed, Apr 29, 2015 at 08:44:08AM -0500, Suravee Suthikulpanit wrote:
>>>>> Any plans for ACPI on 32-bit ARM?
>>>>
>>>> Not that I am aware, but I could be totally wrong. The reason I am adding
>>>> this here for 32-bit ARM is because the ACPI spec mentioned this.
>>>>
>>>> If you think this is not necessary until we introduce ACPI for ARM32, it can
>>>> be removed.
>>>
>>> I think it should be removed (as long as ACPI cannot be selected on
>>> arm32).
>>
>> I agree.
>>
>> Now there is no plan for ARM32 ACPI as I know, ACPI for ARM targets
>> for ARM64 based enterprise system at now.
>
> While we're at it, do we *really* need to support CONFIG_ACPI_PROCFS_POWER
> on arm64? It's a deprecated /proc/acpi interface and it would be nice to
> avoid introducing deprecated behaviour if we can avoid it.

I agree. It is used for laptop ac adapter and battery, I will look
into that and clean it up for ARM64.

Thanks
Hanjun
Lorenzo Pieralisi April 30, 2015, 3:01 p.m. UTC | #8
On Thu, Apr 30, 2015 at 02:50:18PM +0100, Will Deacon wrote:
> On Thu, Apr 30, 2015 at 02:47:13PM +0100, Hanjun Guo wrote:
> > On 2015???04???29??? 22:42, Catalin Marinas wrote:
> > > On Wed, Apr 29, 2015 at 09:31:03AM -0500, Suravee Suthikulpanit wrote:
> > >> On 04/29/2015 09:04 AM, Catalin Marinas wrote:
> > >>> On Wed, Apr 29, 2015 at 08:44:08AM -0500, Suravee Suthikulpanit wrote:
> > >>> Any plans for ACPI on 32-bit ARM?
> > >>
> > >> Not that I am aware, but I could be totally wrong. The reason I am adding
> > >> this here for 32-bit ARM is because the ACPI spec mentioned this.
> > >>
> > >> If you think this is not necessary until we introduce ACPI for ARM32, it can
> > >> be removed.
> > >
> > > I think it should be removed (as long as ACPI cannot be selected on
> > > arm32).
> > 
> > I agree.
> > 
> > Now there is no plan for ARM32 ACPI as I know, ACPI for ARM targets
> > for ARM64 based enterprise system at now.
> 
> While we're at it, do we *really* need to support CONFIG_ACPI_PROCFS_POWER
> on arm64? It's a deprecated /proc/acpi interface and it would be nice to
> avoid introducing deprecated behaviour if we can avoid it.

I think we can make it depend on x86 because the compilation units that
create that proc dirs (ACPI_BATTERY and ACPI_AC) already depend on it,
at the moment compiling drivers/acpi/cm_sbs.c is totally useless on
arm64.

Lorenzo
diff mbox

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 45df48b..2a0d036 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1,6 +1,7 @@ 
 config ARM
 	bool
 	default y
+	select ACPI_MUST_HAVE_CCA if ACPI
 	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
 	select ARCH_HAS_ELF_RANDOMIZE
 	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 4269dba..e5471f8 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1,6 +1,7 @@ 
 config ARM64
 	def_bool y
 	select ACPI_GENERIC_GSI if ACPI
+	select ACPI_MUST_HAVE_CCA if ACPI
 	select ACPI_REDUCED_HARDWARE_ONLY if ACPI
 	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
 	select ARCH_HAS_ELF_RANDOMIZE
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index ab2cbb5..620ee67 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -54,6 +54,9 @@  config ACPI_GENERIC_GSI
 config ACPI_SYSTEM_POWER_STATES_SUPPORT
 	bool
 
+config ACPI_MUST_HAVE_CCA
+	bool
+
 config ACPI_SLEEP
 	bool
 	depends on SUSPEND || HIBERNATION