All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] usb: misc: ljca: Fix enumeration error on Dell Latitude 9420
@ 2023-11-04 17:51 Hans de Goede
  2023-11-06  5:28 ` Wu, Wentong
  2023-11-21 14:05 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 4+ messages in thread
From: Hans de Goede @ 2023-11-04 17:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Andi Shyti, Sakari Ailus, Wentong Wu
  Cc: Hans de Goede, Oliver Neukum, linux-usb, stable

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")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
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(-)

diff --git a/drivers/usb/misc/usb-ljca.c b/drivers/usb/misc/usb-ljca.c
index c9decd0396d4..a280d3a54b18 100644
--- a/drivers/usb/misc/usb-ljca.c
+++ b/drivers/usb/misc/usb-ljca.c
@@ -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


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

* RE: [PATCH v2] usb: misc: ljca: Fix enumeration error on Dell Latitude 9420
  2023-11-04 17:51 [PATCH v2] usb: misc: ljca: Fix enumeration error on Dell Latitude 9420 Hans de Goede
@ 2023-11-06  5:28 ` Wu, Wentong
  2023-11-21 14:05 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 4+ messages in thread
From: Wu, Wentong @ 2023-11-06  5:28 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Greg Kroah-Hartman, Andi Shyti, Sakari Ailus, Oliver Neukum,
	linux-usb, stable

> 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.
> 
> 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")
> Cc: stable@vger.kernel.org
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Reviewed-by: Wentong Wu <wentong.wu@intel.com>
> ---
> 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(-)
> 
> diff --git a/drivers/usb/misc/usb-ljca.c b/drivers/usb/misc/usb-ljca.c index
> c9decd0396d4..a280d3a54b18 100644
> --- a/drivers/usb/misc/usb-ljca.c
> +++ b/drivers/usb/misc/usb-ljca.c
> @@ -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


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

* Re: [PATCH v2] usb: misc: ljca: Fix enumeration error on Dell Latitude 9420
  2023-11-04 17:51 [PATCH v2] usb: misc: ljca: Fix enumeration error on Dell Latitude 9420 Hans de Goede
  2023-11-06  5:28 ` Wu, Wentong
@ 2023-11-21 14:05 ` Greg Kroah-Hartman
  2023-11-21 18:29   ` Hans de Goede
  1 sibling, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2023-11-21 14:05 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Andi Shyti, Sakari Ailus, Wentong Wu, Oliver Neukum, linux-usb, stable

On Sat, Nov 04, 2023 at 06:51:04PM +0100, Hans de Goede wrote:
> 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

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

* Re: [PATCH v2] usb: misc: ljca: Fix enumeration error on Dell Latitude 9420
  2023-11-21 14:05 ` Greg Kroah-Hartman
@ 2023-11-21 18:29   ` Hans de Goede
  0 siblings, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2023-11-21 18:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Andi Shyti, Sakari Ailus, Wentong Wu, Oliver Neukum, linux-usb, stable

Hi,

On 11/21/23 15:05, Greg Kroah-Hartman wrote:
> On Sat, Nov 04, 2023 at 06:51:04PM +0100, Hans de Goede wrote:
>> 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?

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


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

end of thread, other threads:[~2023-11-21 18:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-04 17:51 [PATCH v2] usb: misc: ljca: Fix enumeration error on Dell Latitude 9420 Hans de Goede
2023-11-06  5:28 ` Wu, Wentong
2023-11-21 14:05 ` Greg Kroah-Hartman
2023-11-21 18:29   ` Hans de Goede

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.