Received: by 10.223.176.5 with SMTP id f5csp331036wra; Sat, 27 Jan 2018 00:34:56 -0800 (PST) X-Google-Smtp-Source: AH8x225JvD4yHCp7W3AvKbYnSqCiCUQp6bp+TdtIxB4LN3m4I8YIWuAor7qGMWvXZ5/RdLj+KUsr X-Received: by 2002:a17:902:5309:: with SMTP id b9-v6mr7189168pli.152.1517042096327; Sat, 27 Jan 2018 00:34:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517042096; cv=none; d=google.com; s=arc-20160816; b=R8IKkE3nPKnyLA/IxAOSqOQztE3w9lt4Y+7bT9hPKJ70mb6vgxjbQerDFHbo+nfzHH Jc1GzKJIJ7/PD8eP9sak08kosuQk9+Lj+MhkAC5Q1Jla5COlAITMXK2ftNESbO7ohP3m gj4aF+E+Azqw0d8CtgEah89q5u0lku7m3F3LqrT4ov1AmA0vIjLzvNBXJx//2ClTFt9h h+ATTQVNuUCQwuuL10o6wa3mkL3KqFdniUTtLiglV+GNsRutg7goLwKfINQpR3y6s+cr tk/ZipBRNLJO5eQDAqKcVRl5Pw9j4QtonbN8TQPPUCVnFuql+A6ByHmLyGi3CjZpNM2B GcRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=jUtyKgutt7uAP9MiFio0RmUCcrdHARY3swng16e0Brk=; b=uPUEBuf8V942lexsaiPQQxrR2Dvy3mCbd30ff4jKB9b/zZXs/VRPUTYWn8NyuQrHAz 11ZQmCuj6Iq9Auy9MW8oRuVGGNU4lcrxHRL7OCESgQ5vueJvBtFV8MxEbnflhBLefdyG 4zEzPuMqaygkoczwjO+VzfqqOuPe8UoA8Twpp9FQW/XtppztBatBQyG9zIkrfLnqFs3a YfrQwyVLAeuoNnDVljuSzGc7A4O93vVvfv46dQ55KibpkXQxnp94RA/VbRZ09z+nQRp8 tf/4ertyW1VZYZ6s8vnVmdocaRLfuG4U18MStdbRsd3CvsxFlETcf+ZNc8we8HWbwSUR l91w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1si7803049pfa.58.2018.01.27.00.34.41; Sat, 27 Jan 2018 00:34:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752048AbeA0IeS (ORCPT + 99 others); Sat, 27 Jan 2018 03:34:18 -0500 Received: from mail.andi.de1.cc ([85.214.239.24]:41207 "EHLO h2641619.stratoserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751446AbeA0IeR (ORCPT ); Sat, 27 Jan 2018 03:34:17 -0500 Received: from p200300ccfbe7cf001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:cc:fbe7:cf00:1a3d:a2ff:febf:d33a] helo=localhost.localdomain) by h2641619.stratoserver.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1efLwD-0000aS-9Z; Sat, 27 Jan 2018 09:34:13 +0100 From: Andreas Kemnade To: b-liu@ti.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Tony Lindgren , Discussions about the Letux Kernel Cc: Andreas Kemnade Subject: [PATCH] usb: musb: fix enumeration after resume Date: Sat, 27 Jan 2018 09:34:03 +0100 Message-Id: <20180127083403.928-1-andreas@kemnade.info> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On dm3730 there are enumeration problems after resume. Investigation led to the cause that the MUSB_POWER_SOFTCONN bit is not set. If it was set before suspend (because it was enabled via musb_pullup()), it is set in musb_restore_context() so the pullup is enabled. But then musb_start() is called which overwrites MUSB_POWER and therefore disables MUSB_POWER_SOFTCONN, so no pullup is enabled and the device is not enumerated. So let's do a subset of what musb_start() does in the same way as musb_suspend() does it. Platform-specific stuff it still called as there might be some phy-related stuff which needs to be enabled. Also interrupts are enabled, as it was the original idea of calling musb_start() in musb_resume() according to Commit 6fc6f4b87cb3 ("usb: musb: Disable interrupts on suspend, enable them on resume") Signed-off-by: Andreas Kemnade --- drivers/usb/musb/musb_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index ea5013aa69e2..255424aae513 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -2709,7 +2709,8 @@ static int musb_resume(struct device *dev) if ((devctl & mask) != (musb->context.devctl & mask)) musb->port1_status = 0; - musb_start(musb); + musb_enable_interrupts(musb); + musb_platform_enable(musb); spin_lock_irqsave(&musb->lock, flags); error = musb_run_resume_work(musb); -- 2.11.0