Re: [PATCH] net: usb: lan78xx: Fix lost EEPROM read timeout error(-ETIMEDOUT) in lan78xx_read_raw_eeprom

From
Bhanu Seshu Kumar Valluri <hidden>
Date
2025-10-01 08:45:50
Also in
linux-usb, lkml
Reply to
Oleksij Rempel, 2025-10-01
On 01/10/25 14:08, Oleksij Rempel wrote:
On Wed, Oct 01, 2025 at 02:01:24PM +0530, Bhanu Seshu Kumar Valluri wrote:
quoted
On 01/10/25 13:54, Oleksij Rempel wrote:
quoted
On Wed, Oct 01, 2025 at 01:40:56PM +0530, Bhanu Seshu Kumar Valluri wrote:
quoted
On 01/10/25 13:12, Oleksij Rempel wrote:
quoted
Hi,

On Wed, Oct 01, 2025 at 10:07:21AM +0530, Bhanu Seshu Kumar Valluri wrote:
quoted
On 01/10/25 06:09, Jakub Kicinski wrote:
quoted
On Tue, 30 Sep 2025 14:19:02 +0530 Bhanu Seshu Kumar Valluri wrote:
quoted
+	if (dev->chipid == ID_REV_CHIP_ID_7800_) {
+		int rc = lan78xx_write_reg(dev, HW_CFG, saved);
+		/* If USB fails, there is nothing to do */
+		if (rc < 0)
+			return rc;
+	}
+	return ret;
I don't think you need to add and handle rc here separately?
rc can only be <= so save the answer to ret and "fall thru"?
The fall thru path might have been reached with ret holding EEPROM read timeout
error status. So if ret is used instead of rc it might over write the ret with 0 when 
lan78xx_write_reg returns success and timeout error status would be lost.
Ack, I see. It may happen if communication with EEPROM will fail. The same
would happen on write path too. Is it happened with real HW or it is
some USB emulation test? For me it is interesting why EEPROM is timed
out.
The sysbot's log with message "EEPROM read operation timeout" confirms that EEPROM read
timeout occurring. I tested the same condition on EVB-LAN7800LC by simulating 
timeout during probe.
Do you simulating timeout during probe by modifying the code, or it is
real HW issue?
On my real hardware timeout didn't occur. So I simulated it once by modifying the code
to confirm the BUG. The BUG has occurred confirming syzbot finding.
Ok, thank you!

Can you please add similar change to lan78xx_write_raw_eeprom. syzbot
will find it soon or later.
Ok. I will try to send a separate patch for that.

Thank you.
Thread (11 messages) 11 messages, 4 authors, last reply 2025-10-03
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help