Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp271775imw; Fri, 15 Jul 2022 02:57:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ucGOZEzYrGPpLPSJs5guSyjk/sFVLpFh1adsuEKoejYzkMiyrpc5zBvB/YlAy3ifqu49tU X-Received: by 2002:a63:2051:0:b0:412:6d61:ab0a with SMTP id r17-20020a632051000000b004126d61ab0amr11881565pgm.52.1657879074315; Fri, 15 Jul 2022 02:57:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657879074; cv=none; d=google.com; s=arc-20160816; b=sfq20Xsv++qXKxNnm1Rj+94frSdheoNvXleTTt1RF/cSK0juaKvq5j+uw+HAzRf19S C+zwEbeMemNhARd6DIY0dmk37Z6kbf0LQguj2/1uTfg47toPEeA2wz8gVFEVCyyDtGZ1 aTNBJkvuKf461FTMVIpfO6RSKPcevhUarJCTJdiUF4WZ0r29olDgFjLzXXDhPth4YgAF STb/Syis9aE2XxKgwJ2CjqliN/UOsEf6N9k68wHpJwOKKktdV0f5o335YiRPugkj0LB4 aIFjgRez5qon1RQnNYSGFPiqJ6XtpSvWEOZunw6wc09+mOHYR/TcladYGbGSU6OyGyQZ KW1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=4byzoWCV/O/9HsdiJrcmQYBF5BskfwYzj99RRpymhk8=; b=cUCDd//6vMvYHsbGvOo9mIW6TlGf6o/cJBHVv9X+eJ2RI7Ky0phfDbioylBR4UJzg9 6+/9GTli+cB5lLAMhOK/rx3y2EairpPnkrG4PXxd+nku7EV/a/bnIIMf04LCVFBHGDER 1IENwPoVwYiPpFfB4wZCvJzhOzlORT6KrN4XACKFLhFUJqr4rWocEN0+wGpn5rUopmAG UwJIiJgiUFJhwuzuFG4MkVAORnWixNLcZxESG5IPQ8eSBWYn01oyHKXc7ud0YBJlotcD UNYdO6KGKwGWRrPVetnSHLfdtwSlT+WvBsRolIaUYOkeOQWT4h5HOwaIRl/w8xMoHUKY WgdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=PjH9t7lz; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pm15-20020a17090b3c4f00b001f033ddbb4dsi5037362pjb.65.2022.07.15.02.57.38; Fri, 15 Jul 2022 02:57:54 -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=@quicinc.com header.s=qcdkim header.b=PjH9t7lz; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231168AbiGOJlD (ORCPT + 99 others); Fri, 15 Jul 2022 05:41:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbiGOJlA (ORCPT ); Fri, 15 Jul 2022 05:41:00 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B25DF7FE5B; Fri, 15 Jul 2022 02:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1657878059; x=1689414059; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=4byzoWCV/O/9HsdiJrcmQYBF5BskfwYzj99RRpymhk8=; b=PjH9t7lzLY5y2IKnJDFI9LuWGI68X4mGx4iKKhJc9iN1ewUB9fOxYKr2 Xz/Jj1EmwCFZdNowbhqL13RKKSlGN3UpCwtW6fR4fDhC61bD7C4I7IdD2 iGHyuYiWidklpQUdrVq0Kye7GlMKpQBeD3P0B37TyhP9kPD1atLlLgzuo Y=; Received: from ironmsg07-lv.qualcomm.com ([10.47.202.151]) by alexa-out.qualcomm.com with ESMTP; 15 Jul 2022 02:40:59 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg07-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jul 2022 02:40:58 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 15 Jul 2022 02:40:58 -0700 Received: from hu-pkondeti-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 15 Jul 2022 02:40:55 -0700 Date: Fri, 15 Jul 2022 15:10:50 +0530 From: Pavan Kondeti To: Krishna Kurapati CC: Andy Gross , Bjorn Andersson , Felipe Balbi , "Greg Kroah-Hartman" , Philipp Zabel , , , Subject: Re: [PATCH] usb: dwc3: qcom: Defer dwc3-qcom probe if dwc3 isn't probed properly Message-ID: <20220715094050.GA24567@hu-pkondeti-hyd.qualcomm.com> References: <1657810516-31143-1-git-send-email-quic_kriskura@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1657810516-31143-1-git-send-email-quic_kriskura@quicinc.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 Thu, Jul 14, 2022 at 08:25:16PM +0530, Krishna Kurapati wrote: > On SC7180 devices, it is observed that dwc3 probing is deferred > because device_links_check_suppliers() finds that '88e3000.phy' > isn't ready yet. > > As a part of its probe call, dwc3-qcom driver checks if dwc3 core > is wakeup capable or not. If the dwc3 core is wakeup capable, driver > configures dwc-qcom's power domain to be always ON. Also it configures > dp/dm interrupts accordingly to support wakeup from system suspend. > > More info regarding the same can be found at: > commit d9be8d5c5b03 ("usb: dwc3: qcom: Keep power domain on to retain controller status" > commit 6895ea55c385 ("usb: dwc3: qcom: Configure wakeup interrupts during suspend") > > In the event, dwc3 probe gets deferred and is processed after dwc3-qcom > probe, driver ends up reading the wakeup capability of dwc3 core as false > leading to instability in suspend/resume path. > > To avoid this scenario, ensure dwc3_probe is successful by checking > if appropriate driver is assigned to it or not after the of_platform_populate > call. If it isn't then defer dwc3-qcom probe as well. > > Signed-off-by: Krishna Kurapati > --- > drivers/usb/dwc3/dwc3-qcom.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c > index 7703655..096d1414 100644 > --- a/drivers/usb/dwc3/dwc3-qcom.c > +++ b/drivers/usb/dwc3/dwc3-qcom.c > @@ -722,6 +722,9 @@ static int dwc3_qcom_of_register_core(struct platform_device *pdev) > dev_err(dev, "failed to get dwc3 platform device\n"); > } > > + if (!qcom->dwc3->dev.driver) > + return -EPROBE_DEFER; > + you need to drop the dwc3 node reference, so set ret = -EPROBE_DEFER here instead of returning. > node_put: > of_node_put(dwc3_np); > > -- > 2.7.4 > Thanks, Pavan