Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4613108rwb; Tue, 8 Aug 2023 10:59:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFybaqMU6R3NsqxtoTuwfZhhuqhjNcY0VGa+XJl/hBMBkKoul1W1TDWBU3Z0/hzyW+Z1fYr X-Received: by 2002:a05:6a20:7490:b0:133:31a5:51e7 with SMTP id p16-20020a056a20749000b0013331a551e7mr12328602pzd.15.1691517553002; Tue, 08 Aug 2023 10:59:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691517552; cv=none; d=google.com; s=arc-20160816; b=mDblBQRFY+RFp5IfJoNKtxHJ35JZO6XbnOuHWfyDzfA852eolMR2Px0yInOoMu2ujK ju5i6cO8E9CooCfkRkMhEPAay27HU59GgadSRMMFYjt6UFSLKfQvawMbTxChGqoAsFMj eBrdrjjNlA72KIAtVegOUy1huoSGR/NpX/epp07NW76aBmpDhU3z1eCxhCe/uIA2BW4q GKpKoCz8Akvn5H3DFwpK/FL5lc2tvGYPieXMf8agjwPfRfCEcZH/2+FKJ3IVP41+m7hn m8FldrMdUvzcVsKTfpZARjvyBjWHoojD58qZyBicsORKYnwz4aIBRk7yjHqa9+vhkGhl NptA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=w2a2fi6fo8O2qphEYAkmBRgnh3Id5Qk5HANh3JTmLrk=; fh=xOPjlDLq9z4mk/ICd0VlOL3eLuhURpRmGlfT+TurLRk=; b=QwSy8ZOupzEUY5jlDteV21firTxYY2hhvBl98/m0OlSCGL5TVDbv9+MdvdcM1kSAl5 tO2AlPJ72OxNyaV8qhJ8KGgb90FvyQoeAVgqvwAB36oqMBCHBVvduKizGL5DWFKMH4a0 s32hCAUj13gU75EDrGmr8eAQuJzgX2LctYhGt6KBe/quxkL5n5qTC7H6kcF6XLz9Wd8N svZjQGaW3Jwq7xApuoEBcoGo98wXtteDxCaMpcLe/CAtC8Qh3dZyNd10au8rLHw1Yxgo 7278MqW2i3uZfpf5RTk1tMxUkCdZOxQm+qBmEE/azJxBF82o+nTgS/4MxeYXFVQleJr/ BWZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@libre.computer header.s=google header.b=Hv0EkMFw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020a632506000000b0055b4307963fsi7451352pgl.197.2023.08.08.10.58.59; Tue, 08 Aug 2023 10:59:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@libre.computer header.s=google header.b=Hv0EkMFw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229918AbjHHPm4 (ORCPT + 99 others); Tue, 8 Aug 2023 11:42:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229885AbjHHPlf (ORCPT ); Tue, 8 Aug 2023 11:41:35 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 590922108 for ; Mon, 7 Aug 2023 20:29:36 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4fe11652b64so8046419e87.0 for ; Mon, 07 Aug 2023 20:29:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libre.computer; s=google; t=1691465374; x=1692070174; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=w2a2fi6fo8O2qphEYAkmBRgnh3Id5Qk5HANh3JTmLrk=; b=Hv0EkMFwuoyzbj7wybAw2sah1r5PcEsI9FNN9nLIlvkNEpHSFHw4jcZKq/NkXGTw6z H42R1MPcMSc8IIbKlAyXG1c0yacNizA221RfmnShj84TS/hy3iWPjxmdPyQv7ZxU8TG7 hpT6Z4tY0EZoJoyg6WfiTFEaPLh6C+jhz6GHGqJVIafQ68XNayOBx0xe/m5BsTf3D1HI j/rN/NYIuWU98uIvWBgGI0u17/cRIekusBpWhj45eIhdqLWoop2D5lE7uBdJ1OaeFKnx SQMjWMbfBsMbDrTnG5IAIcQnZd+a+ujSMOvp0lA9QUDdDk24tLRY/H73PpTXxQW61bd9 Xujg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691465374; x=1692070174; 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=w2a2fi6fo8O2qphEYAkmBRgnh3Id5Qk5HANh3JTmLrk=; b=Qgq+86ExftfNr1gLnjLYgdiJhS4RZUQ+M8/N+yIZ2TnnFK27R1/ISpeYNqEip9hXGR sj3cbxPMPCDjzzNqfVQb3NGLaiQxoHGJUsm9msKF2tWBLx0oj9tPQp/PovJaEFjFMY9q zHG45NGiPjFLyAjpoN8I7miy9GCcJRVXwh+DGtcBp9Pemc9RJnCQb6oGmIWRPOcUaymB 2SB7y8SZIx/fu2/2xTEK62hp3ymot2VzISX5R/JLfRv320V8tlE45VqFka8NkgxUbmdq j4RIKko8Rp7Y6vqOGytxe44Eph0jr3KuiI+95d7/iaSTevz5IN6syL5GlBw2eVb/eFRu HSBg== X-Gm-Message-State: AOJu0YyW8j8nCcvlbgWITal97EO8sg5wfPGewK5kDzyD3rW+jnU0jWeS Irg8yR9McCKP/X3rLRWdEQjP5g== X-Received: by 2002:a05:6512:34c2:b0:4fd:fe8f:4108 with SMTP id w2-20020a05651234c200b004fdfe8f4108mr6732753lfr.62.1691465374338; Mon, 07 Aug 2023 20:29:34 -0700 (PDT) Received: from bear.local ([69.165.74.129]) by smtp.gmail.com with ESMTPSA id a3-20020a056512020300b004fcdd81355csm1715321lfo.269.2023.08.07.20.29.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 20:29:34 -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 Subject: [PATCH] usb: dwc3: meson-g12a: do post init to fix broken usb after resumption Date: Tue, 8 Aug 2023 03:25:10 +0000 Message-Id: <20230808032510.31754-1-luke.lu@libre.computer> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. Signed-off-by: Luke Lu --- 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