Skip to contentSkip to conversation

usb: dwc2: Clear GUSBCFG.UsbTrdTim before setting

PATCH In review Pengcheng Li 2 participants 3 messages Sep 23, 2016 – Oct 22, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 usb: dwc2: Clear GUSBCFG.UsbTrdTim before setting

The USBTRDTIM field needs to be cleared before setting a new value. Otherwise it will result in an incorrect value if phyif == GUSBCFG_PHYIF8.

Change-Id Ib3e33cf4fd15ada41dc070ff7b93858daafbd10f
---
 drivers/usb/dwc2/gadget.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/dwc2/gadget.c +2 -2
index af46adf..9e52e4f 100644
@@ -2531,7 +2531,7 @@ void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg,
 	/* keep other bits untouched (so e.g. forced modes are not lost) */
 	usbcfg = dwc2_readl(hsotg->regs + GUSBCFG);
 	usbcfg &= ~(GUSBCFG_TOUTCAL_MASK | GUSBCFG_PHYIF16 | GUSBCFG_SRPCAP |
-		GUSBCFG_HNPCAP);
+		GUSBCFG_HNPCAP | GUSBCFG_USBTRDTIM_MASK);
 
 	/* set the PLL on, remove the HNP/SRP and set the PHY */
 	val = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5;
@@ -3413,7 +3413,7 @@ static void dwc2_hsotg_init(struct dwc2_hsotg *hsotg)
 	/* keep other bits untouched (so e.g. forced modes are not lost) */
 	usbcfg = dwc2_readl(hsotg->regs + GUSBCFG);
 	usbcfg &= ~(GUSBCFG_TOUTCAL_MASK | GUSBCFG_PHYIF16 | GUSBCFG_SRPCAP |
-		GUSBCFG_HNPCAP);
+		GUSBCFG_HNPCAP | GUSBCFG_USBTRDTIM_MASK);
 
 	/* set the PLL on, remove the HNP/SRP and set the PHY */
 	trdtim = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5;
Signature · 1 line
2.9.3
#1 lore raw

Hi,

Quoted 6 lines · Pengcheng Li

The USBTRDTIM field needs to be cleared before setting a new value. Otherwise it will result in an incorrect value if phyif == GUSBCFG_PHYIF8.

Change-Id Ib3e33cf4fd15ada41dc070ff7b93858daafbd10f

which commit are you fixing? Seems like you're missing a:

Fixes foobar ....

line here. Also, you need to remove Gerritisms from commit log ;-)

Signature · 1 line
balbi
#2 lore raw
Quoted 13 lines

-----Original Message-----
From: Felipe Balbi [mailto:[email protected]]
Sent: Monday, October 17, 2016 5:37 PM
To: Lipengcheng; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Xuejiancheng; Lidongpo; Caizhiyong; Lipengcheng
Subject: Re: [PATCH V2]usb: dwc2: Clear GUSBCFG.UsbTrdTim before setting

Hi,

Pengcheng Li <[email protected]> writes:

Quoted 9 lines
Quoted 6 lines

The USBTRDTIM field needs to be cleared before setting a new value. Otherwise it will result in an incorrect value if phyif == GUSBCFG_PHYIF8.

Change-Id Ib3e33cf4fd15ada41dc070ff7b93858daafbd10f

which commit are you fixing? Seems like you're missing a:

commit c45574ff02d1d1f35a6bf4b8ad051fc06c001fc7.

Quoted 4 lines
Fixes foobar ....

line here. Also, you need to remove Gerritisms from commit log ;-)

Ok, I will remove at the next patch.

Quoted 2 lines

--
Balbi

Best Regards
Pengcheng Li