The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH net] net: pse-pd: tps23881: fix the disconnect event decode
@ 2026-11-28 10:06 Carlo Szelinsky
  2026-11-28 10:09 ` netdev-bot+sinfo
  0 siblings, 1 reply; 3+ messages in thread
From: Carlo Szelinsky @ 2026-11-28 10:06 UTC (permalink / raw)
  To: Kory Maincent, Oleksij Rempel
  Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel

tps23881_irq_event_handler() reads the fault register into ret, and
then overwrites ret with the return value of
tps23881_irq_event_over_current(). That value is 0 when
tps23881_irq_event_disconnection() runs, so the disconnect bits of the
fault register are never decoded, and no disconnect event is reported
from them. The read clears the register, so these bits are lost.

Keep the register value in val, as the detection block below already
does.

Fixes: 56cfc97635e9 ("net: pse-pd: tps23881: Add support for static port priority feature")
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
---
Build-tested only, I have no tps23881 board. Kory, could you check it on
yours?

 drivers/net/pse-pd/tps23881.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c
index 244ce596d845..feda71117fbc 100644
--- a/drivers/net/pse-pd/tps23881.c
+++ b/drivers/net/pse-pd/tps23881.c
@@ -1316,12 +1316,15 @@ static int tps23881_irq_event_handler(struct tps23881_priv *priv, u16 reg,
 		ret = i2c_smbus_read_word_data(client, TPS23881_REG_FAULT);
 		if (ret < 0)
 			return ret;
-		ret = tps23881_irq_event_over_current(priv, ret, notifs,
+
+		val = ret;
+		ret = tps23881_irq_event_over_current(priv, val, notifs,
 						      notifs_mask);
 		if (ret)
 			return ret;
 
-		tps23881_irq_event_disconnection(priv, ret, notifs, notifs_mask);
+		tps23881_irq_event_disconnection(priv, val, notifs,
+						 notifs_mask);
 	}
 
 	if (reg & (TPS23881_REG_IT_DETC | TPS23881_REG_IT_DETC << 8 |

base-commit: 28a371228d4eb4857cc31eeb1a0d7d01e9c3ea2f
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: pse-pd: tps23881: fix the disconnect event decode
  2026-11-28 10:06 [PATCH net] net: pse-pd: tps23881: fix the disconnect event decode Carlo Szelinsky
@ 2026-11-28 10:09 ` netdev-bot+sinfo
  2026-11-28 12:22   ` Carlo Szelinsky
  0 siblings, 1 reply; 3+ messages in thread
From: netdev-bot+sinfo @ 2026-11-28 10:09 UTC (permalink / raw)
  To: Carlo Szelinsky
  Cc: Kory Maincent, Oleksij Rempel, Andrew Lunn, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel

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.

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] 3+ messages in thread

* Re: [PATCH net] net: pse-pd: tps23881: fix the disconnect event decode
  2026-11-28 10:09 ` netdev-bot+sinfo
@ 2026-11-28 12:22   ` Carlo Szelinsky
  0 siblings, 0 replies; 3+ messages in thread
From: Carlo Szelinsky @ 2026-11-28 12:22 UTC (permalink / raw)
  To: netdev-bot+sinfo
  Cc: Kory Maincent, Oleksij Rempel, Andrew Lunn, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel

On Sat, 28 Nov 2026 10:09:29 +0000, netdev-bot+sinfo@kernel.org wrote:
> - How the issue was discovered

By code inspection, with help from an LLM assistant, while I was
reading the tps23881 IRQ path for another PSE series. I checked the
register layout against the TPS23881 datasheet: the fault event
register is at 06h/07h, the DISF bits are 7-4, and 07h is clear on
read.

It is build-tested only, as said below the --- of the patch.

Carlo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-28 12:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-28 10:06 [PATCH net] net: pse-pd: tps23881: fix the disconnect event decode Carlo Szelinsky
2026-11-28 10:09 ` netdev-bot+sinfo
2026-11-28 12:22   ` Carlo Szelinsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox