mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: rui.zhang@intel.com, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, Len Brown <lenb@kernel.org>,
	"open list:ACPI" <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH v3 5/6] thermal/drivers/acpi: Make cross dev link optional by configuration
Date: Tue, 18 Apr 2023 15:44:44 +0200	[thread overview]
Message-ID: <7fd7df2d-f473-c0fd-5c3c-40d0fb697db7@linaro.org> (raw)
In-Reply-To: <CAJZ5v0jqB18c1u-eqcEiXW+fOH=nX=Uu3xi5sp2F9udsFUrYew@mail.gmail.com>

On 18/04/2023 15:38, Rafael J. Wysocki wrote:
> On Thu, Apr 13, 2023 at 1:47 PM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>>
>> The ACPI thermal driver creates a link in the thermal zone device
>> sysfs directory pointing to the device sysfs directory. At the same
>> time, it creates a back pointer link from the device to the thermal
>> zone device sysfs directory.
>>
>>  From a generic perspective, having a device pointer in the sysfs
>> thermal zone directory may make sense. But the opposite is not true as
>> the same driver can be related to multiple thermal zones.
>>
>> The usage of these information is very specific to ACPI and it is
>> questionable if they are really needed.
>>
>> Let's make the code optional and disable it by default. If it hurts,
>> we will revert this change.
>>
>> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
>> ---
>>   drivers/acpi/Kconfig   | 13 +++++++++
>>   drivers/acpi/thermal.c | 62 ++++++++++++++++++++++++++++--------------
>>   2 files changed, 55 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
>> index ccbeab9500ec..7df4e18f06ef 100644
>> --- a/drivers/acpi/Kconfig
>> +++ b/drivers/acpi/Kconfig
>> @@ -336,6 +336,19 @@ config ACPI_THERMAL
>>            To compile this driver as a module, choose M here:
>>            the module will be called thermal.
>>
>> +config ACPI_THERMAL_SYSFS_ADDON
>> +       bool "Enable thermal sysfs addon"
>> +       depends on ACPI_THERMAL
>> +       def_bool n
>> +       help
>> +        Enable sysfs extra information added in the thermal zone and
>> +        the driver specific sysfs directories. That could be a link
>> +        to the associated thermal zone as well as a link pointing to
>> +        the device from the thermal zone. By default those are
>> +        disabled and are candidate for removal, if you need these
>> +        information anyway, enable the option or upgrade the
>> +        userspace program using them.
>> +
> 
> I don't think that the Kconfig option is appropriate and the help text
> above isn't really helpful.

I'm sorry, I'm missing something. Don't we want to make these sysfs 
extra information optional and disable them by default ?

>>   config ACPI_PLATFORM_PROFILE
>>          tristate
>>
>> diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
>> index 5763db4528b8..30fe189d04f8 100644
>> --- a/drivers/acpi/thermal.c
>> +++ b/drivers/acpi/thermal.c
>> @@ -787,9 +787,44 @@ static struct thermal_zone_device_ops acpi_thermal_zone_ops = {
>>          .critical = acpi_thermal_zone_device_critical,
>>   };
>>
>> +#ifdef CONFIG_ACPI_THERMAL_SYSFS_ADDON
> 
> I agree with moving the code in question to separate functions, but I
> don't agree with putting it under the Kconfig option.

Do you mean use IS_ENABLED check like what is done with Menlow patch 6 ?

[ ... ]


-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


  reply	other threads:[~2023-04-18 13:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 11:46 [PATCH v3 0/6] Thermal zone device structure encapsulation Daniel Lezcano
2023-04-13 11:46 ` [PATCH v3 1/6] thermal/core: Encapsulate tz->device field Daniel Lezcano
2023-04-13 11:46 ` [PATCH v3 2/6] thermal/drivers/intel_pch_thermal: Use thermal driver device to write a trace Daniel Lezcano
2023-04-13 11:46 ` [PATCH v3 3/6] thermal/drivers/acpi: Use thermal_zone_device() Daniel Lezcano
2023-04-13 11:46 ` [PATCH v3 4/6] thermal/drivers/menlow: " Daniel Lezcano
2023-04-13 11:46 ` [PATCH v3 5/6] thermal/drivers/acpi: Make cross dev link optional by configuration Daniel Lezcano
2023-04-18 13:38   ` Rafael J. Wysocki
2023-04-18 13:44     ` Daniel Lezcano [this message]
2023-04-18 13:47       ` Rafael J. Wysocki
2023-04-18 13:48         ` Daniel Lezcano
2023-04-13 11:46 ` [PATCH v3 6/6] thermal/drivers/intel_menlow: Make additionnal sysfs information optional Daniel Lezcano
2023-04-18 13:46   ` Rafael J. Wysocki
2023-04-17 13:17 ` [PATCH v3 0/6] Thermal zone device structure encapsulation Daniel Lezcano
2023-04-18 13:51   ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7fd7df2d-f473-c0fd-5c3c-40d0fb697db7@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®