* [PATCH net v2] net: pse-pd: tps23881: Fix reported power class
@ 2026-11-23 13:34 Kory Maincent
2026-11-23 13:38 ` netdev-bot+sinfo
0 siblings, 1 reply; 4+ messages in thread
From: Kory Maincent @ 2026-11-23 13:34 UTC (permalink / raw)
To: Paolo Abeni, Kory Maincent, Oleksij Rempel, Jakub Kicinski,
netdev, linux-kernel
Cc: thomas.petazzoni, Andrew Lunn, David S. Miller, Eric Dumazet
The driver reports an incorrect class for values above 4.
The power class read from the classification register is not 1:1
aligned with the IEEE 802.3 class value. Add a lookup table to report
the correct class.
Fixes: 7f076ce3f1733 ("net: pse-pd: tps23881: Add support for power limit and measurement features")
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---
Change in v2:
- Report 0 for unknown classes instead of -ERANGE.
---
drivers/net/pse-pd/tps23881.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c
index 244ce596d845c..a2218a872e83b 100644
--- a/drivers/net/pse-pd/tps23881.c
+++ b/drivers/net/pse-pd/tps23881.c
@@ -402,6 +402,25 @@ tps23881_pi_get_chan_current(struct tps23881_priv *priv, u8 chan)
return (int)tmp_64;
}
+static int tps23881_class_table[] = {
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 0,
+ 0,
+ 0,
+ 5,
+ 6,
+ 7,
+ 8,
+ 4,
+ 5,
+ 0,
+ 0,
+};
+
static int tps23881_pi_get_pw_class(struct pse_controller_dev *pcdev,
int id)
{
@@ -416,7 +435,8 @@ static int tps23881_pi_get_pw_class(struct pse_controller_dev *pcdev,
if (ret < 0)
return ret;
- return tps23881_calc_val(ret, chan, 4, 0x0f);
+ ret = tps23881_calc_val(ret, chan, 4, 0x0f);
+ return tps23881_class_table[ret];
}
static int
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net v2] net: pse-pd: tps23881: Fix reported power class
2026-11-23 13:34 [PATCH net v2] net: pse-pd: tps23881: Fix reported power class Kory Maincent
@ 2026-11-23 13:38 ` netdev-bot+sinfo
2026-11-23 13:46 ` Kory Maincent
2026-11-23 13:55 ` Kory Maincent
0 siblings, 2 replies; 4+ messages in thread
From: netdev-bot+sinfo @ 2026-11-23 13:38 UTC (permalink / raw)
To: Kory Maincent
Cc: Paolo Abeni, Oleksij Rempel, Jakub Kicinski, netdev,
linux-kernel, thomas.petazzoni, Andrew Lunn, David S. Miller,
Eric Dumazet
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical
(e.g. found by LLM and not proven at runtime). If it was triggered
please include the symptoms, like the stack trace or kernel messages.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.
*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
--
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net v2] net: pse-pd: tps23881: Fix reported power class
2026-11-23 13:38 ` netdev-bot+sinfo
@ 2026-11-23 13:46 ` Kory Maincent
2026-11-23 13:55 ` Kory Maincent
1 sibling, 0 replies; 4+ messages in thread
From: Kory Maincent @ 2026-11-23 13:46 UTC (permalink / raw)
To: netdev-bot+sinfo
Cc: Paolo Abeni, Oleksij Rempel, Jakub Kicinski, netdev,
linux-kernel, thomas.petazzoni, Andrew Lunn, David S. Miller,
Eric Dumazet
On 11/23/26 14:38, netdev-bot+sinfo@kernel.org wrote:
> Hi!
>
> This is an automated message. This series looks like a fix, but its
> commit messages seem to be missing some information:
>
> - How the issue was discovered, e.g. hit in production, hit during
> development, syzbot report, manual code inspection, LLM or static
> analysis tool scan.
The issue was hit during development extending the current driver.
I don't see the point of explaining this but well ...
> - Whether the issue was actually triggered, or is only theoretical
> (e.g. found by LLM and not proven at runtime). If it was triggered
> please include the symptoms, like the stack trace or kernel messages.
IMHO I think the commit message is clear enough.
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net v2] net: pse-pd: tps23881: Fix reported power class
2026-11-23 13:38 ` netdev-bot+sinfo
2026-11-23 13:46 ` Kory Maincent
@ 2026-11-23 13:55 ` Kory Maincent
1 sibling, 0 replies; 4+ messages in thread
From: Kory Maincent @ 2026-11-23 13:55 UTC (permalink / raw)
To: netdev-bot+sinfo, Jakub Kicinski
Cc: Paolo Abeni, Oleksij Rempel, netdev, linux-kernel,
thomas.petazzoni, Andrew Lunn, David S. Miller, Eric Dumazet
It seems SUIE thinks I am working for DENT, but it's not the case.
Jakub is there something we can to to fix this.
I would like my review stat to go to bootlin stats.
On 11/23/26 14:38, netdev-bot+sinfo@kernel.org wrote:
> Hi!
>
> This is an automated message. This series looks like a fix, but its
> commit messages seem to be missing some information:
>
> - How the issue was discovered, e.g. hit in production, hit during
> development, syzbot report, manual code inspection, LLM or static
> analysis tool scan.
>
> - Whether the issue was actually triggered, or is only theoretical
> (e.g. found by LLM and not proven at runtime). If it was triggered
> please include the symptoms, like the stack trace or kernel messages.
>
> Please do not repost the series just to address the above. Instead,
> reply to this email with the missing information, so that reviewers
> can take it into account.
>
> *IMPORTANT*: If you do repost (for other reasons) - please include
> the relevant info in the cover letter or commit messages.
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-23 13:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23 13:34 [PATCH net v2] net: pse-pd: tps23881: Fix reported power class Kory Maincent
2026-11-23 13:38 ` netdev-bot+sinfo
2026-11-23 13:46 ` Kory Maincent
2026-11-23 13:55 ` Kory Maincent
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®