All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/1] usb: storage: continue probe on "Invalid device"
@ 2022-08-10 19:54 Janne Grunau
  2022-08-10 21:33 ` Simon Glass
  2022-09-26  5:07 ` Janne Grunau
  0 siblings, 2 replies; 9+ messages in thread
From: Janne Grunau @ 2022-08-10 19:54 UTC (permalink / raw)
  To: Lukasz Majewski, u-boot; +Cc: AKASHI Takahiro, Simon Glass

Fixes a crash during probing of sd card readers without medium present.

Link: https://github.com/AsahiLinux/linux/issues/44
Link: https://lists.denx.de/pipermail/u-boot/2022-July/489717.html
Signed-off-by: Janne Grunau <j@jannau.net>
---
Changes since v1:
 - changed unconditiona return to "continue" as proposed by AKASHI Takahiro

 common/usb_storage.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/usb_storage.c b/common/usb_storage.c
index eaa31374ef73..f9204552a683 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -239,6 +239,7 @@ static int usb_stor_probe_device(struct usb_device *udev)
 			ret = device_unbind(dev);
 			if (ret)
 				return ret;
+			continue;
 		}
 
 		ret = blk_probe_or_unbind(dev);
-- 
2.35.1


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

* Re: [PATCH v2 1/1] usb: storage: continue probe on "Invalid device"
  2022-08-10 19:54 [PATCH v2 1/1] usb: storage: continue probe on "Invalid device" Janne Grunau
@ 2022-08-10 21:33 ` Simon Glass
  2022-09-26  5:07 ` Janne Grunau
  1 sibling, 0 replies; 9+ messages in thread
From: Simon Glass @ 2022-08-10 21:33 UTC (permalink / raw)
  To: Janne Grunau; +Cc: Lukasz Majewski, U-Boot Mailing List, AKASHI Takahiro

On Wed, 10 Aug 2022 at 13:54, Janne Grunau <j@jannau.net> wrote:
>
> Fixes a crash during probing of sd card readers without medium present.
>
> Link: https://github.com/AsahiLinux/linux/issues/44
> Link: https://lists.denx.de/pipermail/u-boot/2022-July/489717.html
> Signed-off-by: Janne Grunau <j@jannau.net>
> ---
> Changes since v1:
>  - changed unconditiona return to "continue" as proposed by AKASHI Takahiro
>
>  common/usb_storage.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Simon Glass <sjg@chromium.org>


>
> diff --git a/common/usb_storage.c b/common/usb_storage.c
> index eaa31374ef73..f9204552a683 100644
> --- a/common/usb_storage.c
> +++ b/common/usb_storage.c
> @@ -239,6 +239,7 @@ static int usb_stor_probe_device(struct usb_device *udev)
>                         ret = device_unbind(dev);
>                         if (ret)
>                                 return ret;
> +                       continue;
>                 }
>
>                 ret = blk_probe_or_unbind(dev);
> --
> 2.35.1
>

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

* Re: [PATCH v2 1/1] usb: storage: continue probe on "Invalid device"
  2022-08-10 19:54 [PATCH v2 1/1] usb: storage: continue probe on "Invalid device" Janne Grunau
  2022-08-10 21:33 ` Simon Glass
@ 2022-09-26  5:07 ` Janne Grunau
  2022-09-28 10:20   ` Simon Glass
  1 sibling, 1 reply; 9+ messages in thread
From: Janne Grunau @ 2022-09-26  5:07 UTC (permalink / raw)
  To: Lukasz Majewski, u-boot; +Cc: AKASHI Takahiro, Simon Glass

On 2022-08-10 21:54:22 +0200, Janne Grunau wrote:
> Fixes a crash during probing of sd card readers without medium present.
> 
> Link: https://github.com/AsahiLinux/linux/issues/44
> Link: https://lists.denx.de/pipermail/u-boot/2022-July/489717.html
> Signed-off-by: Janne Grunau <j@jannau.net>
> ---
> Changes since v1:
>  - changed unconditiona return to "continue" as proposed by AKASHI Takahiro
> 
>  common/usb_storage.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/common/usb_storage.c b/common/usb_storage.c
> index eaa31374ef73..f9204552a683 100644
> --- a/common/usb_storage.c
> +++ b/common/usb_storage.c
> @@ -239,6 +239,7 @@ static int usb_stor_probe_device(struct usb_device *udev)
>  			ret = device_unbind(dev);
>  			if (ret)
>  				return ret;
> +			continue;
>  		}
>  
>  		ret = blk_probe_or_unbind(dev);

ping. Is there anything holding up merging this fix?

Thanks,
Janne

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

* Re: [PATCH v2 1/1] usb: storage: continue probe on "Invalid device"
  2022-09-26  5:07 ` Janne Grunau
