From: Felipe Balbi Date: Thu, 24 May 2012 07:27:56 +0000 (+0300) Subject: usb: dwc3: gadget: prevent DCTL register corruption X-Git-Tag: v3.6-rc1~101^2~24^2~34^2~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fcc023c726b5879d8f3f0f0f48c45d09055272c4;p=platform%2Fkernel%2Flinux-exynos.git usb: dwc3: gadget: prevent DCTL register corruption If we don't read out the contents of the register (in order to reinitialize 'reg' variable) we will be writing unknown contents to the DCTL register whenever we try to use dwc3_gadget_wakeup() function. Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 0404833..867c476 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1307,6 +1307,7 @@ static int dwc3_gadget_wakeup(struct usb_gadget *g) /* Recent versions do this automatically */ if (dwc->revision < DWC3_REVISION_194A) { /* write zeroes to Link Change Request */ + reg = dwc3_readl(dwc->regs, DWC3_DCTL); reg &= ~DWC3_DCTL_ULSTCHNGREQ_MASK; dwc3_writel(dwc->regs, DWC3_DCTL, reg); }