]> git.baikalelectronics.ru Git - uboot.git/commit
usb: xhci-pci: Move reset logic out of XHCI core
authorSamuel Holland <samuel@sholland.org>
Mon, 5 Jul 2021 12:29:02 +0000 (13:29 +0100)
committerMarek Vasut <marex@denx.de>
Wed, 22 Sep 2021 19:29:56 +0000 (21:29 +0200)
commit6e8dfc88214d11e0a6e5d232e4b7a407fe9dd37b
tree58c96a0df7f0e107faaf04c68c9ac84fe981d1ec
parent898f95407b84579846e301d1c48fdc42790b3d08
usb: xhci-pci: Move reset logic out of XHCI core

Resetting an XHCI controller inside xhci_register undoes any register
setup performed by the platform driver. And at least on the Allwinner
H6, resetting the XHCI controller also resets the PHY, which prevents
the controller from working. That means the controller must be taken out
of reset before initializing the PHY, which must be done before calling
xhci_register.

The logic in the XHCI core was added to support the Raspberry Pi 4
(although this was not mentioned in the commit log!), which uses the
xhci-pci platform driver. Move the reset logic to the platform driver,
where it belongs, and where it cannot interfere with other platform
drivers.

This also fixes a failure to call reset_free if xhci_register failed.

Fixes: b6f9fe1c71b6 ("usb: xhci: Add reset controller support")
Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
drivers/usb/host/xhci-mem.c
drivers/usb/host/xhci-pci.c
drivers/usb/host/xhci.c
include/usb/xhci.h