@ 2022-09-28 10:20   ` Simon Glass
  2022-11-03 21:36     ` Janne Grunau
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Glass @ 2022-09-28 10:20 UTC (permalink / raw)
  To: Janne Grunau, Marek Vasut, Tom Rini
  Cc: Lukasz Majewski, U-Boot Mailing List, AKASHI Takahiro

+Marek Vasut
+Tom Rini

On Sun, 25 Sept 2022 at 23:07, Janne Grunau <j@jannau.net> wrote:
>
> On 2022-08-10 21:54:22 +0200, Janne Grunau wrote:
> > Fixes a crash during probing of sd card readers without medium present.
> >
> > Link: https://github.com/AsahiLinux/linux/issues/44
> > Link: https://lists.denx.de/pipermail/u-boot/2022-July/489717.html
> > Signed-off-by: Janne Grunau <j@jannau.net>
> > ---
> > Changes since v1:
> >  - changed unconditiona return to "continue" as proposed by AKASHI Takahiro
> >
> >  common/usb_storage.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/common/usb_storage.c b/common/usb_storage.c
> > index eaa31374ef73..f9204552a683 100644
> > --- a/common/usb_storage.c
> > +++ b/common/usb_storage.c
> > @@ -239,6 +239,7 @@ static int usb_stor_probe_device(struct usb_device *udev)
> >                       ret = device_unbind(dev);
> >                       if (ret)
> >                               return ret;
> > +                     continue;
> >               }
> >
> >               ret = blk_probe_or_unbind(dev);
>
> ping. Is there anything holding up merging this fix?
>
> Thanks,
> Janne

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

* Re: [PATCH v2 1/1] usb: storage: continue probe on "Invalid device"
  2022-09-28 10:20   ` Simon Glass
@ 2022-11-03 21:36     ` Janne Grunau
  2022-11-03 22:23       ` Marek Vasut
  0 siblings, 1 reply; 9+ messages in thread
From: Janne Grunau @ 2022-11-03 21:36 UTC (permalink / raw)
  To: Simon Glass
  Cc: Marek Vasut, Tom Rini, Lukasz Majewski, U-Boot Mailing List,
	AKASHI Takahiro

On 2022-09-28 04:20:52 -0600, Simon Glass wrote:
> +Marek Vasut
> +Tom Rini
> 
> On Sun, 25 Sept 2022 at 23:07, Janne Grunau <j@jannau.net> wrote:
> >
> > On 2022-08-10 21:54:22 +0200, Janne Grunau wrote:
> > > Fixes a crash during probing of sd card readers without medium present.
> > >
> > > Link: https://github.com/AsahiLinux/linux/issues/44
> > > Link: https://lists.denx.de/pipermail/u-boot/2022-July/489717.html
> > > Signed-off-by: Janne Grunau <j@jannau.net>
> > > ---
> > > Changes since v1:
> > >  - changed unconditiona return to "continue" as proposed by AKASHI Takahiro
> > >
> > >  common/usb_storage.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/common/usb_storage.c b/common/usb_storage.c
> > > index eaa31374ef73..f9204552a683 100644
> > > --- a/common/usb_storage.c
> > > +++ b/common/usb_storage.c
> > > @@ -239,6 +239,7 @@ static int usb_stor_probe_device(struct usb_device *udev)
> > >                       ret = device_unbind(dev);
> > >                       if (ret)
> > >                               return ret;
> > > +                     continue;
> > >               }
> > >
> > >               ret = blk_probe_or_unbind(dev);
> >
> > ping. Is there anything holding up merging this fix?

ping2

This fixes a 100% reproducible crash when an USB storage device with 
"medium not ready" is connected.

Janne 

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

* Re: [PATCH v2 1/1] usb: storage: continue probe on "Invalid device"
  2022-11-03 21:36     ` Janne Grunau
