u-boot-2016/drivers
Bin Meng d4efefe32e dm: usb: Fix broken usb_stop()
At present we only do device_remove() during usb stop. The DM API
device_remove() only marks the device state as inactivated, but
still keeps its USB topology (eg: parent, children, etc) in the DM
device structure. There is no issue if we only start USB subsystem
once and never stop it. But a big issue occurs when we do 'usb stop'
and 'usb start' multiple times.

Strange things may be observed with current implementation, like:
- the enumeration may report only 1 mass storage device is detected,
  but the total number of USB devices is correct.
- USB keyboard does not work anymore after a bunch of 'usb reset'
  even if 'usb tree' shows it is correctly identified.
- read/write flash drive via 'fatload usb' may complain "Bad device"

In fact, every time when USB host controller starts the enumeration
process, it takes random time for each USB port to show up online,
hence each USB device may appear in a different order from previous
enumeration, and gets assigned to a totally different USB address.
As a result, we end up using a stale USB topology in the DM device
structure which still reflects the previous enumeration result, and
it may create an exact same DM device name like generic_bus_0_dev_7
that is already in the DM device structure. And since the DM device
structure is there, there is no device_bind() call to bind driver to
the device during current enumeration process, eventually creating
an inconsistent software representation of the hardware topology, a
non-working USB subsystem.

The fix is to clear the unused USB topology in the usb_stop(), by
calling device_unbind() on each controller's root hub device, and
the unbinding will unbind all of its children automatically.

For Sandbox, we need scan the device tree each time when we start
the USB stack, in order to re-create the emulated USB devices and
bind drivers for them before we actually do the driver probe.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-10-01 16:32:51 +02:00
..
adc dm: adc: Convert uclass to livetree 2017-06-01 07:03:13 -06:00
ata dma: import linux/dma-direction.h to consolidate enum dma_data_direction 2017-09-12 18:02:23 -04:00
bios_emulator bios_emulator: Fix cast for 64-bit compilation 2016-10-11 11:55:33 +08:00
block blk: Remove various places that do flush cache after read 2017-09-15 08:05:10 -04:00
bootcount cosmetic: bootcount: correct comment for used scratch register 2017-09-12 17:58:54 -04:00
clk dm: clk: add clk driver support for stm32h7 SoCs 2017-09-22 07:40:01 -04:00
core dm: core: Add functions to get strings and the string count from a stringlist 2017-09-22 23:23:54 +09:00
cpu dm: core: Update device_bind_driver_to_node() to use ofnode 2017-06-01 07:03:08 -06:00
crypto crypto/fsl: fix obj-yy in Makefile 2017-09-04 09:02:07 -04:00
ddr armv8: ls1088a: Add NXP LS1088A SoC support 2017-09-11 08:00:13 -07:00
demo dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
dfu env: Rename getenv/_f() to env_get() 2017-08-16 08:30:24 -04:00
dma imx: reorganize IMX code as other SOCs 2017-07-12 10:17:44 +02:00
firmware dm: core: Rename of_device_is_compatible() 2017-06-01 07:03:06 -06:00
fpga fpga: xilinx: Avoid using local intermediate buffer 2017-08-02 09:11:52 +02:00
gpio rockchip: gpio: remove outdated/misleading comment 2017-09-18 20:40:35 +02:00
i2c rockchip: i2c: Convert to livetree 2017-09-18 20:40:35 +02:00
input env: Rename getenv/_f() to env_get() 2017-08-16 08:30:24 -04:00
led dm: core: Update device_bind_driver_to_node() to use ofnode 2017-06-01 07:03:08 -06:00
mailbox dm: mailbox: Update uclass to support livetree 2017-06-01 07:03:15 -06:00
memory memory: Move TI_AEMIF config to KCONFIG 2016-04-18 17:11:43 -04:00
misc dm: misc: add stm32 rcc driver 2017-09-22 07:40:02 -04:00
mmc Merge git://git.denx.de/u-boot-mmc 2017-09-25 17:28:16 -04:00
mtd Merge git://www.denx.de/git/u-boot-cfi-flash 2017-09-26 19:38:04 -04:00
net ARM: mvebu: Convert CONFIG_MVNETA to Kconfig 2017-09-26 06:51:30 +02:00
nvme nvme: Remove dead codes in nvme_setup_io_queues() 2017-09-03 15:30:34 -04:00
pch dm: Use dm_scan_fdt_dev() directly where possible 2016-07-27 14:15:54 -06:00
pci pci: layerscape: Fixup iommu-map for LS208xA 2017-09-22 12:42:29 -07:00
pcmcia Kconfig; Drop CONFIG_IDE_TI_CARDBUS and associated driver 2017-08-11 15:41:51 -04:00
phy usb: phy: Add STi USB2 PHY 2017-09-22 07:39:57 -04:00
pinctrl pinctrl: stm32: add stm32h743-pinctrl compatible 2017-09-22 07:40:00 -04:00
power regulator: pbias: Add PBIAS regulator for proper voltage switching on MMC1 2017-09-22 23:23:54 +09:00
pwm dm: tegra: pwm: Convert to livetree 2017-07-28 12:02:47 -06:00
qe blk: Remove various places that do flush cache after read 2017-09-15 08:05:10 -04:00
ram rockchip: rk3368: adjust DMC driver for 32/64bit-aware OF_PLATDATA 2017-09-18 20:40:38 +02:00
remoteproc dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
reset dm: reset: add stm32 reset driver 2017-09-22 07:40:01 -04:00
rtc env: Rename getenv/_f() to env_get() 2017-08-16 08:30:24 -04:00
scsi blk: dm: make blk_create_device() take a number of block instead of a size 2017-09-11 21:43:58 -06:00
serial serial: stm32x7: add STM32H7 support 2017-09-22 07:40:01 -04:00
soc Use correct spelling of "U-Boot" 2016-02-06 12:00:59 +01:00
sound dm: gpio: Add live tree support 2017-06-01 07:03:10 -06:00
spi spi: fsl_qspi: Copy 16 byte aligned data in TX FIFO 2017-09-25 15:45:15 +05:30
spmi dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
sysreset rockchip: enable rk322x sysreset driver 2017-09-18 20:40:32 +02:00
thermal thermal: imx: fix calculation 2017-05-18 11:23:31 +02:00
timer rockchip: timer: update for 32/64bit-aware OF_PLATDATA 2017-09-18 20:40:37 +02:00
tpm dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
usb dm: usb: Fix broken usb_stop() 2017-10-01 16:32:51 +02:00
video Merge branch 'next' of git://git.denx.de/u-boot-video 2017-09-21 07:51:20 -04:00
watchdog wdt: Update uclass to make clear that the timeout is in ms 2017-08-13 15:17:34 -04:00
Kconfig nvme: Add NVM Express driver support 2017-08-13 15:17:31 -04:00
Makefile Merge branch 'master' of git://git.denx.de/u-boot-rockchip 2017-08-14 10:40:01 -04:00