All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kory Maincent <kory.maincent@bootlin.com>
To: Kyle Swenson <kyle.swenson@est.tech>,
	"o.rempel@pengutronix.de" <o.rempel@pengutronix.de>,
	"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"robh@kernel.org" <robh@kernel.org>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Roland Kovács" <roland.kovacs@est.tech>,
	"David Nyström" <david.nystrom@est.tech>
Subject: Re: [RFC PATCH net-next v2 0/2] net: pse-pd: Add LTC4266 PSE controller driver
Date: Mon, 24 Aug 2026 14:43:44 +0200	[thread overview]
Message-ID: <41dd51e5-ac20-48b5-9e7c-4d2d261f3402@bootlin.com> (raw)
In-Reply-To: <20260820142429.2285172-1-kyle.swenson@est.tech>

Hello Kyle,

Sadly, we won't present together at the next ELCE, but well, we still 
can drink a beer together. Are you going anyway?

On 8/20/26 16:25, Kyle Swenson wrote:
> This RFC series intends to continue discussion around the support for
> the LTC4266, an older PSE controller that supports powering Type 1 and
> Type 2 PDs.
> 
> This chip has four individually controllable ports, each with its own
> detection, classification and current-limiting abilities.  The driver
> declares the static power budgeting strategy.
> 
> The LTC4266 only enforces a current limit (I_CUT and I_LIM), not a power
> limit, so an admin power limit has to be turned into a current limit.
> There are two problems that fall out of this I don't feel like I've got
> a great solution to either and would welcome feedback, hence the 2nd RFC
> version.

Of course every controller is doing it on its own way ...
I have taken a look at your driver, it would be more precise to use the 
voltage used on each ports instead of the constant LTC4266_VPORT_MIN_MV.
I don't have the datasheet of the registers but does a read voltage 
return a value even with no PD plugged?
BTW I don't understand why in ltc4266_pi_set_pw_limit you are using the 
detected class for power comparison. If the user wants to set a power 
above the current detected class, well lets allow him to do so. Also 
this will prevent any power limit set if no PD is plugged which is not good.

> The first problem is programming the current limit from the
> admin-specified power limit for power limits other than a specific PD
> class.  For this, I replaced the linear regression in the first RFC with
> the minimum port voltage for a Type 2 PSE (50V, from Table 33-11 in the
> IEEE 802.3 spec) to convert power to current.

See above, please use a measured voltage for more precision.
  > The second problem is that when the admin does something like
> 
>      ethtool --set-pse eth1 c33-pse-avail-pw-limit 10000
> 
> the command fails with:
> 
>      netlink error: Can't calculate the current, PSE voltage read is 0
>      netlink error: Result not representable
> 
> unless the PSE port has been enabled first, and the PSE has detected and
> classified a PD on that port.  I'm hopeful I'm just missing something I
> can do differently in this driver, but if not I'm open to adjusting
> things at other layers to support this.

To have this working the pi_get_voltage should return some value even 
with no PD plugged.

I am replying only here for now. I will take a look more deeply on your 
code when this is solved. Is it ok for you?

Also I think your code is rather ready, so you could remove the RFC 
prefix. With it, the nedev check are not triggered.

Also in the 2nd patch you should add yourself in the MAINTAINERS file 
for this new driver.

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com


      parent reply	other threads:[~2026-08-24 12:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20 14:25 [RFC PATCH net-next v2 0/2] net: pse-pd: Add LTC4266 PSE controller driver Kyle Swenson
2026-08-20 14:25 ` [RFC PATCH net-next v2 1/2] dt-bindings: net: pse-pd: Add bindings for LTC4266 PSE Controller Kyle Swenson
2026-08-21 14:25   ` sashiko-bot
2026-08-24 10:46   ` Kory Maincent
2026-08-24 15:28     ` Kyle Swenson
2026-08-20 14:25 ` [RFC PATCH net-next v2 2/2] net: pse-pd: Add LTC4266 PSE controller driver Kyle Swenson
2026-08-21 14:25   ` sashiko-bot
2026-08-24 12:43 ` Kory Maincent [this message]

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=41dd51e5-ac20-48b5-9e7c-4d2d261f3402@bootlin.com \
    --to=kory.maincent@bootlin.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=david.nystrom@est.tech \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kyle.swenson@est.tech \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=roland.kovacs@est.tech \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.