From: John Youn Date: Tue, 12 Jan 2016 00:32:28 +0000 (-0800) Subject: UPSTREAM: usb: dwc2: Fix probe problem on bcm2835 X-Git-Tag: firefly_0821_release~891 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d8d2fa872b6d91bb8817d896b475b3347a270d1c;p=firefly-linux-kernel-4.4.55.git UPSTREAM: usb: dwc2: Fix probe problem on bcm2835 Fixes an issue found on Raspberry PI platform that prevents probe. Don't skip setting the force mode if it's already set. Change-Id: I8fcef478dd4ad669cb3fc49d2308d126873213c7 Fixes: 09c96980dc72 ("usb: dwc2: Add functions to set and clear force mode") Tested-by: Heiko Stuebner Tested-by: Douglas Anderson Signed-off-by: John Youn Reported-by: Stefan Wahren Reported-by: Remi Pommarel Tested-by: Stefan Wahren Tested-by: Remi Pommarel Signed-off-by: Felipe Balbi Signed-off-by: Huang, Tao (cherry picked from commit 192cb07f7928e8cb09a9851e6c0f7478baa3bc6d) --- diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index 1489d315f287..e991d55914db 100644 --- a/drivers/usb/dwc2/core.c +++ b/drivers/usb/dwc2/core.c @@ -572,12 +572,6 @@ static bool dwc2_force_mode(struct dwc2_hsotg *hsotg, bool host) set = host ? GUSBCFG_FORCEHOSTMODE : GUSBCFG_FORCEDEVMODE; clear = host ? GUSBCFG_FORCEDEVMODE : GUSBCFG_FORCEHOSTMODE; - /* - * If the force mode bit is already set, don't set it. - */ - if ((gusbcfg & set) && !(gusbcfg & clear)) - return false; - gusbcfg &= ~clear; gusbcfg |= set; dwc2_writel(gusbcfg, hsotg->regs + GUSBCFG);