[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#843448: update with both patches applied



Hi all

I've applied both patches

https://github.com/hardkernel/linux/commit/74b9605e5587b30912d6b6093e9d7fb06d043c33
https://github.com/hardkernel/linux/commit/2166ffd004e04a61887eb2a39f8639dc12140c58

I had to modify the second one to apply cleanly. the modification was
trivial as the patch removed 4 lines from  drivers/usb/host/xhci-plat.c
but those lines weren't present on Debian's kernel (and upstream)

The reboot issue is fixed, same as the USB3 issues we all had, the machine
has worked reliably for an hour now. I'll use it for more time and report
back.

I've attached the second patch. updated, for others to try. Vagrant, can you try this on your boards too?


--
IRC: gfa
GPG: 0X44BB1BA79F6C6333

Index: linux-4.9.25/drivers/usb/dwc3/core.c
===================================================================
--- linux-4.9.25.orig/drivers/usb/dwc3/core.c
+++ linux-4.9.25/drivers/usb/dwc3/core.c
@@ -1145,6 +1145,38 @@ err0:
 	return ret;
 }
 
+static void dwc3_shutdown(struct platform_device *pdev)
+{
+	struct dwc3	*dwc = platform_get_drvdata(pdev);
+	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+
+	pm_runtime_get_sync(&pdev->dev);
+	/*
+	 * restore res->start back to its original value so that, in case the
+	 * probe is deferred, we don't end up getting error in request the
+	 * memory region the next time probe is called.
+	 */
+	res->start -= DWC3_GLOBALS_REGS_START;
+
+	dwc3_debugfs_exit(dwc);
+	dwc3_core_exit_mode(dwc);
+	dwc3_event_buffers_cleanup(dwc);
+	dwc3_free_event_buffers(dwc);
+
+	usb_phy_set_suspend(dwc->usb2_phy, 1);
+	usb_phy_set_suspend(dwc->usb3_phy, 1);
+
+	phy_power_off(dwc->usb2_generic_phy);
+	phy_power_off(dwc->usb3_generic_phy);
+
+	dwc3_core_exit(dwc);
+	dwc3_ulpi_exit(dwc);
+
+	pm_runtime_put_sync(&pdev->dev);
+	pm_runtime_allow(&pdev->dev);
+	pm_runtime_disable(&pdev->dev);
+}
+
 static int dwc3_remove(struct platform_device *pdev)
 {
 	struct dwc3	*dwc = platform_get_drvdata(pdev);
@@ -1379,6 +1411,7 @@ MODULE_DEVICE_TABLE(acpi, dwc3_acpi_matc
 static struct platform_driver dwc3_driver = {
 	.probe		= dwc3_probe,
 	.remove		= dwc3_remove,
+	.shutdown	= dwc3_shutdown,
 	.driver		= {
 		.name	= "dwc3",
 		.of_match_table	= of_match_ptr(of_dwc3_match),

Attachment: signature.asc
Description: Digital Signature


Reply to: