Skip to contentSkip to conversation

usb: misc: ljca: Fix enumeration error on Dell Latitude 9420

PATCH Superseded Hans de Goede 3 participants 4 messages Nov 4, 2023 – Nov 21, 2023

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 usb: misc: ljca: Fix enumeration error on Dell Latitude 9420

Not all LJCA chips implement SPI and on chips without SPI reading the SPI descriptors will timeout.

On laptop models like the Dell Latitude 9420, this is expected behavior and not an error.

Modify the driver to continue without instantiating a SPI auxbus child, instead of failing to probe() the whole LJCA chip.

Fixes 54f225fa5b58 ("usb: Add support for Intel LJCA device")

---
Changes in v2:
- Small commit msg + comment fixes
- Add Fixes tag + Cc: stable

---
 drivers/usb/misc/usb-ljca.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/misc/usb-ljca.c +2 -1
index c9decd0396d4..a280d3a54b18 100644
@@ -656,10 +656,11 @@ static int ljca_enumerate_spi(struct ljca_adapter *adap)
 	unsigned int i;
 	int ret;
 
+	/* Not all LJCA chips implement SPI, a timeout reading the descriptors is normal */
 	ret = ljca_send(adap, LJCA_CLIENT_MNG, LJCA_MNG_ENUM_SPI, NULL, 0, buf,
 			sizeof(buf), true, LJCA_ENUM_CLIENT_TIMEOUT_MS);
 	if (ret < 0)
-		return ret;
+		return (ret == -ETIMEDOUT) ? 0 : ret;
 
 	/* check firmware response */
 	desc = (struct ljca_spi_descriptor *)buf;
Signature · 1 line
2.41.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 8 lines

From: Hans de Goede

Not all LJCA chips implement SPI and on chips without SPI reading the SPI descriptors will timeout.

On laptop models like the Dell Latitude 9420, this is expected behavior and not an error.

Quoted 6 lines

Modify the driver to continue without instantiating a SPI auxbus child, instead of failing to probe() the whole LJCA chip.

Fixes 54f225fa5b58 ("usb: Add support for Intel LJCA device")
Quoted 30 lines

---
Changes in v2:
- Small commit msg + comment fixes
- Add Fixes tag + Cc: stable

---
 drivers/usb/misc/usb-ljca.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/misc/usb-ljca.c index renamed from drivers/usb/misc/usb-ljca.c +0 -0

c9decd0396d4..a280d3a54b18 100644

drivers/usb/misc/usb-ljca.c +3 -2
@@ -656,10 +656,11 @@ static int ljca_enumerate_spi(struct ljca_adapter
 *adap)
 	unsigned int i;
 	int ret;
 
+	/* Not all LJCA chips implement SPI, a timeout reading the descriptors
+is normal */
 	ret = ljca_send(adap, LJCA_CLIENT_MNG, LJCA_MNG_ENUM_SPI, NULL,
 0, buf,
 			sizeof(buf), true, LJCA_ENUM_CLIENT_TIMEOUT_MS);
 	if (ret < 0)
-		return ret;
+		return (ret == -ETIMEDOUT) ? 0 : ret;
 
 	/* check firmware response */
 	desc = (struct ljca_spi_descriptor *)buf;
--

2.41.0

#2 lore raw
In reply to Hans de Goede
Quoted 10 lines · Hans de Goede

Not all LJCA chips implement SPI and on chips without SPI reading the SPI descriptors will timeout.

On laptop models like the Dell Latitude 9420, this is expected behavior and not an error.

Modify the driver to continue without instantiating a SPI auxbus child, instead of failing to probe() the whole LJCA chip.

Fixes 54f225fa5b58 ("usb: Add support for Intel LJCA device")

That commit id isn't in Linus's tree, are you sure it's correct?

thanks,

greg k-h

#3 lore raw

Hi,

Quoted 7 lines · Greg Kroah-Hartman
Quoted 6 lines · Hans de Goede

Not all LJCA chips implement SPI and on chips without SPI reading the SPI descriptors will timeout.

On laptop models like the Dell Latitude 9420, this is expected behavior and not an error.

Quoted 6 lines
Quoted 4 lines

Modify the driver to continue without instantiating a SPI auxbus child, instead of failing to probe() the whole LJCA chip.

Fixes 54f225fa5b58 ("usb: Add support for Intel LJCA device")

That commit id isn't in Linus's tree, are you sure it's correct?

Sorry no idea where I got that commit-id from, probably from when I was carrying the patch in my personal tree for testing it.

I'll send a v3 with the correct commit-id.

Regards,

Hans