hwmon: (pwm-fan) add option to leave fan on shutdown
Subsystems (2)
PATCH 1/2 hwmon: (pwm-fan) add option to leave fan on shutdown
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."
--- drivers/hwmon/pwm-fan.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/hwmon/pwm-fan.c +8 -1
@@ -38,6 +38,7 @@ struct pwm_fan_ctx {struct pwm_fan_tach *tachs;ktime_t sample_start;struct timer_list rpm_timer; +bool retain_state_shutdown;unsigned int pwm_value;unsigned int pwm_fan_state;
@@ -312,6 +313,9 @@ static int pwm_fan_probe(struct platform_device *pdev)mutex_init (&ctx->lock); + ctx->retain_state_shutdown = +of_property_read_bool (dev->of_node,"retain-state-shutdown" ); + ctx->pwm =devm_of_pwm_get (dev, dev->of_node,NULL );if (IS_ERR (ctx->pwm))return dev_err_probe (dev,PTR_ERR (ctx->pwm),"Could not get PWM\n" );
@@ -492,7 +496,10 @@ static int pwm_fan_disable(struct device *dev)static void pwm_fan_shutdown (struct platform_device *pdev) { -pwm_fan_disable (&pdev->dev); +struct pwm_fan_ctx *ctx =platform_get_drvdata (pdev); + +if (!ctx->retain_state_shutdown) +pwm_fan_disable (&pdev->dev); }#ifdef CONFIG_PM_SLEEP
Signature · 1 line
2.25.1
PATCH 2/2 dt-bindings: hwmon: (pwm-fan) add retain-state-shutdown property
Document new retain-state-shutdown property.
--- Documentation/devicetree/bindings/hwmon/pwm-fan.txt | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/hwmon/pwm-fan.txt +2 -0
@@ -19,6 +19,8 @@ Optional properties: interrupts per revolution). The value must be greater than zero. +- retain-state-shutdown: Retain the state of the PWM on shutdown. + Example: fan0: pwm-fan { compatible = "pwm-fan";
Signature · 1 line
2.25.1
Re: [PATCH 2/2] dt-bindings: hwmon: (pwm-fan) add retain-state-shutdown property
Quoted 7 lines · Akinobu Mita
Document new retain-state-shutdown property.
Cc Rob Herring <[email protected]>Cc Bartlomiej Zolnierkiewicz <[email protected]>Cc Guenter Roeck <[email protected]>Cc Billy Tsai <[email protected]>Signed-off-by Akinobu Mita <[email protected]>
You develop on some very old kernel, please don't and rather use mainline.
<form letter>
Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.
Tools like b4 or scripts/get_maintainer.pl provide you proper list of people, so fix your workflow. Tools might also fail if you work on some ancient tree (don't, instead use mainline) or work on fork of kernel (don't, instead use mainline). Just use b4 and everything should be fine, although remember about b4 prep --auto-to-cc if you added new patches to the patchset.
You missed at least devicetree list (maybe more), so this won't be tested by automated tooling. Performing review on untested code might be a waste of time.
Please kindly resend and include all necessary To/Cc entries. </form letter>
Best regards,
Krzysztof
Re: [PATCH 2/2] dt-bindings: hwmon: (pwm-fan) add retain-state-shutdown property
Quoted 10 lines · Krzysztof Kozlowski
Quoted 7 lines · Akinobu Mita
Document new retain-state-shutdown property.
Cc Rob Herring <[email protected]>Cc Bartlomiej Zolnierkiewicz <[email protected]>Cc Guenter Roeck <[email protected]>Cc Billy Tsai <[email protected]>Signed-off-by Akinobu Mita <[email protected]>You develop on some very old kernel, please don't and rather use mainline.
And I need to start checking dates of messages which lei brings to me.
Sorry for the noise, although missing cc to DT is still valid argument.
Best regards,
Krzysztof
Quoted 9 lines · Akinobu Mita
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."
Quoted 5 lines
Cc Rob Herring <[email protected]>Cc Bartlomiej Zolnierkiewicz <[email protected]>Cc Guenter Roeck <[email protected]>Cc Billy Tsai <[email protected]>Signed-off-by Akinobu Mita <[email protected]>
For my reference (waiting for DT property approval):
Guenter
Quoted 38 lines
--- drivers/hwmon/pwm-fan.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)drivers/hwmon/pwm-fan.c +8
-1@@ -38,6 +38,7 @@ struct pwm_fan_ctx {struct pwm_fan_tach *tachs;ktime_t sample_start;struct timer_list rpm_timer; +bool retain_state_shutdown;unsigned int pwm_value;unsigned int pwm_fan_state;@@ -312,6 +313,9 @@ static int pwm_fan_probe(struct platform_device *pdev)mutex_init (&ctx->lock); + ctx->retain_state_shutdown = +of_property_read_bool (dev->of_node,"retain-state-shutdown" ); + ctx->pwm =devm_of_pwm_get (dev, dev->of_node,NULL );if (IS_ERR (ctx->pwm))return dev_err_probe (dev,PTR_ERR (ctx->pwm),"Could not get PWM\n" );@@ -492,7 +496,10 @@ static int pwm_fan_disable(struct device *dev)static void pwm_fan_shutdown (struct platform_device *pdev) { -pwm_fan_disable (&pdev->dev); +struct pwm_fan_ctx *ctx =platform_get_drvdata (pdev); + +if (!ctx->retain_state_shutdown) +pwm_fan_disable (&pdev->dev); }#ifdef CONFIG_PM_SLEEP
Billy Tsai
Reviewed-byOn 2021/10/11, 10:34 PM, "Guenter Roeck" <[email protected] on behalf of [email protected]> wrote:
On Thu, Sep 23, 2021 at 11:34:47AM +0900, Akinobu Mita wrote:
> > 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: Rob Herring <[email protected]>
> > Cc: Bartlomiej Zolnierkiewicz <[email protected]>
> > Cc: Guenter Roeck <[email protected]>
> > Cc: Billy Tsai <[email protected]>
> > Signed-off-by: Akinobu Mita <[email protected]>
> For my reference (waiting for DT property approval):
> Reviewed-by: Guenter Roeck <[email protected]>
> Guenter
Billy
Quoted 38 lines
Quoted 38 lines
--- drivers/hwmon/pwm-fan.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)drivers/hwmon/pwm-fan.c +8
-1@@ -38,6 +38,7 @@ struct pwm_fan_ctx {struct pwm_fan_tach *tachs;ktime_t sample_start;struct timer_list rpm_timer; +bool retain_state_shutdown;unsigned int pwm_value;unsigned int pwm_fan_state;@@ -312,6 +313,9 @@ static int pwm_fan_probe(struct platform_device *pdev)mutex_init (&ctx->lock); + ctx->retain_state_shutdown = +of_property_read_bool (dev->of_node,"retain-state-shutdown" ); + ctx->pwm =devm_of_pwm_get (dev, dev->of_node,NULL );if (IS_ERR (ctx->pwm))return dev_err_probe (dev,PTR_ERR (ctx->pwm),"Could not get PWM\n" );@@ -492,7 +496,10 @@ static int pwm_fan_disable(struct device *dev)static void pwm_fan_shutdown (struct platform_device *pdev) { -pwm_fan_disable (&pdev->dev); +struct pwm_fan_ctx *ctx =platform_get_drvdata (pdev); + +if (!ctx->retain_state_shutdown) +pwm_fan_disable (&pdev->dev); }#ifdef CONFIG_PM_SLEEP
Hi All,
I found that these patches have been rejected.
Is there any other reason why it can't be merged into the mainline?
Thanks
Quoted 4 lines · Billy Tsai
Hi All,
I found that these patches have been rejected.
Where did that happen?
Quoted 1 line
Is there any other reason why it can't be merged into the mainline?
I don't see any replies on the binding. Perhaps that's because it wasn't sent to the DT list and it doesn't get reviewed if not. In any case, lots has changed in 3 years such as we have a fan binding now.
Rob
Guenter Roeck
maintainerQuoted 8 lines · Rob Herring
Quoted 4 lines · Billy Tsai
Hi All,
I found that these patches have been rejected.
Where did that happen?
https://patchwork.kernel.org/project/linux-hwmon/patch/[email protected]/
It has been a long time, but from the available history I guess I marked it as rejected because the DT patch was never approved. That is just a guess, though; I really don't remember.
Guenter
Quoted 7 lines
Quoted 1 line
Is there any other reason why it can't be merged into the mainline?
I don't see any replies on the binding. Perhaps that's because it wasn't sent to the DT list and it doesn't get reviewed if not. In any case, lots has changed in 3 years such as we have a fan binding now.
Rob
Hi Billy,
I have updated and resubmitted these patches. I don't have the hardware to test at the moment, so is it possible for you to test it?
Guenter Roeck
maintainerQuoted 4 lines · Akinobu Mita
Hi Billy,
I have updated and resubmitted these patches. I don't have the hardware to test at the moment, so is it possible for you to test it?
You did not provide a change log. I do not review patch resubmissions without change log.
Guenter
Quoted 2 lines
I have updated and resubmitted these patches. I don't have the hardware to test at the moment, so is it possible for you to test it?
Okay, I will try the v2 patch and add the Tested-by.
Thanks