[U-Boot] [PATCH v2] cmd: usb: add check on usb_stor_curr_dev in usb dev command
Patrick DELAUNAY
patrick.delaunay at st.com
Tue Sep 12 09:32:08 UTC 2017
Hi Marek,
> Subject: [PATCH v2] cmd: usb: add check on usb_stor_curr_dev in usb dev command
>
> If the command 'usb start' is successfully executed but U-Boot don't found a
> storage device (usb_stor_curr_dev stay to -1) the next command 'usb dev'
> without parameter leads to data abort after the message "USB device -1"
>
> The added check on usb_stor_curr_dev avoid the issue.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
> ---
>
> Changes in v2:
> - Updated the commit message
> - use command_ret_t for result
After push V2 version today, I try to rebase my patch on latest version on v2017.09
But I have conflict with the patch wich introduce blk_common_cmd() usage.
So I check that the issue is still present with the same test on sandbox....
before to found a way to solve the merge conflict,
And in fact the issue is now solved without patch.
He confirmes it with code review for the 2 case in blk_print_device_num()
=> Loop in get_desc() for blk-uclass.c (-1 is no more used as index)
=> check devnum < 0 in get_desc() for blk_legacy.c
So I will abandon my patch....
Test done on sandbox :
Remove flash-stick for node usb at 1 in arch/sandbox/dts/sandbox.dts
$> make sandbox_defconfig
$> make
$> ./u-boot -d u-boot.dtb
U-Boot 2017.09-00001-gdbdb82c (Sep 12 2017 - 10:59:47 +0200)
Model: sandbox
DRAM: 128 MiB
MMC:
Using default environment
In: cros-ec-keyb
Out: vidconsole
Err: vidconsole
Model: sandbox
SCSI: Net: eth0: eth at 10002000, eth1: eth at 80000000, eth5: eth at 90000000
IDE: Bus 0: not available
=> usb start
starting USB...
USB0: scanning bus 0 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
=> usb dev
no usb devices available
=>
Best Regards, Patrick
More information about the U-Boot
mailing list