* [PATCH 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown
@ 2021-09-23 2:34 Akinobu Mita
2021-09-23 2:34 ` [PATCH 2/2] dt-bindings: hwmon: (pwm-fan) add retain-state-shutdown property Akinobu Mita
2021-10-11 14:34 ` [PATCH 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown Guenter Roeck
0 siblings, 2 replies; 12+ messages in thread
From: Akinobu Mita @ 2021-09-23 2:34 UTC (permalink / raw)
To: linux-hwmon
Cc: Akinobu Mita, Rob Herring, Bartlomiej Zolnierkiewicz,
Guenter Roeck, 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: Rob Herring <robh+dt@kernel.org>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Billy Tsai <billy_tsai@aspeedtech.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
drivers/hwmon/pwm-fan.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
index 17518b4cab1b..1ea0d0562c28 100644
--- a/drivers/hwmon/pwm-fan.c
+++ b/drivers/hwmon/pwm-fan.c
@@ -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
--
2.25.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 2/2] dt-bindings: hwmon: (pwm-fan) add retain-state-shutdown property
2021-09-23 2:34 [PATCH 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown Akinobu Mita
@ 2021-09-23 2:34 ` Akinobu Mita
2024-10-25 8:28 ` Krzysztof Kozlowski
2021-10-11 14:34 ` [PATCH 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown Guenter Roeck
1 sibling, 1 reply; 12+ messages in thread
From: Akinobu Mita @ 2021-09-23 2:34 UTC (permalink / raw)
To: linux-hwmon
Cc: Akinobu Mita, Rob Herring, Bartlomiej Zolnierkiewicz,
Guenter Roeck, Billy Tsai
Document new retain-state-shutdown property.
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Billy Tsai <billy_tsai@aspeedtech.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
Documentation/devicetree/bindings/hwmon/pwm-fan.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/hwmon/pwm-fan.txt b/Documentation/devicetree/bindings/hwmon/pwm-fan.txt
index 4509e688623a..c1b2c3ff7ba8 100644
--- a/Documentation/devicetree/bindings/hwmon/pwm-fan.txt
+++ b/Documentation/devicetree/bindings/hwmon/pwm-fan.txt
@@ -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";
--
2.25.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 2/2] dt-bindings: hwmon: (pwm-fan) add retain-state-shutdown property
2021-09-23 2:34 ` [PATCH 2/2] dt-bindings: hwmon: (pwm-fan) add retain-state-shutdown property Akinobu Mita
@ 2024-10-25 8:28 ` Krzysztof Kozlowski
2024-10-25 8:31 ` Krzysztof Kozlowski
0 siblings, 1 reply; 12+ messages in thread
From: Krzysztof Kozlowski @ 2024-10-25 8:28 UTC (permalink / raw)
To: Akinobu Mita, linux-hwmon
Cc: Rob Herring, Bartlomiej Zolnierkiewicz, Guenter Roeck, Billy Tsai
On 23/09/2021 04:34, Akinobu Mita wrote:
> Document new retain-state-shutdown property.
>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Billy Tsai <billy_tsai@aspeedtech.com>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] dt-bindings: hwmon: (pwm-fan) add retain-state-shutdown property
2024-10-25 8:28 ` Krzysztof Kozlowski
@ 2024-10-25 8:31 ` Krzysztof Kozlowski
0 siblings, 0 replies; 12+ messages in thread
From: Krzysztof Kozlowski @ 2024-10-25 8:31 UTC (permalink / raw)
To: Akinobu Mita, linux-hwmon
Cc: Rob Herring, Bartlomiej Zolnierkiewicz, Guenter Roeck, Billy Tsai
On 25/10/2024 10:28, Krzysztof Kozlowski wrote:
> On 23/09/2021 04:34, Akinobu Mita wrote:
>> Document new retain-state-shutdown property.
>>
>> Cc: Rob Herring <robh+dt@kernel.org>
>> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
>> Cc: Guenter Roeck <linux@roeck-us.net>
>> Cc: Billy Tsai <billy_tsai@aspeedtech.com>
>> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
>
> 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown
2021-09-23 2:34 [PATCH 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown Akinobu Mita
2021-09-23 2:34 ` [PATCH 2/2] dt-bindings: hwmon: (pwm-fan) add retain-state-shutdown property Akinobu Mita
@ 2021-10-11 14:34 ` Guenter Roeck
2022-08-15 6:50 ` Billy Tsai
1 sibling, 1 reply; 12+ messages in thread
From: Guenter Roeck @ 2021-10-11 14:34 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-hwmon, Rob Herring, Bartlomiej Zolnierkiewicz, Billy Tsai
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 <robh+dt@kernel.org>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Billy Tsai <billy_tsai@aspeedtech.com>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
For my reference (waiting for DT property approval):
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Guenter
> ---
> drivers/hwmon/pwm-fan.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
> index 17518b4cab1b..1ea0d0562c28 100644
> --- a/drivers/hwmon/pwm-fan.c
> +++ b/drivers/hwmon/pwm-fan.c
> @@ -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
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown
2021-10-11 14:34 ` [PATCH 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown Guenter Roeck
@ 2022-08-15 6:50 ` Billy Tsai
2024-10-23 6:08 ` Billy Tsai
0 siblings, 1 reply; 12+ messages in thread
From: Billy Tsai @ 2022-08-15 6:50 UTC (permalink / raw)
To: Guenter Roeck, Akinobu Mita
Cc: linux-hwmon@vger.kernel.org, Rob Herring,
Bartlomiej Zolnierkiewicz
On 2021/10/11, 10:34 PM, "Guenter Roeck" <groeck7@gmail.com on behalf of linux@roeck-us.net> 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 <robh+dt@kernel.org>
> > Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> > Cc: Guenter Roeck <linux@roeck-us.net>
> > Cc: Billy Tsai <billy_tsai@aspeedtech.com>
> > Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> For my reference (waiting for DT property approval):
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> Guenter
Reviewed-by: Billy Tsai <billy_tsai@aspeedtech.com>
Billy
> > ---
> > drivers/hwmon/pwm-fan.c | 9 ++++++++-
> > 1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
> > index 17518b4cab1b..1ea0d0562c28 100644
> > --- a/drivers/hwmon/pwm-fan.c
> > +++ b/drivers/hwmon/pwm-fan.c
> > @@ -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
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown
2022-08-15 6:50 ` Billy Tsai
@ 2024-10-23 6:08 ` Billy Tsai
2024-10-23 15:24 ` Rob Herring
2024-10-26 8:08 ` Akinobu Mita
0 siblings, 2 replies; 12+ messages in thread
From: Billy Tsai @ 2024-10-23 6:08 UTC (permalink / raw)
To: Guenter Roeck, Akinobu Mita
Cc: linux-hwmon@vger.kernel.org, Rob Herring,
Bartlomiej Zolnierkiewicz
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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown
2024-10-23 6:08 ` Billy Tsai
@ 2024-10-23 15:24 ` Rob Herring
2024-10-23 15:50 ` Guenter Roeck
2024-10-26 8:08 ` Akinobu Mita
1 sibling, 1 reply; 12+ messages in thread
From: Rob Herring @ 2024-10-23 15:24 UTC (permalink / raw)
To: Billy Tsai
Cc: Guenter Roeck, Akinobu Mita, linux-hwmon@vger.kernel.org,
Bartlomiej Zolnierkiewicz
On Wed, Oct 23, 2024 at 1:08 AM Billy Tsai <billy_tsai@aspeedtech.com> wrote:
>
> Hi All,
>
> I found that these patches have been rejected.
Where did that happen?
> 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown
2024-10-23 15:24 ` Rob Herring
@ 2024-10-23 15:50 ` Guenter Roeck
0 siblings, 0 replies; 12+ messages in thread
From: Guenter Roeck @ 2024-10-23 15:50 UTC (permalink / raw)
To: Rob Herring, Billy Tsai
Cc: Akinobu Mita, linux-hwmon@vger.kernel.org,
Bartlomiej Zolnierkiewicz
On 10/23/24 08:24, Rob Herring wrote:
> On Wed, Oct 23, 2024 at 1:08 AM Billy Tsai <billy_tsai@aspeedtech.com> wrote:
>>
>> Hi All,
>>
>> I found that these patches have been rejected.
>
> Where did that happen?
>
https://patchwork.kernel.org/project/linux-hwmon/patch/20210923023448.4190-1-akinobu.mita@gmail.com/
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
>> 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown
2024-10-23 6:08 ` Billy Tsai
2024-10-23 15:24 ` Rob Herring
@ 2024-10-26 8:08 ` Akinobu Mita
2024-10-26 16:20 ` Guenter Roeck
2024-10-29 2:22 ` Billy Tsai
1 sibling, 2 replies; 12+ messages in thread
From: Akinobu Mita @ 2024-10-26 8:08 UTC (permalink / raw)
To: Billy Tsai
Cc: Guenter Roeck, linux-hwmon@vger.kernel.org, Rob Herring,
Bartlomiej Zolnierkiewicz
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?
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown
2024-10-26 8:08 ` Akinobu Mita
@ 2024-10-26 16:20 ` Guenter Roeck
2024-10-29 2:22 ` Billy Tsai
1 sibling, 0 replies; 12+ messages in thread
From: Guenter Roeck @ 2024-10-26 16:20 UTC (permalink / raw)
To: Akinobu Mita, Billy Tsai
Cc: linux-hwmon@vger.kernel.org, Rob Herring,
Bartlomiej Zolnierkiewicz
On 10/26/24 01:08, Akinobu Mita wrote:
> 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown
2024-10-26 8:08 ` Akinobu Mita
2024-10-26 16:20 ` Guenter Roeck
@ 2024-10-29 2:22 ` Billy Tsai
1 sibling, 0 replies; 12+ messages in thread
From: Billy Tsai @ 2024-10-29 2:22 UTC (permalink / raw)
To: Akinobu Mita
Cc: Guenter Roeck, linux-hwmon@vger.kernel.org, Rob Herring,
Bartlomiej Zolnierkiewicz
> 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
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2024-10-29 2:22 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-23 2:34 [PATCH 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown Akinobu Mita
2021-09-23 2:34 ` [PATCH 2/2] dt-bindings: hwmon: (pwm-fan) add retain-state-shutdown property Akinobu Mita
2024-10-25 8:28 ` Krzysztof Kozlowski
2024-10-25 8:31 ` Krzysztof Kozlowski
2021-10-11 14:34 ` [PATCH 1/2] hwmon: (pwm-fan) add option to leave fan on shutdown Guenter Roeck
2022-08-15 6:50 ` Billy Tsai
2024-10-23 6:08 ` Billy Tsai
2024-10-23 15:24 ` Rob Herring
2024-10-23 15:50 ` Guenter Roeck
2024-10-26 8:08 ` Akinobu Mita
2024-10-26 16:20 ` Guenter Roeck
2024-10-29 2:22 ` Billy Tsai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox