UPSTREAM: usb: dwc3: Fix debugfs creation flow

Creation EP's debugfs called earlier than debugfs folder for dwc3
device created. As result EP's debugfs are created in '/sys/kernel/debug'
instead of '/sys/kernel/debug/usb/dwc3.1.auto'.

Moved dwc3_debugfs_init() function call before calling
dwc3_core_init_mode() to allow create dwc3 debugfs parent before
creating EP's debugfs's.

Fixes: 8d396bb0a5b6 ("usb: dwc3: debugfs: Add and remove endpoint dirs dynamically")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Link: https://lore.kernel.org/r/01fafb5b2d8335e98e6eadbac61fc796bdf3ec1a.1623948457.git.Minas.Harutyunyan@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 84524d1232ecca7cf8678e851b254f05cff4040a)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Iee342e3a25f29ef212414fcfc4d1dd340cc2d314
This commit is contained in:
Minas Harutyunyan
2021-06-17 09:55:24 -07:00
committed by Connor O'Brien
parent d42ca898a6
commit 2f34733fae

View File

@@ -1632,17 +1632,18 @@ static int dwc3_probe(struct platform_device *pdev)
} }
dwc3_check_params(dwc); dwc3_check_params(dwc);
dwc3_debugfs_init(dwc);
ret = dwc3_core_init_mode(dwc); ret = dwc3_core_init_mode(dwc);
if (ret) if (ret)
goto err5; goto err5;
dwc3_debugfs_init(dwc);
pm_runtime_put(dev); pm_runtime_put(dev);
return 0; return 0;
err5: err5:
dwc3_debugfs_exit(dwc);
dwc3_event_buffers_cleanup(dwc); dwc3_event_buffers_cleanup(dwc);
usb_phy_shutdown(dwc->usb2_phy); usb_phy_shutdown(dwc->usb2_phy);