Thread View: linux.kernel.netdev
8 messages
8 total messages
Started by Roman Kuzmitskii
Sun, 01 Nov 2026 18:02
[RFC] hwmon: (tps23861) PSE-PD support, extend hwmon driver or move to pse-pd?
Author: Roman Kuzmitskii
Date: Sun, 01 Nov 2026 18:02
Date: Sun, 01 Nov 2026 18:02
25 lines
12200 bytes
12200 bytes
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
Re: [RFC] hwmon: (tps23861) PSE-PD support, extend hwmon driver or move to pse-pd?
Author: Guenter Roeck
Date: Sun, 01 Nov 2026 18:38
Date: Sun, 01 Nov 2026 18:38
25 lines
15296 bytes
15296 bytes
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
Re: [RFC] hwmon: (tps23861) PSE-PD support, extend hwmon driver or move to pse-pd?
Author: Roman Kuzmitskii
Date: Sun, 01 Nov 2026 18:50
Date: Sun, 01 Nov 2026 18:50
19 lines
12211 bytes
12211 bytes
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
Re: [RFC] hwmon: (tps23861) PSE-PD support, extend hwmon driver or move to pse-pd?
Author: Guenter Roeck
Date: Sun, 01 Nov 2026 19:09
Date: Sun, 01 Nov 2026 19:09
25 lines
15332 bytes
15332 bytes
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
Re: [RFC] hwmon: (tps23861) PSE-PD support, extend hwmon driver or move to pse-pd?
Author: Andrew Lunn
Date: Sun, 01 Nov 2026 19:57
Date: Sun, 01 Nov 2026 19:57
32 lines
9771 bytes
9771 bytes
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
Re: [RFC] hwmon: (tps23861) PSE-PD support, extend hwmon driver or move to pse-pd?
Author: Guenter Roeck
Date: Mon, 02 Nov 2026 14:54
Date: Mon, 02 Nov 2026 14:54
32 lines
15974 bytes
15974 bytes
On 11/2/26 01:49, Kory Maincent wrote: > > 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. > ... and you probably also use the hwmon "enable" attribute to enable and disable ports on this chip. Again, that is an ABI abuse. I'll refrain from removing the driver for now, but I will likely remove the attribute if//when I find the time to do it. Guenter
Re: [RFC] hwmon: (tps23861) PSE-PD support, extend hwmon driver or move to pse-pd?
Author: Andrew Lunn
Date: Mon, 02 Nov 2026 16:36
Date: Mon, 02 Nov 2026 16:36
14 lines
9084 bytes
9084 bytes
> I am not using at all the hwmon framework in that development.
> But as the binding tps23861 is already reserved for hwmon I use a new
> "tps23861-poe" compatible name binding.
> To me, I agree to remove the hwmon driver but this will break backward
> compatibility. I am not a hwmon maintainer so it's not my decision to take.
Is the hwmon code applicable to the tps238XX range of devices?
Can that hwmon code by merged into the PoE driver? Without API
changes, apart from dropping the API abuse case? The compatible can
then be transplanted into the PoE driver?
Andrew
Re: [RFC] hwmon: (tps23861) PSE-PD support, extend hwmon driver or move to pse-pd?
Author: Andrew Lunn
Date: Mon, 02 Nov 2026 17:33
Date: Mon, 02 Nov 2026 17:33
30 lines
9834 bytes
9834 bytes
On Mon, Nov 02, 2026 at 05:57:06PM +0100, Kory Maincent wrote: > > > On 11/2/26 17:36, Andrew Lunn wrote: > > > I am not using at all the hwmon framework in that development. > > > But as the binding tps23861 is already reserved for hwmon I use a new > > > "tps23861-poe" compatible name binding. > > > To me, I agree to remove the hwmon driver but this will break backward > > > compatibility. I am not a hwmon maintainer so it's not my decision to take. > > > > Is the hwmon code applicable to the tps238XX range of devices? > > > > Can that hwmon code by merged into the PoE driver? Without API > > changes, apart from dropping the API abuse case? The compatible can > > then be transplanted into the PoE driver? > > Should we really want to add the hwmon framework in the driver only to keep > the binding name? That is why i asked if the code is applicable. If it is using hwmon to show the temperature of the PoE controller, it probably is applicable. If it is just repeating the same information which is available in ethtool, then it is not so useful. If it is not useful, the hwmon driver should be marked as deprecated, and a pointer added to the real PoE driver. Andrew
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads