On Tue, Oct 08, 2024 at 04:21:20PM +0200, Kory Maincent wrote: > On Tue, 8 Oct 2024 15:57:22 +0200 > Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> wrote: > > > On Thu, Oct 03, 2024 at 01:41:02AM +0200, Andrew Lunn wrote: > > > > + msg = pd692x0_msg_template_list[PD692X0_MSG_SET_PORT_PARAM]; > > > > + msg.sub[2] = id; > > > > + /* Controller priority from 1 to 3 */ > > > > + msg.data[4] = prio + 1; > > > > > > Does 0 have a meaning? It just seems an odd design if it does not. > > > > 0 is not documented. But there are sub-priority which are not directly > > configured by user, but affect the system behavior. > > > > Priority#: Critical – 1; high – 2; low – 3 > > For ports with the same priority, the PoE Controller sets the > > sub-priority according to the logic port number. (Lower number gets > > higher priority). > > > > Port priority affects: > > 1. Power-up order: After a reset, the ports are powered up according to > > their priority, highest to lowest, highest priority will power up first. > > 2. Shutdown order: When exceeding the power budget, lowest priority > > ports will turn off first. > > > > Should we return sub priorities on the prio get request? > > > > If i see it correctly, even if user do not actively configures priorities, > > they are always present. For example port 0 will have always a Prio > > higher than Port 10. > > We could add a subprio ehtool attribute, but it won't be configurable. > In fact it could be configurable by changing the port matrix order but it is not > a good idea. Applying a new port matrix turn off all the ports. > > I am not sure if it is specific to Microchip controller or if it is generic > enough to add the attribute. > I would say not to return it for now. The generic attribute do not reflect the behavior of two different controllers. Currently implemented prio attribute is in this case TI specific and do not work for Microchip case. Please note, I do not care about configurability in this case, I only care about information the user get. -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |