All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] cmd: usb: check usb_stor_curr_dev in usb dev with no parameter
@ 2017-05-15  9:15 Patrick Delaunay
  2017-08-03 13:25 ` Patrick DELAUNAY
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick Delaunay @ 2017-05-15  9:15 UTC (permalink / raw)
  To: u-boot

If 'usb start' does not find devices, the command 'usb dev'
without parameter will lead to error= USB device -1: data abort
A check on usb_stor_curr_dev avoid the issue

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---

 cmd/usb.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cmd/usb.c b/cmd/usb.c
index 4fa456e..bc90553 100644
--- a/cmd/usb.c
+++ b/cmd/usb.c
@@ -803,6 +803,10 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 			printf("... is now current device\n");
 			return 0;
 		} else {
+			if (usb_stor_curr_dev < 0) {
+				printf("no current device selected\n");
+				return 1;
+			}
 			printf("\nUSB device %d: ", usb_stor_curr_dev);
 			stor_dev = blk_get_devnum_by_type(IF_TYPE_USB,
 							  usb_stor_curr_dev);
-- 
1.9.1

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

* [U-Boot] [PATCH] cmd: usb: check usb_stor_curr_dev in usb dev with no parameter
  2017-05-15  9:15 [U-Boot] [PATCH] cmd: usb: check usb_stor_curr_dev in usb dev with no parameter Patrick Delaunay
@ 2017-08-03 13:25 ` Patrick DELAUNAY
  2017-08-04 13:21   ` Marek Vasut
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick DELAUNAY @ 2017-08-03 13:25 UTC (permalink / raw)
  To: u-boot

Hi Marek,

Do think that this minor patch could be integrated in v2017.09 ?

http://patchwork.ozlabs.org/patch/762328/


Regards
Patrick

> -----Original Message-----
> From: Patrick DELAUNAY
> Sent: lundi 15 mai 2017 11:16
> To: u-boot at lists.denx.de
> Cc: Yann GAUTIER <yann.gautier@st.com>; Patrick DELAUNAY
> <patrick.delaunay@st.com>; Michal Simek <michal.simek@xilinx.com>;
> Simon Glass <sjg@chromium.org>; Peng Fan <van.freenix@gmail.com>;
> Hans de Goede <hdegoede@redhat.com>
> Subject: [PATCH] cmd: usb: check usb_stor_curr_dev in usb dev with no
> parameter
> Importance: High
> 
> If 'usb start' does not find devices, the command 'usb dev'
> without parameter will lead to error= USB device -1: data abort A check on
> usb_stor_curr_dev avoid the issue
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
> 
>  cmd/usb.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/cmd/usb.c b/cmd/usb.c
> index 4fa456e..bc90553 100644
> --- a/cmd/usb.c
> +++ b/cmd/usb.c
> @@ -803,6 +803,10 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc,
> char * const argv[])
>  			printf("... is now current device\n");
>  			return 0;
>  		} else {
> +			if (usb_stor_curr_dev < 0) {
> +				printf("no current device selected\n");
> +				return 1;
> +			}
>  			printf("\nUSB device %d: ", usb_stor_curr_dev);
>  			stor_dev = blk_get_devnum_by_type(IF_TYPE_USB,
>  							  usb_stor_curr_dev);
> --
> 1.9.1

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

* [U-Boot] [PATCH] cmd: usb: check usb_stor_curr_dev in usb dev with no parameter
  2017-08-03 13:25 ` Patrick DELAUNAY
@ 2017-08-04 13:21   ` Marek Vasut
  2017-09-12  8:22     ` Patrick DELAUNAY
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2017-08-04 13:21 UTC (permalink / raw)
  To: u-boot

On 08/03/2017 03:25 PM, Patrick DELAUNAY wrote:
> Hi Marek,

Hi,

please stop top-posting.

> Do think that this minor patch could be integrated in v2017.09 ?
> 
> http://patchwork.ozlabs.org/patch/762328/

Fix up the commit message, detail a bit more how to trigger the issue
and use errno.h return value (-ENODEV ?) in the new code . Send V2 and
I'll pick it.

> Regards
> Patrick
> 
>> -----Original Message-----
>> From: Patrick DELAUNAY
>> Sent: lundi 15 mai 2017 11:16
>> To: u-boot at lists.denx.de
>> Cc: Yann GAUTIER <yann.gautier@st.com>; Patrick DELAUNAY
>> <patrick.delaunay@st.com>; Michal Simek <michal.simek@xilinx.com>;
>> Simon Glass <sjg@chromium.org>; Peng Fan <van.freenix@gmail.com>;
>> Hans de Goede <hdegoede@redhat.com>
>> Subject: [PATCH] cmd: usb: check usb_stor_curr_dev in usb dev with no
>> parameter
>> Importance: High
>>
>> If 'usb start' does not find devices, the command 'usb dev'
>> without parameter will lead to error= USB device -1: data abort A check on
>> usb_stor_curr_dev avoid the issue
>>
>> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
>> ---
>>
>>  cmd/usb.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/cmd/usb.c b/cmd/usb.c
>> index 4fa456e..bc90553 100644
>> --- a/cmd/usb.c
>> +++ b/cmd/usb.c
>> @@ -803,6 +803,10 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc,
>> char * const argv[])
>>  			printf("... is now current device\n");
>>  			return 0;
>>  		} else {
>> +			if (usb_stor_curr_dev < 0) {
>> +				printf("no current device selected\n");
>> +				return 1;
>> +			}
>>  			printf("\nUSB device %d: ", usb_stor_curr_dev);
>>  			stor_dev = blk_get_devnum_by_type(IF_TYPE_USB,
>>  							  usb_stor_curr_dev);
>> --
>> 1.9.1
> 


-- 
Best regards,
Marek Vasut

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

* [U-Boot] [PATCH] cmd: usb: check usb_stor_curr_dev in usb dev with no parameter
  2017-08-04 13:21   ` Marek Vasut
@ 2017-09-12  8:22     ` Patrick DELAUNAY
  0 siblings, 0 replies; 4+ messages in thread
From: Patrick DELAUNAY @ 2017-09-12  8:22 UTC (permalink / raw)
  To: u-boot

Hi Marek,

> 
> On 08/03/2017 03:25 PM, Patrick DELAUNAY wrote:
> > Hi Marek,
> 
> Hi,
> 
> please stop top-posting.
> 

Sorry, bad habit


> > Do think that this minor patch could be integrated in v2017.09 ?
> >
> > http://patchwork.ozlabs.org/patch/762328/
> 
> Fix up the commit message, detail a bit more how to trigger the issue and use
> errno.h return value (-ENODEV ?) in the new code . Send V2 and I'll pick it.

Ok, I will send a V2 version today after a long delay due to holiday and other task.

For the result, I can't use errno.h because it is a command result, so I use CMD_RET_FAILURE is V2

> > Regards
> > Patrick
> >
> 
> --
> Best regards,
> Marek Vasut


Best regards
Patrick

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

end of thread, other threads:[~2017-09-12  8:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-15  9:15 [U-Boot] [PATCH] cmd: usb: check usb_stor_curr_dev in usb dev with no parameter Patrick Delaunay
2017-08-03 13:25 ` Patrick DELAUNAY
2017-08-04 13:21   ` Marek Vasut
2017-09-12  8:22     ` Patrick DELAUNAY

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.