From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18596C433E1 for ; Tue, 23 Jun 2020 21:33:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA99E2078A for ; Tue, 23 Jun 2020 21:33:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592947988; bh=IkigOz1Hb1Q6Z2AtgnD62DTq1A2IIBRiT/4AIBhfr8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=bkGk/o7puxK4p51Mil2GvofXSgccHTjKnn+KjIZlN3qbgG69yAFsWU2DVciNxCwsK 7gRcUUwtzEc7fM0DcR5AgfYnTWBP3TX1M863NvjuYGLdvIoNEtQvMicKQ0i+PIIa51 ad/YwaVhfjcjzPPyeFinw80RZz740PQDaEsJq9wo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389802AbgFWVdB (ORCPT ); Tue, 23 Jun 2020 17:33:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:53160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388117AbgFWULn (ORCPT ); Tue, 23 Jun 2020 16:11:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6C2F2206C3; Tue, 23 Jun 2020 20:11:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592943102; bh=IkigOz1Hb1Q6Z2AtgnD62DTq1A2IIBRiT/4AIBhfr8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=scUcYO+Frn4F7ggjJhEfiq+KK7k6hZxUoCcPA+D7tfgqHVXistj3mV4IFNarz4Y5x Ss1iICHnbft/NHBBfyn4ar6VvXnMgakFEuzVd+4ldnUd1u2Ccn7MANCuIVMByFmXZ5 UfLht209hVJgpL4kLMLlBx8IMNwnx1gMvWzKHBe8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Minas Harutyunyan , Fabrice Gasnier , Felipe Balbi , Sasha Levin Subject: [PATCH 5.7 260/477] usb: dwc2: gadget: move gadget resume after the core is in L0 state Date: Tue, 23 Jun 2020 21:54:17 +0200 Message-Id: <20200623195419.856775411@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195407.572062007@linuxfoundation.org> References: <20200623195407.572062007@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Fabrice Gasnier [ Upstream commit 8c935deacebb8fac8f41378701eb79d12f3c2e2d ] When the remote wakeup interrupt is triggered, lx_state is resumed from L2 to L0 state. But when the gadget resume is called, lx_state is still L2. This prevents the resume callback to queue any request. Any attempt to queue a request from resume callback will result in: - "submit request only in active state" debug message to be issued - dwc2_hsotg_ep_queue() returns -EAGAIN Call the gadget resume routine after the core is in L0 state. Fixes: f81f46e1f530 ("usb: dwc2: implement hibernation during bus suspend/resume") Acked-by: Minas Harutyunyan Signed-off-by: Fabrice Gasnier Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin --- drivers/usb/dwc2/core_intr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2/core_intr.c index 876ff31261d56..55f1d14fc4148 100644 --- a/drivers/usb/dwc2/core_intr.c +++ b/drivers/usb/dwc2/core_intr.c @@ -416,10 +416,13 @@ static void dwc2_handle_wakeup_detected_intr(struct dwc2_hsotg *hsotg) if (ret && (ret != -ENOTSUPP)) dev_err(hsotg->dev, "exit power_down failed\n"); + /* Change to L0 state */ + hsotg->lx_state = DWC2_L0; call_gadget(hsotg, resume); + } else { + /* Change to L0 state */ + hsotg->lx_state = DWC2_L0; } - /* Change to L0 state */ - hsotg->lx_state = DWC2_L0; } else { if (hsotg->params.power_down) return; -- 2.25.1