mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: "Davíð Steinn Geirsson" <david@dsg.is>
Cc: "Jean Delvare" <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, "Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	devicetree@vger.kernel.org,
	"Uwe Kleine-König" <ukleinek@kernel.org>,
	linux-pwm@vger.kernel.org, "Jonathan Corbet" <corbet@lwn.net>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] hwmon: (adt7475) Convert to hwmon_device_register_with_info()
Date: Sun, 15 Nov 2026 16:41:47 -0800	[thread overview]
Message-ID: <68615d41-eedf-4178-ac0f-8d9599f24e12@roeck-us.net> (raw)
In-Reply-To: <avo1IWkXBQ2fHgKx@dsg.is>

On 11/15/26 14:41, Davíð Steinn Geirsson wrote:
...
> Apologies if that's how it came off, that was not the intent. I
> understand your earlier guidance that new drivers need to use the hwmon
> subsystem lock for this kind of thing. The reason I mentioned those
> other drivers was to try to explain why I believe this is a novel issue
> other hwmon drivers have not hit before.
> 

The pwm maintainer (Wolfgang) insists that all chips with pwm output,
including fan controllers like this one, register with the pwm subsystem
as pwm controllers. I resisted that for a long time because I find that
it adds pointless complexity, but that time is gone. People now find
reasons, such as claiming that they want to connect LEDs instead of fans,
to those pwm outputs. This results in recursive calls into the hwmon
subsystem, for example if such a pwm output is indeed connected to a fan
and the pwm-fan driver is used to control it. Yes, this is novel. I never
imagined that this would ever be the case. That happens when new and
more complex use cases are introduced into a system.

...

> 
>>
>> Anyway, you want to add the complexity of getting the pwm subsystem and
>> the pwm-fan driver involved, even though this could as well be handled
>> in the adt7475 driver, so you'll have to suffer the consequences.
> 
> I have no attachment to this implementation, in truth I just expected an
> adt7475 driver registering cooling devices itself would be rejected. If

It appears that you had no problems finding examples for drivers not (or rather
not yet) using the hardware monitoring subsystem lock. Yet, it seems that you
had trouble finding hardware monitoring drivers which also register cooling
devices (besides pwm-fan). Here are some for reference.

$ git grep devm_thermal_of_child_cooling_device_register
amc6821.c:              return PTR_ERR_OR_ZERO(devm_thermal_of_child_cooling_device_register(dev,
aspeed-pwm-tacho.c:     cdev->tcdev = devm_thermal_of_child_cooling_device_register(dev, child,
emc2305.c:              devm_thermal_of_child_cooling_device_register(dev, fan_node,
gpio-fan.c:     fan_data->cdev = devm_thermal_of_child_cooling_device_register(dev, np,
max6650.c:              cooling_dev = devm_thermal_of_child_cooling_device_register(dev, dev->of_node,
npcm750-pwm-fan.c:      cdev->tcdev = devm_thermal_of_child_cooling_device_register(dev, child,
pwm-fan.c:              cdev = devm_thermal_of_child_cooling_device_register(dev, dev->of_node,
qnap-mcu-hwmon.c:               cdev = devm_thermal_of_child_cooling_device_register(dev, to_of_node(hwm->fan_node),
tc654.c:                cdev = devm_thermal_of_child_cooling_device_register(dev, dev->of_node,

Of those, amc6821, emc2305 and max6650, are quite similar to adt7475.

Anyway, I instructed my AI agent to look into the problem and fix it,
so I'll send a patch to fix the problem shortly.

Thanks,
Guenter


  reply	other threads:[~2026-11-16  0:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14  0:41 [PATCH 0/4] hwmon: (adt7475) Add thermal sensor and PWM provider support Davíð Steinn Geirsson
2026-11-14  0:41 ` [PATCH 1/4] dt-bindings: hwmon: adt7475: Add #thermal-sensor-cells Davíð Steinn Geirsson
2026-11-14  0:41 ` [PATCH 2/4] hwmon: (adt7475) Convert to hwmon_device_register_with_info() Davíð Steinn Geirsson
2026-11-14  6:07   ` Guenter Roeck
2026-11-15 14:16     ` Davíð Steinn Geirsson
2026-11-15 21:40       ` Guenter Roeck
2026-11-15 22:41         ` Davíð Steinn Geirsson
2026-11-16  0:41           ` Guenter Roeck [this message]
2026-11-14  0:41 ` [PATCH 3/4] hwmon: (adt7475) Add thermal zone sensor support Davíð Steinn Geirsson
2026-11-14  0:41 ` [PATCH 4/4] hwmon: (adt7475) Expose fan control via PWM framework Davíð Steinn Geirsson
2026-11-14  6:10   ` Guenter Roeck
2026-11-14  1:03 ` [PATCH 0/4] hwmon: (adt7475) Add thermal sensor and PWM provider support Guenter Roeck
2026-11-14 10:23   ` Davíð Steinn Geirsson
2026-11-14 15:57     ` Guenter Roeck

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=68615d41-eedf-4178-ac0f-8d9599f24e12@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=david@dsg.is \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=robh@kernel.org \
    --cc=skhan@linuxfoundation.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

all inboxes | Powered by JetHome®