usb: dwc2: Postponed gadget registration to the udc class driver
authorMinas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Tue, 9 Jun 2020 08:28:11 +0000 (12:28 +0400)
committerSasha Levin <sashal@kernel.org>
Tue, 30 Jun 2020 19:38:40 +0000 (15:38 -0400)
commitaedf21cf521c28e5a04500045e230f5bdc0a7677
treea153a9fa8a779cfb54a4a3a633247e36faf44ff5
parentb680168bd6d720deaa3c790951601c8574a025e5
usb: dwc2: Postponed gadget registration to the udc class driver

commit 207324a321a866401b098cadf19e4a2dd6584622 upstream.

During dwc2 driver probe, after gadget registration to the udc class
driver, if exist any builtin function driver it immediately bound to
dwc2 and after init host side (dwc2_hcd_init()) stucked in host mode.
Patch postpone gadget registration after host side initialization done.

Fixes: 117777b2c3bb9 ("usb: dwc2: Move gadget probe function into platform code")
Reported-by: kbuild test robot <lkp@intel.com>
Tested-by: Marek Vasut <marex@denx.de>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
Link: https://lore.kernel.org/r/f21cb38fecc72a230b86155d94c7e60c9cb66f58.1591690938.git.hminas@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc2/gadget.c
drivers/usb/dwc2/platform.c