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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A70D5C0015E for ; Wed, 9 Aug 2023 21:33:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231824AbjHIVdh (ORCPT ); Wed, 9 Aug 2023 17:33:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229769AbjHIVdh (ORCPT ); Wed, 9 Aug 2023 17:33:37 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECB751BCF for ; Wed, 9 Aug 2023 14:33:35 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4fe8c3b5ca0so233458e87.1 for ; Wed, 09 Aug 2023 14:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libre.computer; s=google; t=1691616814; x=1692221614; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=nHhxE/dJDA6clbO9u01O1/s/eHxwxfI5ttey2qrEI7Y=; b=lOEq3UiLppEvzFQ+XytrfD/OLqlj+o2lGGJ2iLdVlf9NZ4HjVkiVf87RBQMqy//Xdj VOtjEkVw6I5hTl8fjCTdzz4Zr2W9AlHkxzp0OyYs5pukC1ePGvWhlT3An1SQhg63uie4 p23kTFFbUEzmr5al2aWfVctMdFlN9iqmJmyz8Ej2RJWxnjVhK8p9+fZiFOszWmKwFMXQ zuaDyExqGHbzAD87dN9VYVazNOfM53tOex/XTc9VJJ6FpWSmzsR+y2l+cOq0helpBptI FtIpytHR9FuhE1fCxdEXJ4i0lyJjhrTrnYs3qjOBTisR++lA3QbB9VOhT6/6S0A2j+XN IjtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691616814; x=1692221614; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nHhxE/dJDA6clbO9u01O1/s/eHxwxfI5ttey2qrEI7Y=; b=l+AIha8GPorM3Udlw25m8JxNAv+WpRpHdDz6zDUaS/sU2EAUq/FFVaBMLbuEjWGHlq sytb1YQ2H0w0XoauJQqrE8dGRz9ZJS74nYKqE4iBu1XCoGJHgkTkHuZU62tupPOZfoh9 ROk343qDjGPD8h+PvC3tK6QX9tzMeU29GuW+sm0gCJojeAW84QfCVP99oZvAGR5NqeR6 ixLJZm+nbJNt2mkWiH56IlMrdDFLp40/v9G6VCoiHIP8IW7LBSmnDymoPMowOaljQEK+ igZS0G9waDpE4aIr7dhwl7de4D5VylAJKfFu04QE0q9WRBk3kVhBSbqWCHniTZzH3DZ0 /csw== X-Gm-Message-State: AOJu0Yy8T/fN9IPCaBQR5SR/s7WR2xip9bClX1e2zRWH9gEMUH6yjcKf LEjrBklmQlicNFYIQrmBPK22iA== X-Google-Smtp-Source: AGHT+IFF1nfi6ptRW3iihGsy7dhGfDFYH+hxDzqxsKBwEmZmm7zQoFcXeraSGoiglsNibHtSGD+FVw== X-Received: by 2002:a05:6512:3baa:b0:4fb:8f81:4fe8 with SMTP id g42-20020a0565123baa00b004fb8f814fe8mr258735lfv.46.1691616813958; Wed, 09 Aug 2023 14:33:33 -0700 (PDT) Received: from bear.local ([69.165.74.129]) by smtp.gmail.com with ESMTPSA id q2-20020ac25282000000b004f864690901sm2450645lfm.244.2023.08.09.14.33.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Aug 2023 14:33:33 -0700 (PDT) From: Luke Lu To: Neil Armstrong , linux-usb@vger.kernel.org, linux-amlogic@lists.infradead.org Cc: Thinh Nguyen , Greg Kroah-Hartman , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Da Xue , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Luke Lu , stable@vger.kernel.org Subject: [PATCH v2] usb: dwc3: meson-g12a: do post init to fix broken usb after resumption Date: Wed, 9 Aug 2023 21:29:11 +0000 Message-Id: <20230809212911.18903-1-luke.lu@libre.computer> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Device connected to usb otg port of GXL-based boards can not be recognised after resumption, doesn't recover even if disconnect and reconnect the device. dmesg shows it disconnects during resumption. [ 41.492911] usb 1-2: USB disconnect, device number 3 [ 41.499346] usb 1-2: unregistering device [ 41.511939] usb 1-2: unregistering interface 1-2:1.0 Calling usb_post_init() will fix this issue, and it's tested and verified on libretech's aml-s905x-cc board. Cc: stable@vger.kernel.org # v5.8+ Fixes: c99993376f72 ("usb: dwc3: Add Amlogic G12A DWC3 glue") Signed-off-by: Luke Lu --- Note here, the commmit of Fixes tag is the first patch which bring suspend/resume function, so let's use it as the fix tag. As commit 5b0ba0caaf3a: (usb: dwc3: meson-g12a: refactor usb init)" introduced the use_post_init() function, and this patch will explicitly depend on it, so let's set kernel version higher or equal to v5.8. Changes since v1: - add Fixes tag and Cc stable tree --- drivers/usb/dwc3/dwc3-meson-g12a.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c index e99c7489dba0..2c07c038b584 100644 --- a/drivers/usb/dwc3/dwc3-meson-g12a.c +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c @@ -926,6 +926,12 @@ static int __maybe_unused dwc3_meson_g12a_resume(struct device *dev) return ret; } + if (priv->drvdata->usb_post_init) { + ret = priv->drvdata->usb_post_init(priv); + if (ret) + return ret; + } + return 0; } -- 2.40.1