]> git.baikalelectronics.ru Git - kernel.git/commit
usb: dwc3: exynos: Fix deferred probing storm.
authorSteinar H. Gunderson <sesse@google.com>
Tue, 24 May 2016 18:13:15 +0000 (20:13 +0200)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 31 May 2016 08:12:42 +0000 (11:12 +0300)
commit8cefb9a7b3c00134b8157d10c156990c01142624
tree148e9f5f191f94b5d9bdada3dee52e63c85aef80
parent6c8d4ae6e1a2129f41bbfa4a457713e4e4ad1a36
usb: dwc3: exynos: Fix deferred probing storm.

dwc3-exynos has two problems during init if the regulators are slow
to come up (for instance if the I2C bus driver is not on the initramfs)
and return probe deferral. First, every time this happens, the driver
leaks the USB phys created; they need to be deallocated on error.

Second, since the phy devices are created before the regulators fail,
this means that there's a new device to re-trigger deferred probing,
which causes it to essentially go into a busy loop of re-probing the
device until the regulators come up.

Move the phy creation to after the regulators have succeeded, and also
fix cleanup on failure. On my ODROID XU4 system (with Debian's initramfs
which doesn't contain the I2C driver), this reduces the number of probe
attempts (for each of the two controllers) from more than 2000 to eight.

Signed-off-by: Steinar H. Gunderson <sesse@google.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Vivek Gautam <gautam.vivek@samsung.com>
Fixes: 09df5e62df62 ("usb: dwc3: exynos: add nop transceiver support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/dwc3-exynos.c