Return-Path: Received: from comal.ext.ti.com ([198.47.26.152]:33692 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752418AbbFXRkP (ORCPT ); Wed, 24 Jun 2015 13:40:15 -0400 From: Felipe Balbi To: Linux USB Mailing List CC: Sekhar Nori , Felipe Balbi , Sebastian Andrzej Siewior , Subject: [PATCH] usb: musb: host: rely on port_mode to call musb_start() Date: Wed, 24 Jun 2015 12:40:01 -0500 Message-ID: <1435167601-1558-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Content-Type: text/plain Sender: stable-owner@vger.kernel.org List-ID: Currently, we're calling musb_start() twice for DRD ports in some situations. This has been observed to cause enumeration issues after suspend/resume cycles with AM335x. In order to fix the problem, we just have to fix the check on musb_has_gadget() so that it only returns true if current mode is Host and ignore the fact that we have or not a gadget driver loaded. Fixes: ae44df2e21b5 (usb: musb: call musb_start() only once in OTG mode) Cc: Sebastian Andrzej Siewior Cc: # v3.11+ Tested-by: Sekhar Nori Signed-off-by: Felipe Balbi --- drivers/usb/musb/musb_virthub.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c index 86c4b533e90b..4731baca377f 100644 --- a/drivers/usb/musb/musb_virthub.c +++ b/drivers/usb/musb/musb_virthub.c @@ -273,9 +273,7 @@ static int musb_has_gadget(struct musb *musb) #ifdef CONFIG_USB_MUSB_HOST return 1; #else - if (musb->port_mode == MUSB_PORT_MODE_HOST) - return 1; - return musb->g.dev.driver != NULL; + return musb->port_mode == MUSB_PORT_MODE_HOST; #endif } -- 2.4.4