* [PATCH v2 0/2] hwmon: (pwm-fan) add option to leave fan on shutdown
@ 2024-10-26 8:05 Akinobu Mita
2024-10-26 8:05 ` [PATCH v2 1/2] " Akinobu Mita
` (2 more replies)
0 siblings, 3 replies; 19+ messages in thread
From: Akinobu Mita @ 2024-10-26 8:05 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-hwmon, devicetree, akinobu.mita
I sent these patches a long time ago, but I didn't cc them to the DT list,
so the DT bindings changes weren't reviewed.
There have been a lot of changes to pwm-fan since then, and I've updated
the patch, so please review again.
Akinobu Mita (2):
hwmon: (pwm-fan) add option to leave fan on shutdown
dt-bindings: hwmon: pwm-fan: add retain-state-shutdown property
Documentation/devicetree/bindings/hwmon/pwm-fan.yaml | 4 ++++
drivers/hwmon/pwm-fan.c | 6 +++++-
2 files changed, 9 insertions(+), 1 deletion(-)
--
2.34.1
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown
2024-10-26 8:05 [PATCH v2 0/2] hwmon: (pwm-fan) add option to leave fan on shutdown Akinobu Mita
@ 2024-10-26 8:05 ` Akinobu Mita
2024-10-29 2:34 ` Billy Tsai
2024-10-26 8:05 ` [PATCH v2 2/2] dt-bindings: hwmon: pwm-fan: add retain-state-shutdown property Akinobu Mita
2024-10-26 16:19 ` [PATCH v2 0/2] hwmon: (pwm-fan) add option to leave fan on shutdown Guenter Roeck
2 siblings, 1 reply; 19+ messages in thread
From: Akinobu Mita @ 2024-10-26 8:05 UTC (permalink / raw)
To: linux-kernel
Cc: linux-hwmon, devicetree, akinobu.mita, Jean Delvare,
Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Billy Tsai
This adds an optional property "retain-state-shutdown" as requested by
Billy Tsai.
Billy said:
"Our platform is BMC that will use a PWM-FAN driver to control the fan
on the managed host. In our case, we do not want to stop the fan when
the BMC is reboot, which may cause the temperature of the managed host
not to be lowered."
Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Rob Herring <robh@kernel.org>
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
Cc: Conor Dooley <conor+dt@kernel.org>
Cc: Billy Tsai <billy_tsai@aspeedtech.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
drivers/hwmon/pwm-fan.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
index c434db4656e7..dcb48a41f9f0 100644
--- a/drivers/hwmon/pwm-fan.c
+++ b/drivers/hwmon/pwm-fan.c
@@ -51,6 +51,7 @@ struct pwm_fan_ctx {
u32 *pulses_per_revolution;
ktime_t sample_start;
struct timer_list rpm_timer;
+ bool retain_state_shutdown;
unsigned int pwm_value;
unsigned int pwm_fan_state;
@@ -490,6 +491,8 @@ static int pwm_fan_probe(struct platform_device *pdev)
mutex_init(&ctx->lock);
+ ctx->retain_state_shutdown = device_property_read_bool(dev, "retain-state-shutdown");
+
ctx->dev = &pdev->dev;
ctx->pwm = devm_pwm_get(dev, NULL);
if (IS_ERR(ctx->pwm))
@@ -655,7 +658,8 @@ static void pwm_fan_shutdown(struct platform_device *pdev)
{
struct pwm_fan_ctx *ctx = platform_get_drvdata(pdev);
- pwm_fan_cleanup(ctx);
+ if (!ctx->retain_state_shutdown)
+ pwm_fan_cleanup(ctx);
}
static int pwm_fan_suspend(struct device *dev)
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 2/2] dt-bindings: hwmon: pwm-fan: add retain-state-shutdown property
2024-10-26 8:05 [PATCH v2 0/2] hwmon: (pwm-fan) add option to leave fan on shutdown Akinobu Mita
2024-10-26 8:05 ` [PATCH v2 1/2] " Akinobu Mita
@ 2024-10-26 8:05 ` Akinobu Mita
2024-10-27 20:38 ` Krzysztof Kozlowski
2024-10-26 16:19 ` [PATCH v2 0/2] hwmon: (pwm-fan) add option to leave fan on shutdown Guenter Roeck
2 siblings, 1 reply; 19+ messages in thread
From: Akinobu Mita @ 2024-10-26 8:05 UTC (permalink / raw)
To: linux-kernel
Cc: linux-hwmon, devicetree, akinobu.mita, Jean Delvare,
Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Billy Tsai
Document new retain-state-shutdown property.
Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Rob Herring <robh@kernel.org>
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
Cc: Conor Dooley <conor+dt@kernel.org>
Cc: Billy Tsai <billy_tsai@aspeedtech.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
Documentation/devicetree/bindings/hwmon/pwm-fan.yaml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
index 4e5abf7580cc..86a069969e29 100644
--- a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
+++ b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
@@ -40,6 +40,10 @@ properties:
maximum: 4
default: 2
+ retain-state-shutdown:
+ description: Retain the state of the PWM on shutdown.
+ $ref: /schemas/types.yaml#/definitions/flag
+
pwms:
description: The PWM that is used to control the fan.
maxItems: 1
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH v2 0/2] hwmon: (pwm-fan) add option to leave fan on shutdown
2024-10-26 8:05 [PATCH v2 0/2] hwmon: (pwm-fan) add option to leave fan on shutdown Akinobu Mita
2024-10-26 8:05 ` [PATCH v2 1/2] " Akinobu Mita
2024-10-26 8:05 ` [PATCH v2 2/2] dt-bindings: hwmon: pwm-fan: add retain-state-shutdown property Akinobu Mita
@ 2024-10-26 16:19 ` Guenter Roeck
2024-10-27 5:31 ` Akinobu Mita
2 siblings, 1 reply; 19+ messages in thread
From: Guenter Roeck @ 2024-10-26 16:19 UTC (permalink / raw)
To: Akinobu Mita, linux-kernel; +Cc: linux-hwmon, devicetree
On 10/26/24 01:05, Akinobu Mita wrote:
> I sent these patches a long time ago, but I didn't cc them to the DT list,
> so the DT bindings changes weren't reviewed.
>
> There have been a lot of changes to pwm-fan since then, and I've updated
> the patch, so please review again.
>
What changed ? Where is the change log ?
Guenter
> Akinobu Mita (2):
> hwmon: (pwm-fan) add option to leave fan on shutdown
> dt-bindings: hwmon: pwm-fan: add retain-state-shutdown property
>
> Documentation/devicetree/bindings/hwmon/pwm-fan.yaml | 4 ++++
> drivers/hwmon/pwm-fan.c | 6 +++++-
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 0/2] hwmon: (pwm-fan) add option to leave fan on shutdown
2024-10-26 16:19 ` [PATCH v2 0/2] hwmon: (pwm-fan) add option to leave fan on shutdown Guenter Roeck
@ 2024-10-27 5:31 ` Akinobu Mita
0 siblings, 0 replies; 19+ messages in thread
From: Akinobu Mita @ 2024-10-27 5:31 UTC (permalink / raw)
To: Guenter Roeck
Cc: linux-kernel, linux-hwmon, devicetree, Jean Delvare, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Billy Tsai
2024年10月27日(日) 1:19 Guenter Roeck <linux@roeck-us.net>:
>
> On 10/26/24 01:05, Akinobu Mita wrote:
> > I sent these patches a long time ago, but I didn't cc them to the DT list,
> > so the DT bindings changes weren't reviewed.
> >
> > There have been a lot of changes to pwm-fan since then, and I've updated
> > the patch, so please review again.
> >
>
> What changed ? Where is the change log ?
Sorry, I forgot to write the changelog.
Changes in v2
Patch 1:
- use device_property_read_bool() instead of of_property_read_bool()
- skip calling pwn_fan_cleanup() when newly introduced property is set
(Since pwm_fan_disable() call in the shutdown() method has been changed to
pwm_fan_cleanup() call since commit b99152d4f04b ("hwmon: (pwm-fan) Switch
regulator dynamically"), pwm_fan_disable() no longer exists.)
Patch 2:
- document the new property according to yaml format conversion
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 2/2] dt-bindings: hwmon: pwm-fan: add retain-state-shutdown property
2024-10-26 8:05 ` [PATCH v2 2/2] dt-bindings: hwmon: pwm-fan: add retain-state-shutdown property Akinobu Mita
@ 2024-10-27 20:38 ` Krzysztof Kozlowski
2024-10-28 12:42 ` Akinobu Mita
0 siblings, 1 reply; 19+ messages in thread
From: Krzysztof Kozlowski @ 2024-10-27 20:38 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-hwmon, devicetree, Jean Delvare,
Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Billy Tsai
On Sat, Oct 26, 2024 at 05:05:35PM +0900, Akinobu Mita wrote:
> Document new retain-state-shutdown property.
>
> Cc: Jean Delvare <jdelvare@suse.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
> Cc: Conor Dooley <conor+dt@kernel.org>
> Cc: Billy Tsai <billy_tsai@aspeedtech.com>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> ---
> Documentation/devicetree/bindings/hwmon/pwm-fan.yaml | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
> index 4e5abf7580cc..86a069969e29 100644
> --- a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
> @@ -40,6 +40,10 @@ properties:
> maximum: 4
> default: 2
>
> + retain-state-shutdown:
> + description: Retain the state of the PWM on shutdown.
You described the desired Linux feature or behavior, not the actual
hardware. The bindings are about the latter, so instead you need to
rephrase the property and its description to match actual hardware
capabilities/features/configuration etc.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 2/2] dt-bindings: hwmon: pwm-fan: add retain-state-shutdown property
2024-10-27 20:38 ` Krzysztof Kozlowski
@ 2024-10-28 12:42 ` Akinobu Mita
2024-10-28 14:22 ` Krzysztof Kozlowski
0 siblings, 1 reply; 19+ messages in thread
From: Akinobu Mita @ 2024-10-28 12:42 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: linux-kernel, linux-hwmon, devicetree, Jean Delvare,
Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Billy Tsai
2024年10月28日(月) 5:38 Krzysztof Kozlowski <krzk@kernel.org>:
>
> On Sat, Oct 26, 2024 at 05:05:35PM +0900, Akinobu Mita wrote:
> > Document new retain-state-shutdown property.
> >
> > Cc: Jean Delvare <jdelvare@suse.com>
> > Cc: Guenter Roeck <linux@roeck-us.net>
> > Cc: Rob Herring <robh@kernel.org>
> > Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
> > Cc: Conor Dooley <conor+dt@kernel.org>
> > Cc: Billy Tsai <billy_tsai@aspeedtech.com>
> > Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> > ---
> > Documentation/devicetree/bindings/hwmon/pwm-fan.yaml | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
> > index 4e5abf7580cc..86a069969e29 100644
> > --- a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
> > +++ b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
> > @@ -40,6 +40,10 @@ properties:
> > maximum: 4
> > default: 2
> >
> > + retain-state-shutdown:
> > + description: Retain the state of the PWM on shutdown.
>
> You described the desired Linux feature or behavior, not the actual
> hardware. The bindings are about the latter, so instead you need to
> rephrase the property and its description to match actual hardware
> capabilities/features/configuration etc.
Is this description okay?
(Reused the description of retain-state-shutdown in leds-gpio.yaml)
description:
Retain the state of the PWM on shutdown. Useful in BMC systems, for
example, when the BMC is rebooted while the host remains up, the fan
will not stop.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 2/2] dt-bindings: hwmon: pwm-fan: add retain-state-shutdown property
2024-10-28 12:42 ` Akinobu Mita
@ 2024-10-28 14:22 ` Krzysztof Kozlowski
2024-10-28 14:57 ` Akinobu Mita
0 siblings, 1 reply; 19+ messages in thread
From: Krzysztof Kozlowski @ 2024-10-28 14:22 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-hwmon, devicetree, Jean Delvare,
Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Billy Tsai
On 28/10/2024 13:42, Akinobu Mita wrote:
> 2024年10月28日(月) 5:38 Krzysztof Kozlowski <krzk@kernel.org>:
>>
>> On Sat, Oct 26, 2024 at 05:05:35PM +0900, Akinobu Mita wrote:
>>> Document new retain-state-shutdown property.
>>>
>>> Cc: Jean Delvare <jdelvare@suse.com>
>>> Cc: Guenter Roeck <linux@roeck-us.net>
>>> Cc: Rob Herring <robh@kernel.org>
>>> Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
>>> Cc: Conor Dooley <conor+dt@kernel.org>
>>> Cc: Billy Tsai <billy_tsai@aspeedtech.com>
>>> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
>>> ---
>>> Documentation/devicetree/bindings/hwmon/pwm-fan.yaml | 4 ++++
>>> 1 file changed, 4 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
>>> index 4e5abf7580cc..86a069969e29 100644
>>> --- a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
>>> +++ b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
>>> @@ -40,6 +40,10 @@ properties:
>>> maximum: 4
>>> default: 2
>>>
>>> + retain-state-shutdown:
>>> + description: Retain the state of the PWM on shutdown.
>>
>> You described the desired Linux feature or behavior, not the actual
>> hardware. The bindings are about the latter, so instead you need to
>> rephrase the property and its description to match actual hardware
>> capabilities/features/configuration etc.
>
> Is this description okay?
> (Reused the description of retain-state-shutdown in leds-gpio.yaml)
>
> description:
> Retain the state of the PWM on shutdown. Useful in BMC systems, for
> example, when the BMC is rebooted while the host remains up, the fan
> will not stop.
Nothing improved in the property. You still say what the system should
do. This is user-space choice, not DT.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 2/2] dt-bindings: hwmon: pwm-fan: add retain-state-shutdown property
2024-10-28 14:22 ` Krzysztof Kozlowski
@ 2024-10-28 14:57 ` Akinobu Mita
2024-10-30 15:18 ` Krzysztof Kozlowski
0 siblings, 1 reply; 19+ messages in thread
From: Akinobu Mita @ 2024-10-28 14:57 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: linux-kernel, linux-hwmon, devicetree, Jean Delvare,
Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Billy Tsai
2024年10月28日(月) 23:22 Krzysztof Kozlowski <krzk@kernel.org>:
>
> On 28/10/2024 13:42, Akinobu Mita wrote:
> > 2024年10月28日(月) 5:38 Krzysztof Kozlowski <krzk@kernel.org>:
> >>
> >> On Sat, Oct 26, 2024 at 05:05:35PM +0900, Akinobu Mita wrote:
> >>> Document new retain-state-shutdown property.
> >>>
> >>> Cc: Jean Delvare <jdelvare@suse.com>
> >>> Cc: Guenter Roeck <linux@roeck-us.net>
> >>> Cc: Rob Herring <robh@kernel.org>
> >>> Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
> >>> Cc: Conor Dooley <conor+dt@kernel.org>
> >>> Cc: Billy Tsai <billy_tsai@aspeedtech.com>
> >>> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> >>> ---
> >>> Documentation/devicetree/bindings/hwmon/pwm-fan.yaml | 4 ++++
> >>> 1 file changed, 4 insertions(+)
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
> >>> index 4e5abf7580cc..86a069969e29 100644
> >>> --- a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
> >>> +++ b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml
> >>> @@ -40,6 +40,10 @@ properties:
> >>> maximum: 4
> >>> default: 2
> >>>
> >>> + retain-state-shutdown:
> >>> + description: Retain the state of the PWM on shutdown.
> >>
> >> You described the desired Linux feature or behavior, not the actual
> >> hardware. The bindings are about the latter, so instead you need to
> >> rephrase the property and its description to match actual hardware
> >> capabilities/features/configuration etc.
> >
> > Is this description okay?
> > (Reused the description of retain-state-shutdown in leds-gpio.yaml)
> >
> > description:
> > Retain the state of the PWM on shutdown. Useful in BMC systems, for
> > example, when the BMC is rebooted while the host remains up, the fan
> > will not stop.
>
> Nothing improved in the property. You still say what the system should
> do. This is user-space choice, not DT.
It seems better to implement it as a device attribute.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown
2024-10-26 8:05 ` [PATCH v2 1/2] " Akinobu Mita
@ 2024-10-29 2:34 ` Billy Tsai
2024-10-30 14:55 ` Akinobu Mita
0 siblings, 1 reply; 19+ messages in thread
From: Billy Tsai @ 2024-10-29 2:34 UTC (permalink / raw)
To: Akinobu Mita, linux-kernel@vger.kernel.org
Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
> This adds an optional property "retain-state-shutdown" as requested by
> Billy Tsai.
> Billy said:
> "Our platform is BMC that will use a PWM-FAN driver to control the fan
> on the managed host. In our case, we do not want to stop the fan when
> the BMC is reboot, which may cause the temperature of the managed host
> not to be lowered."
I confirmed that it works properly.
Reviewed-by: Billy Tsai <billy_tsai@aspeedtech.com>
Tested-by: Billy Tsai <billy_tsai@aspeedtech.com>
Thanks
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown
2024-10-29 2:34 ` Billy Tsai
@ 2024-10-30 14:55 ` Akinobu Mita
2024-10-30 15:02 ` Guenter Roeck
0 siblings, 1 reply; 19+ messages in thread
From: Akinobu Mita @ 2024-10-30 14:55 UTC (permalink / raw)
To: Billy Tsai
Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
devicetree@vger.kernel.org, Jean Delvare, Guenter Roeck,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
2024年10月29日(火) 11:35 Billy Tsai <billy_tsai@aspeedtech.com>:
>
> > This adds an optional property "retain-state-shutdown" as requested by
> > Billy Tsai.
>
> > Billy said:
> > "Our platform is BMC that will use a PWM-FAN driver to control the fan
> > on the managed host. In our case, we do not want to stop the fan when
> > the BMC is reboot, which may cause the temperature of the managed host
> > not to be lowered."
>
> I confirmed that it works properly.
>
> Reviewed-by: Billy Tsai <billy_tsai@aspeedtech.com>
> Tested-by: Billy Tsai <billy_tsai@aspeedtech.com>
Thank you very much for testing.
However, I plan to change this option to device attribute
(/sys/class/hwmon/hwmonX/retain-state-shutdown) instead of the device tree.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown
2024-10-30 14:55 ` Akinobu Mita
@ 2024-10-30 15:02 ` Guenter Roeck
2024-10-30 15:18 ` Akinobu Mita
0 siblings, 1 reply; 19+ messages in thread
From: Guenter Roeck @ 2024-10-30 15:02 UTC (permalink / raw)
To: Akinobu Mita, Billy Tsai
Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
devicetree@vger.kernel.org, Jean Delvare, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
On 10/30/24 07:55, Akinobu Mita wrote:
> 2024年10月29日(火) 11:35 Billy Tsai <billy_tsai@aspeedtech.com>:
>>
>>> This adds an optional property "retain-state-shutdown" as requested by
>>> Billy Tsai.
>>
>>> Billy said:
>>> "Our platform is BMC that will use a PWM-FAN driver to control the fan
>>> on the managed host. In our case, we do not want to stop the fan when
>>> the BMC is reboot, which may cause the temperature of the managed host
>>> not to be lowered."
>>
>> I confirmed that it works properly.
>>
>> Reviewed-by: Billy Tsai <billy_tsai@aspeedtech.com>
>> Tested-by: Billy Tsai <billy_tsai@aspeedtech.com>
>
> Thank you very much for testing.
> However, I plan to change this option to device attribute
> (/sys/class/hwmon/hwmonX/retain-state-shutdown) instead of the device tree.
No, I won't acccept that.
Guenter
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 2/2] dt-bindings: hwmon: pwm-fan: add retain-state-shutdown property
2024-10-28 14:57 ` Akinobu Mita
@ 2024-10-30 15:18 ` Krzysztof Kozlowski
2024-10-30 15:34 ` Akinobu Mita
0 siblings, 1 reply; 19+ messages in thread
From: Krzysztof Kozlowski @ 2024-10-30 15:18 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-hwmon, devicetree, Jean Delvare,
Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Billy Tsai
On 28/10/2024 15:57, Akinobu Mita wrote:
>>>>
>>>> You described the desired Linux feature or behavior, not the actual
>>>> hardware. The bindings are about the latter, so instead you need to
>>>> rephrase the property and its description to match actual hardware
>>>> capabilities/features/configuration etc.
>>>
>>> Is this description okay?
>>> (Reused the description of retain-state-shutdown in leds-gpio.yaml)
>>>
>>> description:
>>> Retain the state of the PWM on shutdown. Useful in BMC systems, for
>>> example, when the BMC is rebooted while the host remains up, the fan
>>> will not stop.
>>
>> Nothing improved in the property. You still say what the system should
>> do. This is user-space choice, not DT.
>
> It seems better to implement it as a device attribute.
I don't know about that. To repeat: if you say what system is supposed
to be doing, it is a policy. Describe the hardware and its configuration
and maybe this would be suitable for DT.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown
2024-10-30 15:02 ` Guenter Roeck
@ 2024-10-30 15:18 ` Akinobu Mita
2024-10-30 15:30 ` Guenter Roeck
0 siblings, 1 reply; 19+ messages in thread
From: Akinobu Mita @ 2024-10-30 15:18 UTC (permalink / raw)
To: Guenter Roeck
Cc: Billy Tsai, linux-kernel@vger.kernel.org,
linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
Jean Delvare, Rob Herring, Krzysztof Kozlowski, Conor Dooley
2024年10月31日(木) 0:02 Guenter Roeck <linux@roeck-us.net>:
>
> On 10/30/24 07:55, Akinobu Mita wrote:
> > 2024年10月29日(火) 11:35 Billy Tsai <billy_tsai@aspeedtech.com>:
> >>
> >>> This adds an optional property "retain-state-shutdown" as requested by
> >>> Billy Tsai.
> >>
> >>> Billy said:
> >>> "Our platform is BMC that will use a PWM-FAN driver to control the fan
> >>> on the managed host. In our case, we do not want to stop the fan when
> >>> the BMC is reboot, which may cause the temperature of the managed host
> >>> not to be lowered."
> >>
> >> I confirmed that it works properly.
> >>
> >> Reviewed-by: Billy Tsai <billy_tsai@aspeedtech.com>
> >> Tested-by: Billy Tsai <billy_tsai@aspeedtech.com>
> >
> > Thank you very much for testing.
> > However, I plan to change this option to device attribute
> > (/sys/class/hwmon/hwmonX/retain-state-shutdown) instead of the device tree.
>
>
> No, I won't acccept that.
Oops, I mean /sys/device/platform/pwm-fan.X/retain-state-shutdown
not /sys/class/hwmon/hwmonX/retain-state-shutdown.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown
2024-10-30 15:18 ` Akinobu Mita
@ 2024-10-30 15:30 ` Guenter Roeck
0 siblings, 0 replies; 19+ messages in thread
From: Guenter Roeck @ 2024-10-30 15:30 UTC (permalink / raw)
To: Akinobu Mita
Cc: Billy Tsai, linux-kernel@vger.kernel.org,
linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
Jean Delvare, Rob Herring, Krzysztof Kozlowski, Conor Dooley
On 10/30/24 08:18, Akinobu Mita wrote:
> 2024年10月31日(木) 0:02 Guenter Roeck <linux@roeck-us.net>:
>>
>> On 10/30/24 07:55, Akinobu Mita wrote:
>>> 2024年10月29日(火) 11:35 Billy Tsai <billy_tsai@aspeedtech.com>:
>>>>
>>>>> This adds an optional property "retain-state-shutdown" as requested by
>>>>> Billy Tsai.
>>>>
>>>>> Billy said:
>>>>> "Our platform is BMC that will use a PWM-FAN driver to control the fan
>>>>> on the managed host. In our case, we do not want to stop the fan when
>>>>> the BMC is reboot, which may cause the temperature of the managed host
>>>>> not to be lowered."
>>>>
>>>> I confirmed that it works properly.
>>>>
>>>> Reviewed-by: Billy Tsai <billy_tsai@aspeedtech.com>
>>>> Tested-by: Billy Tsai <billy_tsai@aspeedtech.com>
>>>
>>> Thank you very much for testing.
>>> However, I plan to change this option to device attribute
>>> (/sys/class/hwmon/hwmonX/retain-state-shutdown) instead of the device tree.
>>
>>
>> No, I won't acccept that.
>
> Oops, I mean /sys/device/platform/pwm-fan.X/retain-state-shutdown
> not /sys/class/hwmon/hwmonX/retain-state-shutdown.
That does not make a difference. It still very much looks like a system property
to me, and making it a device property to be set by userspace just looks like
a workaround to address refusal by dt maintainers to accept the system property.
You'll have to make the case for why this is _not_ a system property for me
to accept it.
Guenter
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 2/2] dt-bindings: hwmon: pwm-fan: add retain-state-shutdown property
2024-10-30 15:18 ` Krzysztof Kozlowski
@ 2024-10-30 15:34 ` Akinobu Mita
2024-11-04 7:45 ` Billy Tsai
0 siblings, 1 reply; 19+ messages in thread
From: Akinobu Mita @ 2024-10-30 15:34 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: linux-kernel, linux-hwmon, devicetree, Jean Delvare,
Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Billy Tsai
2024年10月31日(木) 0:18 Krzysztof Kozlowski <krzk@kernel.org>:
>
> On 28/10/2024 15:57, Akinobu Mita wrote:
> >>>>
> >>>> You described the desired Linux feature or behavior, not the actual
> >>>> hardware. The bindings are about the latter, so instead you need to
> >>>> rephrase the property and its description to match actual hardware
> >>>> capabilities/features/configuration etc.
> >>>
> >>> Is this description okay?
> >>> (Reused the description of retain-state-shutdown in leds-gpio.yaml)
> >>>
> >>> description:
> >>> Retain the state of the PWM on shutdown. Useful in BMC systems, for
> >>> example, when the BMC is rebooted while the host remains up, the fan
> >>> will not stop.
> >>
> >> Nothing improved in the property. You still say what the system should
> >> do. This is user-space choice, not DT.
> >
> > It seems better to implement it as a device attribute.
>
> I don't know about that. To repeat: if you say what system is supposed
> to be doing, it is a policy. Describe the hardware and its configuration
> and maybe this would be suitable for DT.
Billy, could you please write a proper description for this property?
I'm not the right person for this.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 2/2] dt-bindings: hwmon: pwm-fan: add retain-state-shutdown property
2024-10-30 15:34 ` Akinobu Mita
@ 2024-11-04 7:45 ` Billy Tsai
2024-11-04 11:47 ` Krzysztof Kozlowski
0 siblings, 1 reply; 19+ messages in thread
From: Billy Tsai @ 2024-11-04 7:45 UTC (permalink / raw)
To: Akinobu Mita, Krzysztof Kozlowski
Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
devicetree@vger.kernel.org, Jean Delvare, Guenter Roeck,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
> >
> > On 28/10/2024 15:57, Akinobu Mita wrote:
> > >>>>
> > >>>> You described the desired Linux feature or behavior, not the actual
> > >>>> hardware. The bindings are about the latter, so instead you need to
> > >>>> rephrase the property and its description to match actual hardware
> > >>>> capabilities/features/configuration etc.
> > >>>
> > >>> Is this description okay?
> > >>> (Reused the description of retain-state-shutdown in leds-gpio.yaml)
> > >>>
> > >>> description:
> > >>> Retain the state of the PWM on shutdown. Useful in BMC systems, for
> > >>> example, when the BMC is rebooted while the host remains up, the fan
> > >>> will not stop.
> > >>
> > >> Nothing improved in the property. You still say what the system should
> > >> do. This is user-space choice, not DT.
> > >
> > > It seems better to implement it as a device attribute.
> >
> > I don't know about that. To repeat: if you say what system is supposed
> > to be doing, it is a policy. Describe the hardware and its configuration
> > and maybe this would be suitable for DT.
> Billy, could you please write a proper description for this property?
> I'm not the right person for this.
In our hardware, if the system reboots and power remains on the PWM controller
will retain its original settings. However, the pwm-fan.c driver currently disables
the PWM controller during a system reboot. I need this property to prevent pwm-fan.c
from disabling the PWM when the system reboots.
In my point of view, the description can be:
Retain the state of the PWM on shutdown. Some platforms (e.g., BMC) will maintain
the PWM status after the system reboot. Add this property to prevent the PWM from being
disabled during the system reboot.
Thanks
Billy Tsai
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 2/2] dt-bindings: hwmon: pwm-fan: add retain-state-shutdown property
2024-11-04 7:45 ` Billy Tsai
@ 2024-11-04 11:47 ` Krzysztof Kozlowski
2024-11-05 8:16 ` Billy Tsai
0 siblings, 1 reply; 19+ messages in thread
From: Krzysztof Kozlowski @ 2024-11-04 11:47 UTC (permalink / raw)
To: Billy Tsai, Akinobu Mita
Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
devicetree@vger.kernel.org, Jean Delvare, Guenter Roeck,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
On 04/11/2024 08:45, Billy Tsai wrote:
>>>
>>> On 28/10/2024 15:57, Akinobu Mita wrote:
>>>>>>>
>>>>>>> You described the desired Linux feature or behavior, not the actual
>>>>>>> hardware. The bindings are about the latter, so instead you need to
>>>>>>> rephrase the property and its description to match actual hardware
>>>>>>> capabilities/features/configuration etc.
>>>>>>
>>>>>> Is this description okay?
>>>>>> (Reused the description of retain-state-shutdown in leds-gpio.yaml)
>>>>>>
>>>>>> description:
>>>>>> Retain the state of the PWM on shutdown. Useful in BMC systems, for
>>>>>> example, when the BMC is rebooted while the host remains up, the fan
>>>>>> will not stop.
>>>>>
>>>>> Nothing improved in the property. You still say what the system should
>>>>> do. This is user-space choice, not DT.
>>>>
>>>> It seems better to implement it as a device attribute.
>>>
>>> I don't know about that. To repeat: if you say what system is supposed
>>> to be doing, it is a policy. Describe the hardware and its configuration
>>> and maybe this would be suitable for DT.
>
>> Billy, could you please write a proper description for this property?
>> I'm not the right person for this.
>
> In our hardware, if the system reboots and power remains on the PWM controller
> will retain its original settings. However, the pwm-fan.c driver currently disables
> the PWM controller during a system reboot. I need this property to prevent pwm-fan.c
If we change the PWM core not to disable it, then we have to change
bindings?
How is this binding applicable on system (e.g. on *BSD) which does not
disable PWM on reboot?
> from disabling the PWM when the system reboots.
> In my point of view, the description can be:
> Retain the state of the PWM on shutdown. Some platforms (e.g., BMC) will maintain
> the PWM status after the system reboot. Add this property to prevent the PWM from being
> disabled during the system reboot.
You again describe what OS should do. First and last sentences are the same.
Probably what you want to say is that fan is some critical component
which should not be turned off or left unattended. Or that this hardware
keeps last state of register on reset, so some boards might want to use
it? If the first, then probably different property name. If the second,
current seems fine, just choose some description describing actual hardware.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 2/2] dt-bindings: hwmon: pwm-fan: add retain-state-shutdown property
2024-11-04 11:47 ` Krzysztof Kozlowski
@ 2024-11-05 8:16 ` Billy Tsai
0 siblings, 0 replies; 19+ messages in thread
From: Billy Tsai @ 2024-11-05 8:16 UTC (permalink / raw)
To: Krzysztof Kozlowski, Akinobu Mita
Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
devicetree@vger.kernel.org, Jean Delvare, Guenter Roeck,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
> >>>
> >>> On 28/10/2024 15:57, Akinobu Mita wrote:
> >>>>>>>
> >>>>>>> You described the desired Linux feature or behavior, not the actual
> >>>>>>> hardware. The bindings are about the latter, so instead you need to
> >>>>>>> rephrase the property and its description to match actual hardware
> >>>>>>> capabilities/features/configuration etc.
> >>>>>>
> >>>>>> Is this description okay?
> >>>>>> (Reused the description of retain-state-shutdown in leds-gpio.yaml)
> >>>>>>
> >>>>>> description:
> >>>>>> Retain the state of the PWM on shutdown. Useful in BMC systems, for
> >>>>>> example, when the BMC is rebooted while the host remains up, the fan
> >>>>>> will not stop.
> >>>>>
> >>>>> Nothing improved in the property. You still say what the system should
> >>>>> do. This is user-space choice, not DT.
> >>>>
> >>>> It seems better to implement it as a device attribute.
> >>>
> >>> I don't know about that. To repeat: if you say what system is supposed
> >>> to be doing, it is a policy. Describe the hardware and its configuration
> >>> and maybe this would be suitable for DT.
> >
> >> Billy, could you please write a proper description for this property?
> >> I'm not the right person for this.
> >
> > In our hardware, if the system reboots and power remains on the PWM controller
> > will retain its original settings. However, the pwm-fan.c driver currently disables
> > the PWM controller during a system reboot. I need this property to prevent pwm-fan.c
> If we change the PWM core not to disable it, then we have to change
> bindings?
If the pwm-fan.c driver doesn't disable the PWM controller, we don't need to add this property.
> How is this binding applicable on system (e.g. on *BSD) which does not
> disable PWM on reboot?
That's why we need this property?
> > from disabling the PWM when the system reboots.
> > In my point of view, the description can be:
> > Retain the state of the PWM on shutdown. Some platforms (e.g., BMC) will maintain
> > the PWM status after the system reboot. Add this property to prevent the PWM from being
> > disabled during the system reboot.
> You again describe what OS should do. First and last sentences are the same.
> Probably what you want to say is that fan is some critical component
> which should not be turned off or left unattended. Or that this hardware
> keeps last state of register on reset, so some boards might want to use
> it? If the first, then probably different property name. If the second,
> current seems fine, just choose some description describing actual hardware.
I think it will be the second one. Is it okay to change the description to the following?
Retain the state of the PWM on shutdown. Some platforms (e.g., BMC) require the PWM to maintain
its last register status on system reboot. Add this property to prevent the PWM from being disabled
during system reboot.
Thanks
Billy Tsai
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2024-11-05 8:16 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-26 8:05 [PATCH v2 0/2] hwmon: (pwm-fan) add option to leave fan on shutdown Akinobu Mita
2024-10-26 8:05 ` [PATCH v2 1/2] " Akinobu Mita
2024-10-29 2:34 ` Billy Tsai
2024-10-30 14:55 ` Akinobu Mita
2024-10-30 15:02 ` Guenter Roeck
2024-10-30 15:18 ` Akinobu Mita
2024-10-30 15:30 ` Guenter Roeck
2024-10-26 8:05 ` [PATCH v2 2/2] dt-bindings: hwmon: pwm-fan: add retain-state-shutdown property Akinobu Mita
2024-10-27 20:38 ` Krzysztof Kozlowski
2024-10-28 12:42 ` Akinobu Mita
2024-10-28 14:22 ` Krzysztof Kozlowski
2024-10-28 14:57 ` Akinobu Mita
2024-10-30 15:18 ` Krzysztof Kozlowski
2024-10-30 15:34 ` Akinobu Mita
2024-11-04 7:45 ` Billy Tsai
2024-11-04 11:47 ` Krzysztof Kozlowski
2024-11-05 8:16 ` Billy Tsai
2024-10-26 16:19 ` [PATCH v2 0/2] hwmon: (pwm-fan) add option to leave fan on shutdown Guenter Roeck
2024-10-27 5:31 ` Akinobu Mita
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox