* [RFC] hwmon: (tps23861) PSE-PD support, extend hwmon driver or move to pse-pd?
@ 2026-11-01 18:02 Roman Kuzmitskii
2026-11-01 18:38 ` Guenter Roeck
0 siblings, 1 reply; 7+ messages in thread
From: Roman Kuzmitskii @ 2026-11-01 18:02 UTC (permalink / raw)
To: linux-hwmon, netdev
Cc: robert.marko, luka.perkov, linux, o.rempel, kory.maincent
hi,
TP-Link TL-SG2210P v3 (realtek rtl838x, openwrt) has two tps23861 for PoE.
driver is hwmon only. ports can be enabled via in*_enable sysfs, rest is
only reachable by poking i2c directly.
i would like to control them through PSE-PD instead (ethtool --set-pse).
i made patch for openwrt which registers pse_controller_dev from hwmon
driver when node has pse-pis.
it does c33 admin state, power status, enable/disable, voltage and power
class.
events are polled.
only ports with pse-pi node go to auto mode, and in*_enable is hidden
while PSE is registered.
https://github.com/openwrt/openwrt/pull/26330 (tested on openwrt 6.18
kernel)
openwrt reviewers asked me to check with you first which way you prefer:
1. extend hwmon driver with PSE-PD (like it is done right now)
2. move driver to drivers/net/pse-pd and extend it with PSE-PD
3. something else
thanks,
Roman
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC] hwmon: (tps23861) PSE-PD support, extend hwmon driver or move to pse-pd?
2026-11-01 18:02 [RFC] hwmon: (tps23861) PSE-PD support, extend hwmon driver or move to pse-pd? Roman Kuzmitskii
@ 2026-11-01 18:38 ` Guenter Roeck
2026-11-01 18:50 ` Roman Kuzmitskii
2026-11-01 20:57 ` Robert Marko
0 siblings, 2 replies; 7+ messages in thread
From: Guenter Roeck @ 2026-11-01 18:38 UTC (permalink / raw)
To: Roman Kuzmitskii, linux-hwmon, netdev
Cc: robert.marko, luka.perkov, o.rempel, kory.maincent
On 11/1/26 10:02, Roman Kuzmitskii wrote:
> hi,
>
> TP-Link TL-SG2210P v3 (realtek rtl838x, openwrt) has two tps23861 for PoE.
> driver is hwmon only. ports can be enabled via in*_enable sysfs, rest is only reachable by poking i2c directly.
> i would like to control them through PSE-PD instead (ethtool --set-pse).
>
> i made patch for openwrt which registers pse_controller_dev from hwmon driver when node has pse-pis.
> it does c33 admin state, power status, enable/disable, voltage and power class.
> events are polled.
> only ports with pse-pi node go to auto mode, and in*_enable is hidden while PSE is registered.
> https://github.com/openwrt/openwrt/pull/26330 (tested on openwrt 6.18 kernel)
>
> openwrt reviewers asked me to check with you first which way you prefer:
> 1. extend hwmon driver with PSE-PD (like it is done right now)
> 2. move driver to drivers/net/pse-pd and extend it with PSE-PD
> 3. something else
>
The hardware monitoring "enable" attribute is supposed to enable monitoring,
not to enable some power delivery or network (or any other) port. That "port
enable" feature using the hwmon ABI was sneaked in, and I am inclined to just
remove the upstream driver for severe ABI violation.
Guenter
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC] hwmon: (tps23861) PSE-PD support, extend hwmon driver or move to pse-pd?
2026-11-01 18:38 ` Guenter Roeck
@ 2026-11-01 18:50 ` Roman Kuzmitskii
2026-11-01 19:09 ` Guenter Roeck
2026-11-01 20:57 ` Robert Marko
1 sibling, 1 reply; 7+ messages in thread
From: Roman Kuzmitskii @ 2026-11-01 18:50 UTC (permalink / raw)
To: Guenter Roeck, linux-hwmon, netdev
Cc: robert.marko, luka.perkov, o.rempel, kory.maincent
On 11/2/26 1:38 AM, Guenter Roeck wrote:
> On 11/1/26 10:02, Roman Kuzmitskii wrote:
>> openwrt reviewers asked me to check with you first which way you prefer:
>> 1. extend hwmon driver with PSE-PD (like it is done right now)
>> 2. move driver to drivers/net/pse-pd and extend it with PSE-PD
>> 3. something else
>>
> The hardware monitoring "enable" attribute is supposed to enable monitoring,
> not to enable some power delivery or network (or any other) port. That "port
> enable" feature using the hwmon ABI was sneaked in, and I am inclined to just
> remove the upstream driver for severe ABI violation.
>
> Guenter
thanks, does second option look okay with taking tps23861 to drivers/net/pse-pd
with enable attribute going away?
Roman
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC] hwmon: (tps23861) PSE-PD support, extend hwmon driver or move to pse-pd?
2026-11-01 18:50 ` Roman Kuzmitskii
@ 2026-11-01 19:09 ` Guenter Roeck
2026-11-01 19:57 ` Andrew Lunn
0 siblings, 1 reply; 7+ messages in thread
From: Guenter Roeck @ 2026-11-01 19:09 UTC (permalink / raw)
To: Roman Kuzmitskii, linux-hwmon, netdev
Cc: robert.marko, luka.perkov, o.rempel, kory.maincent
On 11/1/26 10:50, Roman Kuzmitskii wrote:
> On 11/2/26 1:38 AM, Guenter Roeck wrote:
>> On 11/1/26 10:02, Roman Kuzmitskii wrote:
>>> openwrt reviewers asked me to check with you first which way you prefer:
>>> 1. extend hwmon driver with PSE-PD (like it is done right now)
>>> 2. move driver to drivers/net/pse-pd and extend it with PSE-PD
>>> 3. something else
>>>
>> The hardware monitoring "enable" attribute is supposed to enable monitoring,
>> not to enable some power delivery or network (or any other) port. That "port
>> enable" feature using the hwmon ABI was sneaked in, and I am inclined to just
>> remove the upstream driver for severe ABI violation.
>>
>> Guenter
>
> thanks, does second option look okay with taking tps23861 to drivers/net/pse-pd
> with enable attribute going away?
>
A perfect solution would be to move the driver to drivers/net/pse-pd (or elsewhere)
and implement the hwmon part as auxiliary driver, but I am also ok with moving it all.
Note that I do not review hwmon drivers outside drivers/hwmon, so if you move the
driver to drivers/net/pse-pd you can abuse the hwmon ABI as much as you want.
Guenter
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC] hwmon: (tps23861) PSE-PD support, extend hwmon driver or move to pse-pd?
2026-11-01 19:09 ` Guenter Roeck
@ 2026-11-01 19:57 ` Andrew Lunn
2026-11-02 9:49 ` Kory Maincent
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2026-11-01 19:57 UTC (permalink / raw)
To: Guenter Roeck
Cc: Roman Kuzmitskii, linux-hwmon, netdev, robert.marko, luka.perkov,
o.rempel, kory.maincent
On Sun, Nov 01, 2026 at 11:09:42AM -0800, Guenter Roeck wrote:
> On 11/1/26 10:50, Roman Kuzmitskii wrote:
> > On 11/2/26 1:38 AM, Guenter Roeck wrote:
> > > On 11/1/26 10:02, Roman Kuzmitskii wrote:
> > > > openwrt reviewers asked me to check with you first which way you prefer:
> > > > 1. extend hwmon driver with PSE-PD (like it is done right now)
> > > > 2. move driver to drivers/net/pse-pd and extend it with PSE-PD
> > > > 3. something else
> > > >
> > > The hardware monitoring "enable" attribute is supposed to enable monitoring,
> > > not to enable some power delivery or network (or any other) port. That "port
> > > enable" feature using the hwmon ABI was sneaked in, and I am inclined to just
> > > remove the upstream driver for severe ABI violation.
> > >
> > > Guenter
> >
> > thanks, does second option look okay with taking tps23861 to drivers/net/pse-pd
> > with enable attribute going away?
> >
> A perfect solution would be to move the driver to drivers/net/pse-pd (or elsewhere)
> and implement the hwmon part as auxiliary driver, but I am also ok with moving it all.
> Note that I do not review hwmon drivers outside drivers/hwmon, so if you move the
> driver to drivers/net/pse-pd you can abuse the hwmon ABI as much as you want.
Although some network maintainers do have a basic understanding of
hwmon, and might push back on such abuse.
Does the tps23861 share anything with the tps23881? It already has a
pse-pd driver.
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC] hwmon: (tps23861) PSE-PD support, extend hwmon driver or move to pse-pd?
2026-11-01 18:38 ` Guenter Roeck
2026-11-01 18:50 ` Roman Kuzmitskii
@ 2026-11-01 20:57 ` Robert Marko
1 sibling, 0 replies; 7+ messages in thread
From: Robert Marko @ 2026-11-01 20:57 UTC (permalink / raw)
To: Guenter Roeck
Cc: Roman Kuzmitskii, linux-hwmon, netdev, o.rempel, kory.maincent
On Sun, Nov 1, 2026 at 7:38 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On 11/1/26 10:02, Roman Kuzmitskii wrote:
> > hi,
> >
> > TP-Link TL-SG2210P v3 (realtek rtl838x, openwrt) has two tps23861 for PoE.
> > driver is hwmon only. ports can be enabled via in*_enable sysfs, rest is only reachable by poking i2c directly.
> > i would like to control them through PSE-PD instead (ethtool --set-pse).
> >
> > i made patch for openwrt which registers pse_controller_dev from hwmon driver when node has pse-pis.
> > it does c33 admin state, power status, enable/disable, voltage and power class.
> > events are polled.
> > only ports with pse-pi node go to auto mode, and in*_enable is hidden while PSE is registered.
> > https://github.com/openwrt/openwrt/pull/26330 (tested on openwrt 6.18 kernel)
> >
> > openwrt reviewers asked me to check with you first which way you prefer:
> > 1. extend hwmon driver with PSE-PD (like it is done right now)
> > 2. move driver to drivers/net/pse-pd and extend it with PSE-PD
> > 3. something else
> >
> The hardware monitoring "enable" attribute is supposed to enable monitoring,
> not to enable some power delivery or network (or any other) port. That "port
> enable" feature using the hwmon ABI was sneaked in, and I am inclined to just
> remove the upstream driver for severe ABI violation.
Hi Guenther, I am the original driver author for tps23861.
Sorry for the ABI violation, that wasn't really clear back when it was
being written, especially with no PSE subsystem at all.
We can always just remove the enable attribute, the IC works in auto
mode by default anyway, instead of dropping the driver
as it is still useful for monitoring.
That being said, ideally it would just be moved to the PSE subsystem.
Regards,
Robert
>
> Guenter
>
--
Robert Marko
Staff Embedded Linux Engineer
Sartura d.d.
Lendavska ulica 16a
10000 Zagreb, Croatia
Email: robert.marko@sartura.hr
Web: www.sartura.hr
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC] hwmon: (tps23861) PSE-PD support, extend hwmon driver or move to pse-pd?
2026-11-01 19:57 ` Andrew Lunn
@ 2026-11-02 9:49 ` Kory Maincent
0 siblings, 0 replies; 7+ messages in thread
From: Kory Maincent @ 2026-11-02 9:49 UTC (permalink / raw)
To: Andrew Lunn, Guenter Roeck
Cc: Roman Kuzmitskii, linux-hwmon, netdev, robert.marko, luka.perkov,
o.rempel
On 11/1/26 20:57, Andrew Lunn wrote:
> On Sun, Nov 01, 2026 at 11:09:42AM -0800, Guenter Roeck wrote:
>> On 11/1/26 10:50, Roman Kuzmitskii wrote:
>>> On 11/2/26 1:38 AM, Guenter Roeck wrote:
>>>> On 11/1/26 10:02, Roman Kuzmitskii wrote:
>>>>> openwrt reviewers asked me to check with you first which way you prefer:
>>>>> 1. extend hwmon driver with PSE-PD (like it is done right now)
>>>>> 2. move driver to drivers/net/pse-pd and extend it with PSE-PD
>>>>> 3. something else
I am currently working on this topic by extending the tps23881 driver.
Please don't do it yourself to avoid working in parallel on the same
topic. On the other hand, it would be nice if you can test it.
Roman I will add you in CC of my series.
>>>>>
>>>> The hardware monitoring "enable" attribute is supposed to enable monitoring,
>>>> not to enable some power delivery or network (or any other) port. That "port
>>>> enable" feature using the hwmon ABI was sneaked in, and I am inclined to just
>>>> remove the upstream driver for severe ABI violation.
Do you think it would be possible to remove the current tps23861 driver
and binding? This would break the backward compatibility.
I am currently using "tps23861-poe" compatible name binding.
Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-11-02 9:49 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-01 18:02 [RFC] hwmon: (tps23861) PSE-PD support, extend hwmon driver or move to pse-pd? Roman Kuzmitskii
2026-11-01 18:38 ` Guenter Roeck
2026-11-01 18:50 ` Roman Kuzmitskii
2026-11-01 19:09 ` Guenter Roeck
2026-11-01 19:57 ` Andrew Lunn
2026-11-02 9:49 ` Kory Maincent
2026-11-01 20:57 ` Robert Marko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox