diff mbox

[v2,2/3] ACPI / PPTT: fix build when CONFIG_ACPI_PPTT is not enabled

Message ID 1528209304-3280-2-git-send-email-sudeep.holla@arm.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Sudeep Holla June 5, 2018, 2:35 p.m. UTC
Though CONFIG_ACPI_PPTT is selected by platforms and nor user visible,
it may be useful to support the build with CONFIG_ACPI_PPTT disabled.

This patch adds the missing dummy/boiler plate implementation to fix
the build.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 include/linux/acpi.h      | 15 +++++++++++++++
 include/linux/cacheinfo.h |  2 +-
 2 files changed, 16 insertions(+), 1 deletion(-)

Hi Rafael,

If you are fine with this, can you provide Ack, so that we route this
through ARM64 tree where most of the ACPI PPTT support is present.

Regards,
Sudeep

v1->v2:
	- removed duplicate definition for acpi_find_last_cache_level

Comments

Rafael J. Wysocki June 5, 2018, 3 p.m. UTC | #1
On Tue, Jun 5, 2018 at 4:35 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
> Though CONFIG_ACPI_PPTT is selected by platforms and nor user visible,
> it may be useful to support the build with CONFIG_ACPI_PPTT disabled.
>
> This patch adds the missing dummy/boiler plate implementation to fix
> the build.
>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  include/linux/acpi.h      | 15 +++++++++++++++
>  include/linux/cacheinfo.h |  2 +-
>  2 files changed, 16 insertions(+), 1 deletion(-)
>
> Hi Rafael,
>
> If you are fine with this, can you provide Ack, so that we route this
> through ARM64 tree where most of the ACPI PPTT support is present.
>
> Regards,
> Sudeep
>
> v1->v2:
>         - removed duplicate definition for acpi_find_last_cache_level
>
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index 8f2cdb0eca71..4b35a66383f9 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -1299,8 +1299,23 @@ static inline int lpit_read_residency_count_address(u64 *address)
>  }
>  #endif
>
> +#ifdef CONFIG_ACPI_PPTT
>  int find_acpi_cpu_topology(unsigned int cpu, int level);
>  int find_acpi_cpu_topology_package(unsigned int cpu);
>  int find_acpi_cpu_cache_topology(unsigned int cpu, int level);
> +#else
> +static inline int find_acpi_cpu_topology(unsigned int cpu, int level)
> +{
> +       return -EINVAL;

Why -EINVAL?

> +}
> +static inline int find_acpi_cpu_topology_package(unsigned int cpu)
> +{
> +       return -EINVAL;
> +}
> +static inline int find_acpi_cpu_cache_topology(unsigned int cpu, int level)
> +{
> +       return -EINVAL;
> +}
> +#endif
>
>  #endif /*_LINUX_ACPI_H*/
> diff --git a/include/linux/cacheinfo.h b/include/linux/cacheinfo.h
> index 89397e30e269..70e19bc6cc9f 100644
> --- a/include/linux/cacheinfo.h
> +++ b/include/linux/cacheinfo.h
> @@ -98,7 +98,7 @@ struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu);
>  int init_cache_level(unsigned int cpu);
>  int populate_cache_leaves(unsigned int cpu);
>  int cache_setup_acpi(unsigned int cpu);
> -#ifndef CONFIG_ACPI
> +#ifndef CONFIG_ACPI_PPTT
>  /*
>   * acpi_find_last_cache_level is only called on ACPI enabled
>   * platforms using the PPTT for topology. This means that if
> --
> 2.7.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sudeep Holla June 5, 2018, 3:33 p.m. UTC | #2
On 05/06/18 16:00, Rafael J. Wysocki wrote:
> On Tue, Jun 5, 2018 at 4:35 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>> Though CONFIG_ACPI_PPTT is selected by platforms and nor user visible,
>> it may be useful to support the build with CONFIG_ACPI_PPTT disabled.
>>
>> This patch adds the missing dummy/boiler plate implementation to fix
>> the build.
>>
>> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>> ---
>>  include/linux/acpi.h      | 15 +++++++++++++++
>>  include/linux/cacheinfo.h |  2 +-
>>  2 files changed, 16 insertions(+), 1 deletion(-)
>>
>> Hi Rafael,
>>
>> If you are fine with this, can you provide Ack, so that we route this
>> through ARM64 tree where most of the ACPI PPTT support is present.
>>
>> Regards,
>> Sudeep
>>
>> v1->v2:
>>         - removed duplicate definition for acpi_find_last_cache_level
>>
>> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
>> index 8f2cdb0eca71..4b35a66383f9 100644
>> --- a/include/linux/acpi.h
>> +++ b/include/linux/acpi.h
>> @@ -1299,8 +1299,23 @@ static inline int lpit_read_residency_count_address(u64 *address)
>>  }
>>  #endif
>>
>> +#ifdef CONFIG_ACPI_PPTT
>>  int find_acpi_cpu_topology(unsigned int cpu, int level);
>>  int find_acpi_cpu_topology_package(unsigned int cpu);
>>  int find_acpi_cpu_cache_topology(unsigned int cpu, int level);
>> +#else
>> +static inline int find_acpi_cpu_topology(unsigned int cpu, int level)
>> +{
>> +       return -EINVAL;
> 
> Why -EINVAL?
> 

I am not sure either. I used to return -ENOTSUPP, but IIRC someone
suggested to use it only for syscalls. Also I just based it on other
existing functions in acpi.h

I am open for any alternatives if you think that is better here.
Rafael J. Wysocki June 5, 2018, 4:12 p.m. UTC | #3
On Tue, Jun 5, 2018 at 5:33 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>
>
> On 05/06/18 16:00, Rafael J. Wysocki wrote:
>> On Tue, Jun 5, 2018 at 4:35 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>> Though CONFIG_ACPI_PPTT is selected by platforms and nor user visible,
>>> it may be useful to support the build with CONFIG_ACPI_PPTT disabled.
>>>
>>> This patch adds the missing dummy/boiler plate implementation to fix
>>> the build.
>>>
>>> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>>> ---
>>>  include/linux/acpi.h      | 15 +++++++++++++++
>>>  include/linux/cacheinfo.h |  2 +-
>>>  2 files changed, 16 insertions(+), 1 deletion(-)
>>>
>>> Hi Rafael,
>>>
>>> If you are fine with this, can you provide Ack, so that we route this
>>> through ARM64 tree where most of the ACPI PPTT support is present.
>>>
>>> Regards,
>>> Sudeep
>>>
>>> v1->v2:
>>>         - removed duplicate definition for acpi_find_last_cache_level
>>>
>>> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
>>> index 8f2cdb0eca71..4b35a66383f9 100644
>>> --- a/include/linux/acpi.h
>>> +++ b/include/linux/acpi.h
>>> @@ -1299,8 +1299,23 @@ static inline int lpit_read_residency_count_address(u64 *address)
>>>  }
>>>  #endif
>>>
>>> +#ifdef CONFIG_ACPI_PPTT
>>>  int find_acpi_cpu_topology(unsigned int cpu, int level);
>>>  int find_acpi_cpu_topology_package(unsigned int cpu);
>>>  int find_acpi_cpu_cache_topology(unsigned int cpu, int level);
>>> +#else
>>> +static inline int find_acpi_cpu_topology(unsigned int cpu, int level)
>>> +{
>>> +       return -EINVAL;
>>
>> Why -EINVAL?
>>
>
> I am not sure either. I used to return -ENOTSUPP, but IIRC someone
> suggested to use it only for syscalls. Also I just based it on other
> existing functions in acpi.h
>
> I am open for any alternatives if you think that is better here.

It would be good to make it consistent with the error codes returned
by the functions when they are present.

Anyway, it's fine by me if that's consistent with the other acpi.h stubs.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sudeep Holla June 5, 2018, 4:18 p.m. UTC | #4
On 05/06/18 17:12, Rafael J. Wysocki wrote:
> On Tue, Jun 5, 2018 at 5:33 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>
>>
>> On 05/06/18 16:00, Rafael J. Wysocki wrote:
>>> On Tue, Jun 5, 2018 at 4:35 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>>> Though CONFIG_ACPI_PPTT is selected by platforms and nor user visible,
>>>> it may be useful to support the build with CONFIG_ACPI_PPTT disabled.
>>>>
>>>> This patch adds the missing dummy/boiler plate implementation to fix
>>>> the build.
>>>>
>>>> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>>>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>>>> ---
>>>>  include/linux/acpi.h      | 15 +++++++++++++++
>>>>  include/linux/cacheinfo.h |  2 +-
>>>>  2 files changed, 16 insertions(+), 1 deletion(-)
>>>>
>>>> Hi Rafael,
>>>>
>>>> If you are fine with this, can you provide Ack, so that we route this
>>>> through ARM64 tree where most of the ACPI PPTT support is present.
>>>>
>>>> Regards,
>>>> Sudeep
>>>>
>>>> v1->v2:
>>>>         - removed duplicate definition for acpi_find_last_cache_level
>>>>
>>>> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
>>>> index 8f2cdb0eca71..4b35a66383f9 100644
>>>> --- a/include/linux/acpi.h
>>>> +++ b/include/linux/acpi.h
>>>> @@ -1299,8 +1299,23 @@ static inline int lpit_read_residency_count_address(u64 *address)
>>>>  }
>>>>  #endif
>>>>
>>>> +#ifdef CONFIG_ACPI_PPTT
>>>>  int find_acpi_cpu_topology(unsigned int cpu, int level);
>>>>  int find_acpi_cpu_topology_package(unsigned int cpu);
>>>>  int find_acpi_cpu_cache_topology(unsigned int cpu, int level);
>>>> +#else
>>>> +static inline int find_acpi_cpu_topology(unsigned int cpu, int level)
>>>> +{
>>>> +       return -EINVAL;
>>>
>>> Why -EINVAL?
>>>
>>
>> I am not sure either. I used to return -ENOTSUPP, but IIRC someone
>> suggested to use it only for syscalls. Also I just based it on other
>> existing functions in acpi.h
>>
>> I am open for any alternatives if you think that is better here.
> 
> It would be good to make it consistent with the error codes returned
> by the functions when they are present.
> 
> Anyway, it's fine by me if that's consistent with the other acpi.h stubs.
> 

Thanks, indeed I copied it from existing stubs.

Can I take this as official Ack ?
Rafael J. Wysocki June 5, 2018, 4:20 p.m. UTC | #5
On Tue, Jun 5, 2018 at 6:18 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>
>
> On 05/06/18 17:12, Rafael J. Wysocki wrote:
>> On Tue, Jun 5, 2018 at 5:33 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>>
>>>
>>> On 05/06/18 16:00, Rafael J. Wysocki wrote:
>>>> On Tue, Jun 5, 2018 at 4:35 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>>>> Though CONFIG_ACPI_PPTT is selected by platforms and nor user visible,
>>>>> it may be useful to support the build with CONFIG_ACPI_PPTT disabled.
>>>>>
>>>>> This patch adds the missing dummy/boiler plate implementation to fix
>>>>> the build.
>>>>>
>>>>> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>>>>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>>>>> ---
>>>>>  include/linux/acpi.h      | 15 +++++++++++++++
>>>>>  include/linux/cacheinfo.h |  2 +-
>>>>>  2 files changed, 16 insertions(+), 1 deletion(-)
>>>>>
>>>>> Hi Rafael,
>>>>>
>>>>> If you are fine with this, can you provide Ack, so that we route this
>>>>> through ARM64 tree where most of the ACPI PPTT support is present.
>>>>>
>>>>> Regards,
>>>>> Sudeep
>>>>>
>>>>> v1->v2:
>>>>>         - removed duplicate definition for acpi_find_last_cache_level
>>>>>
>>>>> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
>>>>> index 8f2cdb0eca71..4b35a66383f9 100644
>>>>> --- a/include/linux/acpi.h
>>>>> +++ b/include/linux/acpi.h
>>>>> @@ -1299,8 +1299,23 @@ static inline int lpit_read_residency_count_address(u64 *address)
>>>>>  }
>>>>>  #endif
>>>>>
>>>>> +#ifdef CONFIG_ACPI_PPTT
>>>>>  int find_acpi_cpu_topology(unsigned int cpu, int level);
>>>>>  int find_acpi_cpu_topology_package(unsigned int cpu);
>>>>>  int find_acpi_cpu_cache_topology(unsigned int cpu, int level);
>>>>> +#else
>>>>> +static inline int find_acpi_cpu_topology(unsigned int cpu, int level)
>>>>> +{
>>>>> +       return -EINVAL;
>>>>
>>>> Why -EINVAL?
>>>>
>>>
>>> I am not sure either. I used to return -ENOTSUPP, but IIRC someone
>>> suggested to use it only for syscalls. Also I just based it on other
>>> existing functions in acpi.h
>>>
>>> I am open for any alternatives if you think that is better here.
>>
>> It would be good to make it consistent with the error codes returned
>> by the functions when they are present.
>>
>> Anyway, it's fine by me if that's consistent with the other acpi.h stubs.
>>
>
> Thanks, indeed I copied it from existing stubs.
>
> Can I take this as official Ack ?

Yes, please.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Catalin Marinas June 5, 2018, 5:08 p.m. UTC | #6
On Tue, Jun 05, 2018 at 03:35:03PM +0100, Sudeep Holla wrote:
> Though CONFIG_ACPI_PPTT is selected by platforms and nor user visible,
> it may be useful to support the build with CONFIG_ACPI_PPTT disabled.
> 
> This patch adds the missing dummy/boiler plate implementation to fix
> the build.
> 
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  include/linux/acpi.h      | 15 +++++++++++++++
>  include/linux/cacheinfo.h |  2 +-
>  2 files changed, 16 insertions(+), 1 deletion(-)

I queued this patch for now, it's a good clean-up regardless of whether
we disable PPTT temporarily or not.

Thanks.
diff mbox

Patch

diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 8f2cdb0eca71..4b35a66383f9 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1299,8 +1299,23 @@  static inline int lpit_read_residency_count_address(u64 *address)
 }
 #endif
 
+#ifdef CONFIG_ACPI_PPTT
 int find_acpi_cpu_topology(unsigned int cpu, int level);
 int find_acpi_cpu_topology_package(unsigned int cpu);
 int find_acpi_cpu_cache_topology(unsigned int cpu, int level);
+#else
+static inline int find_acpi_cpu_topology(unsigned int cpu, int level)
+{
+	return -EINVAL;
+}
+static inline int find_acpi_cpu_topology_package(unsigned int cpu)
+{
+	return -EINVAL;
+}
+static inline int find_acpi_cpu_cache_topology(unsigned int cpu, int level)
+{
+	return -EINVAL;
+}
+#endif
 
 #endif	/*_LINUX_ACPI_H*/
diff --git a/include/linux/cacheinfo.h b/include/linux/cacheinfo.h
index 89397e30e269..70e19bc6cc9f 100644
--- a/include/linux/cacheinfo.h
+++ b/include/linux/cacheinfo.h
@@ -98,7 +98,7 @@  struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu);
 int init_cache_level(unsigned int cpu);
 int populate_cache_leaves(unsigned int cpu);
 int cache_setup_acpi(unsigned int cpu);
-#ifndef CONFIG_ACPI
+#ifndef CONFIG_ACPI_PPTT
 /*
  * acpi_find_last_cache_level is only called on ACPI enabled
  * platforms using the PPTT for topology. This means that if