@ 2022-11-03 22:23       ` Marek Vasut
  2022-11-03 22:38         ` Marek Vasut
  2022-11-04  7:35         ` Janne Grunau
  0 siblings, 2 replies; 9+ messages in thread
From: Marek Vasut @ 2022-11-03 22:23 UTC (permalink / raw)
  To: Janne Grunau, Simon Glass
  Cc: Tom Rini, Lukasz Majewski, U-Boot Mailing List, AKASHI Takahiro

On 11/3/22 22:36, Janne Grunau wrote:
> On 2022-09-28 04:20:52 -0600, Simon Glass wrote:
>> +Marek Vasut
>> +Tom Rini
>>
>> On Sun, 25 Sept 2022 at 23:07, Janne Grunau <j@jannau.net> wrote:
>>>
>>> On 2022-08-10 21:54:22 +0200, Janne Grunau wrote:
>>>> Fixes a crash during probing of sd card readers without medium present.
>>>>
>>>> Link: https://github.com/AsahiLinux/linux/issues/44
>>>> Link: https://lists.denx.de/pipermail/u-boot/2022-July/489717.html
>>>> Signed-off-by: Janne Grunau <j@jannau.net>
>>>> ---
>>>> Changes since v1:
>>>>   - changed unconditiona return to "continue" as proposed by AKASHI Takahiro
>>>>
>>>>   common/usb_storage.c | 1 +
>>>>   1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/common/usb_storage.c b/common/usb_storage.c
>>>> index eaa31374ef73..f9204552a683 100644
>>>> --- a/common/usb_storage.c
>>>> +++ b/common/usb_storage.c
>>>> @@ -239,6 +239,7 @@ static int usb_stor_probe_device(struct usb_device *udev)
>>>>                        ret = device_unbind(dev);
>>>>                        if (ret)
>>>>                                return ret;
>>>> +                     continue;
>>>>                }
>>>>
>>>>                ret = blk_probe_or_unbind(dev);
>>>
>>> ping. Is there anything holding up merging this fix?
> 
> ping2
> 
> This fixes a 100% reproducible crash when an USB storage device with
> "medium not ready" is connected.

Can you please CC me next time when submitting these kinds of USB fixes ?

Also, can you tell which device this is ?

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

* Re: [PATCH v2 1/1] usb: storage: continue probe on "Invalid device"
  2022-11-03 22:23       ` Marek Vasut
@ 2022-11-03 22:38         ` Marek Vasut
  2022-11-04  7:35         ` Janne Grunau
  1 sibling, 0 replies; 9+ messages in thread
From: Marek Vasut @ 2022-11-03 22:38 UTC (permalink / raw)
  To: Janne Grunau, Simon Glass
  Cc: Tom Rini, Lukasz Majewski, U-Boot Mailing List, AKASHI Takahiro

On 11/3/22 23:23, Marek Vasut wrote:
> On 11/3/22 22:36, Janne Grunau wrote:
>> On 2022-09-28 04:20:52 -0600, Simon Glass wrote:
>>> +Marek Vasut
>>> +Tom Rini
>>>
>>> On Sun, 25 Sept 2022 at 23:07, Janne Grunau <j@jannau.net> wrote:
>>>>
>>>> On 2022-08-10 21:54:22 +0200, Janne Grunau wrote:
>>>>> Fixes a crash during probing of sd card readers without medium 
>>>>> present.
>>>>>
>>>>> Link: https://github.com/AsahiLinux/linux/issues/44
>>>>> Link: https://lists.denx.de/pipermail/u-boot/2022-July/489717.html
>>>>> Signed-off-by: Janne Grunau <j@jannau.net>
>>>>> ---
>>>>> Changes since v1:
>>>>>   - changed unconditiona return to "continue" as proposed by AKASHI 
>>>>> Takahiro
>>>>>
>>>>>   common/usb_storage.c | 1 +
>>>>>   1 file changed, 1 insertion(+)
>>>>>
>>>>> diff --git a/common/usb_storage.c b/common/usb_storage.c
>>>>> index eaa31374ef73..f9204552a683 100644
>>>>> --- a/common/usb_storage.c
>>>>> +++ b/common/usb_storage.c
>>>>> @@ -239,6 +239,7 @@ static int usb_stor_probe_device(struct 
>>>>> usb_device *udev)
>>>>>                        ret = device_unbind(dev);
>>>>>                        if (ret)
>>>>>                                return ret;
>>>>> +                     continue;
>>>>>                }
>>>>>
>>>>>                ret = blk_probe_or_unbind(dev);
>>>>
>>>> ping. Is there anything holding up merging this fix?
>>
>> ping2
>>
>> This fixes a 100% reproducible crash when an USB storage device with
>> "medium not ready" is connected.
> 
> Can you please CC me next time when submitting these kinds of USB fixes ?
> 
> Also, can you tell which device this is ?

