Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp793092iog; Mon, 13 Jun 2022 13:07:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tgWKxJPouE2rHPhAI1aFWEIdpQ4sorJ9zVIHLkpJ/4ZuRpkNfrs0BCg7HYRQSSX/M71tCb X-Received: by 2002:a17:90b:380b:b0:1e6:67f6:c5b4 with SMTP id mq11-20020a17090b380b00b001e667f6c5b4mr475235pjb.48.1655150841514; Mon, 13 Jun 2022 13:07:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655150841; cv=none; d=google.com; s=arc-20160816; b=Qy2TwverEgqP2TJ0s1XQtqdtd6GQU5z9b2RPzKeBz2vbDczmXFGX1LZhq8aQKQF8Na 73rW9Xqr44rpJ3GcHJI+nF8Wb8DcJnDh/l8SwXhvme0KzA6hsmceIKoBM1ucgYHXN0ZV 1RdLmUVkYsHrQ8xGBi1HgMa8oW8aJqX3U8lxV9ZfA+BrGNAZ6tmgLIXFqQERwm5sfaKq bN8fmmLV0PgqF87RkpRpE++XbJRiskC1U3UCDwgAfSK5q94ZLOPBr4nyNfcw/Bt9o27M VeQTWsKajSJvZVLkZ9w8UkaWBMUg03Yx6iOCglYkZ3MTmegeW/+qAbUzWCCrfHs2REo8 +8tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6RfOO19u1aifVisZByr6WMgdeJkVkBAonCLIE3lhww4=; b=tgrOd5wU2BhPxla+HNDD/bSuIOIB6VDi3ezga0CHrgQ0aJINpUlYTJcdWWrm9hmNgX GQEnKhPThcmwiwoh0q2oIUIXy7jjYTn9Bd6vkME4u8tE6AxoSI/CNQMCfk5paeXGuS/J YVZogjcBC3oxR7KY8rLrFxz4vRsahHcBkokeBPk16QnnyVABhvlaswm6KQwdcf6z1dQX JrHfUw1X2zMkUFDPyqx/xZTzM7UgdS7VgnS6Vy8/YqbFaXqN3cwdQA+ifOjgaTVyn2sd T7NRtnR6NVULVGc3OH/DLt9I9as+P2Z9A3qHyYXsqH8/PLDiyzBwM8+U5Rb5CCcg/2CH fskA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZayI3pus; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n5-20020a170902e54500b0015d0aa41a88si11245162plf.442.2022.06.13.13.07.08; Mon, 13 Jun 2022 13:07:21 -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=@chromium.org header.s=google header.b=ZayI3pus; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238217AbiFMTlg (ORCPT + 99 others); Mon, 13 Jun 2022 15:41:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235421AbiFMTlM (ORCPT ); Mon, 13 Jun 2022 15:41:12 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 439C776286 for ; Mon, 13 Jun 2022 11:08:35 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id x138so6402132pfc.12 for ; Mon, 13 Jun 2022 11:08:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=6RfOO19u1aifVisZByr6WMgdeJkVkBAonCLIE3lhww4=; b=ZayI3pusa6NPPyQZLxoG9kjQSrLh5RNRtXEreB7tn3HaMiEKs1Z81QJIKGnlBiOvT8 3ZLMkTlpiBnqjIIlh93/+g4p5UHN4QIWDyTopX3GH7Euacyu8/dnuI4KUls12eDKB465 pxLc45h7AyHIaDcwYjMRBCzav/15XOBFQDWOU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6RfOO19u1aifVisZByr6WMgdeJkVkBAonCLIE3lhww4=; b=2A/UNpupy8EqUv2nHH3Hytes0CfvnZr3YUiGYCYXmFdRv47lsUG+kKN8kKQRbvfQEk mLFzCDlVeRGZusctiLjqXW98fr0HLT3L1CoFTDxGNkC+R3JD4ETlelC28gzy/ny+P9uT YnMYnujA9XK0+rfm3bBmgi+J2AIlMNW83zz3S7rA+vjVlCvl2WIiMPmNmK6L3LDKFYFo EAWXwhcOGpjD3AtL2fnAE5KUxDaO38wI86iRPtV0i4O4v/jKw92IMXKbb8SOHKXCSBqi avK1uJxJj48XoZer8smJ/EWMurySyKMuHEWWKFoRB9sW+SIqC9QUV6rJeCZrzjXeaw9F skQg== X-Gm-Message-State: AOAM531EiQa2nKEqIa27JwGxyvbANPwokxRNrsGhlRSES1OWN3CTIZgV XguN8O733kIefDL/dzivHgmG8A== X-Received: by 2002:a05:6a00:1acd:b0:51c:795b:860c with SMTP id f13-20020a056a001acd00b0051c795b860cmr591557pfv.16.1655143714650; Mon, 13 Jun 2022 11:08:34 -0700 (PDT) Received: from localhost ([2620:15c:11a:202:c4fb:a1d8:47ef:f10c]) by smtp.gmail.com with UTF8SMTPSA id f12-20020aa782cc000000b0051bd9981cacsm5734717pfn.123.2022.06.13.11.08.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Jun 2022 11:08:34 -0700 (PDT) Date: Mon, 13 Jun 2022 11:08:32 -0700 From: Matthias Kaehlcke To: Krishna Kurapati Cc: Krzysztof Kozlowski , Rob Herring , Andy Gross , Bjorn Andersson , Greg Kroah-Hartman , Felipe Balbi , Stephen Boyd , Doug Anderson , Mathias Nyman , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, quic_pkondeti@quicinc.com, quic_ppratap@quicinc.com, quic_vpulyala@quicinc.com, Sandeep Maheswaram Subject: Re: [PATCH v20 2/5] usb: dwc3: core: Host wake up support from system suspend Message-ID: References: <1654158277-12921-1-git-send-email-quic_kriskura@quicinc.com> <1654158277-12921-3-git-send-email-quic_kriskura@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Mon, Jun 06, 2022 at 01:45:51PM -0700, Matthias Kaehlcke wrote: > On Thu, Jun 02, 2022 at 12:35:42PM -0700, Matthias Kaehlcke wrote: > > Hi Krishna, > > > > with this version I see xHCI errors on my SC7180 based system, like > > these: > > > > [ 65.352605] xhci-hcd xhci-hcd.13.auto: xHC error in resume, USBSTS 0x401, Reinit > > > > [ 101.307155] xhci-hcd xhci-hcd.13.auto: WARN: xHC CMD_RUN timeout > > > > After resume a downstream hub isn't enumerated again. > > > > So far I didn't see those with v13, but I aso saw the first error with > > v16. > > It also happens with v13, but only when a wakeup capable vUSB <= 2 > device is plugged in. Initially I used a wakeup capable USB3 to > Ethernet adapter to trigger the wakeup case, however older versions > of this series that use usb_wakeup_enabled_descendants() to check > for wakeup capable devices didn't actually check for vUSB > 2 > devices. > > So the case were the controller/PHYs is powered down works, but > the controller is unhappy when the runtime PM path is used during > system suspend. The issue isn't seen on all systems using dwc3-qcom and the problem starts during probe(). The expected probe sequence is something like this: dwc3_qcom_probe dwc3_qcom_of_register_core dwc3_probe if (device_can_wakeup(&qcom->dwc3->dev)) ... The important part is that device_can_wakeup() is called after dwc3_probe() has completed. That's what I see on a QC SC7280 system, where wakeup is generally working with these patches. However on a QC SC7180 system dwc3_probe() is deferred and only executed after dwc3_qcom_probe(). As a result the device_can_wakeup() call returns false. With that the controller/driver ends up in an unhappy state after system suspend. Probing is deferred on SC7180 because device_links_check_suppliers() finds that '88e3000.phy' isn't ready yet.