From: Marek Vasut <marek.vasut@mailbox.org>
To: "Uwe Kleine-König" <ukleinek@kernel.org>
Cc: linux-pwm@vger.kernel.org, Conor Dooley <conor+dt@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Rob Herring <robh@kernel.org>,
devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v4 3/3] pwm: argon-fan-hat: Add Argon40 Fan HAT support
Date: Mon, 23 Jun 2025 22:44:28 +0200 [thread overview]
Message-ID: <033bbb7d-ab00-467e-ab21-877f76d027a2@mailbox.org> (raw)
In-Reply-To: <apbocxuzcptlpghphh7nchnwyxpfhmiwosgxrt4y5awsb67ar3@fbskfbulwsma>
On 6/23/25 9:53 PM, Uwe Kleine-König wrote:
> Hello Marek,
Hello Uwe,
> On Mon, Jun 23, 2025 at 07:30:33PM +0200, Marek Vasut wrote:
>> On 6/23/25 11:11 AM, Uwe Kleine-König wrote:
>>> when I replied to v3 this v4 was already on the list which I missed. My
>>> concern applies here, too, though.
>>>
>>> On Sat, Jun 21, 2025 at 07:19:56PM +0200, Marek Vasut wrote:
>>>> +static void argon_fan_hat_i2c_shutdown(struct i2c_client *i2c)
>>>> +{
>>>> + argon_fan_hat_write(i2c, 100);
>>>> +}
>>>
>>> If you drop this, I'm willing to apply.
>>
>> Dropping this would make the hardware which uses this device more
>> susceptible to thermal damage, e.g. in case it gets stuck during reboot and
>> does not boot Linux afterward. I don't want to risk such thermal damage.
>
> We agree here. But the right place to address this is the pwm-fan
> driver. A PWM is supposed to do exactly and only what its consumer wants
> it to do (in the limits set by hardware). Officially a PWM driver
> doesn't know the polarity of a fan, so `argon_fan_hat_write(i2c, 100)`
> might fully enable or complete disable the fan. The fan-driver knows the
> polarity. The PWM driver doesn't even know that it controls a fan. And
> the next guy takes the argon device and controls a motor with it --- and
> wonders that the vehicle gives full-speed at shutdown.
I suspect this cannot happen without non-standard hardware change of
this device, see the link which shows what this device is, it is an
integrated PWM+fan device:
Argon Fan HAT https://argon40.com/products/argon-fan-hat
> So I hope we also agree that the pwm-fan driver (or an even more generic
> place if possible that applies to all fan drivers) is the right layer to
> fix this. And note that the pwm-fan driver already has such a decision
> implemented, it's just the wrong one from your POV as it disables the
> fan at shutdown. For me this is another confirmation that having a
> shutdown callback in the PWM driver is wrong. The two affected drivers
> shouldn't fight about what is the right policy.
I would fully agree with this argument for a generic PWM controller, but
this isn't one, this is a combined PWM+fan device.
The PWM driver is the last one that is being shut down, it is being shut
down after the pwm-fan driver. If the pwm-fan driver fails for whatever
reason, the PWM driver -- in this case driver for a combined PWM+fan
device -- should make sure that the hardware does not melt. So I would
argue that, for this specific device, the shutdown hook here is correct.
I would propose to keep the shutdown hook here, and extend the pwm-fan
driver to be aligned with the behavior of the shutdown hook here. Does
that work for you ?
next prev parent reply other threads:[~2025-06-23 20:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-21 17:19 [PATCH v4 1/3] dt-bindings: vendor-prefixes: Document Argon40 Marek Vasut
2025-06-21 17:19 ` [PATCH v4 2/3] dt-bindings: pwm: argon40,fan-hat: Document Argon40 Fan HAT Marek Vasut
2025-06-27 20:02 ` Rob Herring (Arm)
2025-06-21 17:19 ` [PATCH v4 3/3] pwm: argon-fan-hat: Add Argon40 Fan HAT support Marek Vasut
2025-06-23 9:11 ` Uwe Kleine-König
2025-06-23 17:30 ` Marek Vasut
2025-06-23 19:53 ` Uwe Kleine-König
2025-06-23 20:44 ` Marek Vasut [this message]
2025-06-24 6:50 ` Geert Uytterhoeven
2025-06-25 7:19 ` Uwe Kleine-König
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=033bbb7d-ab00-467e-ab21-877f76d027a2@mailbox.org \
--to=marek.vasut@mailbox.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=robh@kernel.org \
--cc=ukleinek@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).