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. Regards, -- Köry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com