All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] usb: return 0 from usb_stor_get_info even if removable media
@ 2017-04-11  1:23 Troy Kisky
  2017-04-14 14:00 ` Marek Vasut
  0 siblings, 1 reply; 2+ messages in thread
From: Troy Kisky @ 2017-04-11  1:23 UTC (permalink / raw)
  To: u-boot

This fixes a regression caused by

commit 07b2b78ce4bc8ae25e066c65245eaf58c0d9a67c
    dm: usb: Convert USB storage to use driver-model for block devs

which caused part_init to be called when it was not previously.
Without this patch, the following happens when a USB sd card reader is used.

=> usb start
starting USB...
USB0:   Port not available.
USB1:   USB EHCI 1.00
scanning bus 1 for devices... 3 USB Device(s) found
       scanning usb for storage devices... Device NOT ready
   Request Sense returned 02 3A 00
 ### ERROR ### Please RESET the board ###

This happens because dev_desc->blksz is 0.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
---
 common/usb_storage.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/common/usb_storage.c b/common/usb_storage.c
index b524a15..83279c4 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -1440,10 +1440,8 @@ int usb_stor_get_info(struct usb_device *dev, struct us_data *ss,
 		       "   Request Sense returned %02X %02X %02X\n",
 		       pccb->sense_buf[2], pccb->sense_buf[12],
 		       pccb->sense_buf[13]);
-		if (dev_desc->removable == 1) {
+		if (dev_desc->removable == 1)
 			dev_desc->type = perq;
-			return 1;
-		}
 		return 0;
 	}
 	pccb->pdata = (unsigned char *)cap;
-- 
2.7.4

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

* [U-Boot] [PATCH 1/1] usb: return 0 from usb_stor_get_info even if removable media
  2017-04-11  1:23 [U-Boot] [PATCH 1/1] usb: return 0 from usb_stor_get_info even if removable media Troy Kisky
@ 2017-04-14 14:00 ` Marek Vasut
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Vasut @ 2017-04-14 14:00 UTC (permalink / raw)
  To: u-boot

On 04/11/2017 03:23 AM, Troy Kisky wrote:
> This fixes a regression caused by
> 
> commit 07b2b78ce4bc8ae25e066c65245eaf58c0d9a67c
>     dm: usb: Convert USB storage to use driver-model for block devs
> 
> which caused part_init to be called when it was not previously.
> Without this patch, the following happens when a USB sd card reader is used.

Applied, thanks.

> => usb start
> starting USB...
> USB0:   Port not available.
> USB1:   USB EHCI 1.00
> scanning bus 1 for devices... 3 USB Device(s) found
>        scanning usb for storage devices... Device NOT ready
>    Request Sense returned 02 3A 00
>  ### ERROR ### Please RESET the board ###
> 
> This happens because dev_desc->blksz is 0.
> 
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> ---
>  common/usb_storage.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/common/usb_storage.c b/common/usb_storage.c
> index b524a15..83279c4 100644
> --- a/common/usb_storage.c
> +++ b/common/usb_storage.c
> @@ -1440,10 +1440,8 @@ int usb_stor_get_info(struct usb_device *dev, struct us_data *ss,
>  		       "   Request Sense returned %02X %02X %02X\n",
>  		       pccb->sense_buf[2], pccb->sense_buf[12],
>  		       pccb->sense_buf[13]);
> -		if (dev_desc->removable == 1) {
> +		if (dev_desc->removable == 1)
>  			dev_desc->type = perq;
> -			return 1;
> -		}
>  		return 0;
>  	}
>  	pccb->pdata = (unsigned char *)cap;
> 


-- 
Best regards,
Marek Vasut

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

end of thread, other threads:[~2017-04-14 14:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-11  1:23 [U-Boot] [PATCH 1/1] usb: return 0 from usb_stor_get_info even if removable media Troy Kisky
2017-04-14 14:00 ` 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.