patch "usb: dwc3: ulpi: Use VStsDone to detect PHY regs access completion" added to usb-linus
Subsystems (3)
This is a note to let you know that I've just added the patch titled
usb: dwc3: ulpi: Use VStsDone to detect PHY regs access completion
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
From ce722da66d3e9384aa2de9d33d584ee154e5e157 Mon Sep 17 00:00:00 2001
From: Serge Semin <[email protected]>
Date: Thu, 10 Dec 2020 11:50:06 +0300
Subject: usb: dwc3: ulpi: Use VStsDone to detect PHY regs access completion
In accordance with [1] the DWC_usb3 core sets the GUSB2PHYACCn.VStsDone bit when the PHY vendor control access is done and clears it when the application initiates a new transaction. The doc doesn't say anything about the GUSB2PHYACCn.VStsBsy flag serving for the same purpose. Moreover we've discovered that the VStsBsy flag can be cleared before the VStsDone bit. So using the former as a signal of the PHY control registers completion might be dangerous. Let's have the VStsDone flag utilized instead then.
[1] Synopsys DesignWare Cores SuperSpeed USB 3.0 xHCI Host Controller
Databook, 2.70a, December 2013, p.388
--- drivers/usb/dwc3/core.h | 1 + drivers/usb/dwc3/ulpi.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/usb/dwc3/core.h +1 -0
@@ -285,6 +285,7 @@/* Global USB2 PHY Vendor Control Register */ #define DWC3_GUSB2PHYACC_NEWREGREQ BIT(25) +#define DWC3_GUSB2PHYACC_DONE BIT(24)#define DWC3_GUSB2PHYACC_BUSY BIT(23)#define DWC3_GUSB2PHYACC_WRITE BIT(22)#define DWC3_GUSB2PHYACC_ADDR (n) (n << 16)
drivers/usb/dwc3/ulpi.c +1 -1
@@ -24,7 +24,7 @@ static int dwc3_ulpi_busyloop(struct dwc3 *dwc)while (count--) { reg =dwc3_readl (dwc->regs,DWC3_GUSB2PHYACC (0 )); -if (!(reg &DWC3_GUSB2PHYACC_BUSY )) +if (reg &DWC3_GUSB2PHYACC_DONE )return 0 ;cpu_relax (); }
Signature · 1 line
2.29.2