Reading through the rest of the links, can you please just fill in 
details of the USB card reader for future reference (like lsusb -vvvn or 
similar). And then send V3 with my:

Reviewed-by: Marek Vasut <marex@denx.de>

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

* Re: [PATCH v2 1/1] usb: storage: continue probe on "Invalid device"
  2022-11-03 22:23       ` Marek Vasut
  2022-11-03 22:38         ` Marek Vasut
@ 2022-11-04  7:35         ` Janne Grunau
  2022-11-04 11:29           ` Marek Vasut
  1 sibling, 1 reply; 9+ messages in thread
From: Janne Grunau @ 2022-11-04  7:35 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Simon Glass, Tom Rini, Lukasz Majewski, U-Boot Mailing List,
	AKASHI Takahiro

On 2022-11-03 23:23:52 +0100, Marek Vasut wrote:
> On 11/3/22 22:36, Janne Grunau wrote:
> > On 2022-09-28 04:20:52 -0600, Simon Glass wrote:
> > > +Marek Vasut
> > > +Tom Rini
> > > 
> > > On Sun, 25 Sept 2022 at 23:07, Janne Grunau <j@jannau.net> wrote:
> > > > 
> > > > On 2022-08-10 21:54:22 +0200, Janne Grunau wrote:
> > > > > Fixes a crash during probing of sd card readers without medium present.
> > > > > 
> > > > > Link: https://github.com/AsahiLinux/linux/issues/44
> > > > > Link: https://lists.denx.de/pipermail/u-boot/2022-July/489717.html
> > > > > Signed-off-by: Janne Grunau <j@jannau.net>
> > > > > ---
> > > > > Changes since v1:
> > > > >   - changed unconditiona return to "continue" as proposed by AKASHI Takahiro
> > > > > 
> > > > >   common/usb_storage.c | 1 +
> > > > >   1 file changed, 1 insertion(+)
> > > > > 
> > > > > diff --git a/common/usb_storage.c b/common/usb_storage.c
> > > > > index eaa31374ef73..f9204552a683 100644
> > > > > --- a/common/usb_storage.c
> > > > > +++ b/common/usb_storage.c
> > > > > @@ -239,6 +239,7 @@ static int usb_stor_probe_device(struct usb_device *udev)
> > > > >                        ret = device_unbind(dev);
> > > > >                        if (ret)
> > > > >                                return ret;
> > > > > +                     continue;
> > > > >                }
> > > > > 
> > > > >                ret = blk_probe_or_unbind(dev);
> > > > 
> > > > ping. Is there anything holding up merging this fix?
> > 
> > ping2
> > 
> > This fixes a 100% reproducible crash when an USB storage device with
> > "medium not ready" is connected.
> 
> Can you please CC me next time when submitting these kinds of USB fixes ?

sure, the cc list was the get_maintainers.pl output.

> Also, can you tell which device this is ?

I don't think the device matters but I'm seeing this problem with

Bus 002 Device 005: ID 0bda:0326 Realtek Semiconductor Corp. Card reader
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            0 bDeviceSubClass         0 bDeviceProtocol         
0 bMaxPacketSize0         9
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0x0326 Card reader
  bcdDevice           11.24
  iManufacturer           1 Realtek
  iProduct                2 USB3.0 Card Reader
  iSerial                 3 201404081410
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x002c
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4 CARD READER
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              800mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              5 Bulk-In, Bulk-Out, Interface
      Endpoint Descriptor:
	bLength                 7
	bDescriptorType         5
	bEndpointAddress     0x01  EP 1 OUT
	bmAttributes            2
	  Transfer Type            Bulk
	  Synch Type               None
	  Usage Type               Data
	wMaxPacketSize     0x0400  1x 1024 bytes
	bInterval               0
	bMaxBurst               7
      Endpoint Descriptor:
	bLength                 7
	bDescriptorType         5
	bEndpointAddress     0x82  EP 2 IN
	bmAttributes            2
	  Transfer Type            Bulk
	  Synch Type               None
	  Usage Type               Data
	wMaxPacketSize     0x0400  1x 1024 bytes
	bInterval               0
	bMaxBurst               7
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength       0x0016
  bNumDeviceCaps          2
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x0000f41e
      BESL Link Power Management (LPM) Supported
    BESL value     1024 us Deep BESL value    61440 us SuperSpeed USB 
Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x02
      Latency Tolerance Messages (LTM) Supported
    wSpeedsSupported   0x000e
      Device can operate at Full Speed (12Mbps)
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   1
      Lowest fully-functional device speed is Full Speed (12Mbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat        1023 micro seconds
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x001c
  (Bus Powered)
  U1 Enabled
  U2 Enabled
  Latency Tolerance Messaging (LTM) Enabled


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

* Re: [PATCH v2 1/1] usb: storage: continue probe on "Invalid device"
  2022-11-04  7:35         ` Janne Grunau
@ 2022-11-04 11:29           ` Marek Vasut
  0 siblings, 0 replies; 9+ messages in thread
From: Marek Vasut @ 2022-11-04 11:29 UTC (permalink / raw)
  To: Janne Grunau
  Cc: Simon Glass, Tom Rini, Lukasz Majewski, U-Boot Mailing List,
	AKASHI Takahiro

On 11/4/22 08:35, Janne Grunau wrote:
> On 2022-11-03 23:23:52 +0100, Marek Vasut wrote:
>> On 11/3/22 22:36, Janne Grunau wrote:
>>> On 2022-09-28 04:20:52 -0600, Simon Glass wrote:
>>>> +Marek Vasut
>>>> +Tom Rini
>>>>
>>>> On Sun, 25 Sept 2022 at 23:07, Janne Grunau <j@jannau.net> wrote:
>>>>>
>>>>> On 2022-08-10 21:54:22 +0200, Janne Grunau wrote:
>>>>>> Fixes a crash during probing of sd card readers without medium present.
>>>>>>
>>>>>> Link: https://github.com/AsahiLinux/linux/issues/44
>>>>>> Link: https://lists.denx.de/pipermail/u-boot/2022-July/489717.html
>>>>>> Signed-off-by: Janne Grunau <j@jannau.net>
>>>>>> ---
>>>>>> Changes since v1:
>>>>>>    - changed unconditiona return to "continue" as proposed by AKASHI Takahiro
>>>>>>
>>>>>>    common/usb_storage.c | 1 +
>>>>>>    1 file changed, 1 insertion(+)
>>>>>>
>>>>>> diff --git a/common/usb_storage.c b/common/usb_storage.c
>>>>>> index eaa31374ef73..f9204552a683 100644
>>>>>> --- a/common/usb_storage.c
>>>>>> +++ b/common/usb_storage.c
>>>>>> @@ -239,6 +239,7 @@ static int usb_stor_probe_device(struct usb_device *udev)
>>>>>>                         ret = device_unbind(dev);
>>>>>>                         if (ret)
>>>>>>                                 return ret;
>>>>>> +                     continue;
>>>>>>                 }
>>>>>>
>>>>>>                 ret = blk_probe_or_unbind(dev);
>>>>>
>>>>> ping. Is there anything holding up merging this fix?
>>>
>>> ping2
>>>
>>> This fixes a 100% reproducible crash when an USB storage device with
>>> "medium not ready" is connected.
>>
>> Can you please CC me next time when submitting these kinds of USB fixes ?
> 
> sure, the cc list was the get_maintainers.pl output.

Ah, the MAINTAINERS entry is wrong, fix is out, thanks.

>> Also, can you tell which device this is ?
> 
> I don't think the device matters but I'm seeing this problem with
> 
> Bus 002 Device 005: ID 0bda:0326 Realtek Semiconductor Corp. Card reader
> Device Descriptor:
>    bLength                18
>    bDescriptorType         1
>    bcdUSB               3.00
>    bDeviceClass            0 bDeviceSubClass         0 bDeviceProtocol
> 0 bMaxPacketSize0         9
>    idVendor           0x0bda Realtek Semiconductor Corp.
>    idProduct          0x0326 Card reader

I'll see if I can get one of these for testing, thanks.

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

end of thread, other threads:[~2022-11-04 11:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-10 19:54 [PATCH v2 1/1] usb: storage: continue probe on "Invalid device" Janne Grunau
2022-08-10 21:33 ` Simon Glass
2022-09-26  5:07 ` Janne Grunau
2022-09-28 10:20   ` Simon Glass
2022-11-03 21:36     ` Janne Grunau
2022-11-03 22:23       ` Marek Vasut
2022-11-03 22:38         ` Marek Vasut
2022-11-04  7:35         ` Janne Grunau
2022-11-04 11:29           ` Marek Vasut

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.