Received: by 2002:ac0:c50a:0:0:0:0:0 with SMTP id y10csp1129338imi; Fri, 1 Jul 2022 03:49:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vYs8MDLPdCgmQpVGZA+N2F0Ak1A/V2n9AISCfETmdsM7TjHU9eFt2ORHYwaroRakOWhCoL X-Received: by 2002:a50:fc90:0:b0:435:6b30:f1b0 with SMTP id f16-20020a50fc90000000b004356b30f1b0mr17953514edq.423.1656672597659; Fri, 01 Jul 2022 03:49:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656672597; cv=none; d=google.com; s=arc-20160816; b=S6Ey5/eCPyl/LXjYBUP7coHv3PSoFD+xcw0K48BEGP7dWHJ+zypLFetGZ/BOF3oTV/ LJiBwzmvRO7GInWPMHDB0qERpqFBwN9vCNEEEqKLvlqd7CLpZxa5tTmKcYBUdkCOEuNZ lYhL2RMUO16RTl+6Peb4CIKHom2/kJSfHKFqscQKWvPentZw4awQjHQ+Eq0FrIoWDOyr UGuour9uijbyoss2+/kfNLALpwT1HsacuGUO0z60mavmY6Hh/fE7kCJhtoQGxIOMgDtf Mh6g7DWQm4zxrfHk7bMUKYcnfoLw5IdxOGmYQjQtJnJtaoPY5M9lT343IzmF0El+FNYo MbLw== 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=tjB+YWtXrkSRn425vyGQBHRy7XsCGQmbQOkFimaKvD8=; b=ZFTeBBMQOLf77GDe56oga5rQIDUwTr3VZW+Mm0vY6dsgpjCeHnIU4MKuNkzcyMWbeO n+/VVnXTRLxEpy4l+9+JnlHb2XD7OR/kPvUTCZHRV/QE8xK/ET4eZcxmNKafGJvdDysR E2iIJ2j7TwD8J7xy6M+RdYxjHoN10iW+b/qwOaHzQVTBlTOAzZ2SKapGvgj596SJDmAU OKFm8yRuIK+Dk4/7m/ORO6udAPDDwEuknC06Bscd8n6I3OzJlg330KkdoOJSyf+Qee72 JRDgsPQDTpyrg6C2RfsDs1d9we8KjOINKcdue89TyaK7JkMw7DCXnVkd7pllA8N5JkQX pFEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=mGlH6Ehl; 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 e12-20020a056402148c00b0042d83ceec4csi2028018edv.252.2022.07.01.03.49.33; Fri, 01 Jul 2022 03:49:57 -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=mGlH6Ehl; 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 S235336AbiGAKPn (ORCPT + 99 others); Fri, 1 Jul 2022 06:15:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231942AbiGAKPj (ORCPT ); Fri, 1 Jul 2022 06:15:39 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CA0C76942; Fri, 1 Jul 2022 03:15:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1656670538; x=1688206538; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=tjB+YWtXrkSRn425vyGQBHRy7XsCGQmbQOkFimaKvD8=; b=mGlH6Ehl4+p81Okw+KAPIJ8ISKWWOor6jcsuLgWeklkjkPq/S4mFaAR7 zW7HxKB5YTd2mklPt2aAyW01+GOomRDxHWRnR4att7T+0rqTCKiKFdkye kVFOylkjldrDHyuhz+A0ya4u0RQMaipMPq/cfv8811uBEo4P+PKztL7fK 8=; Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 01 Jul 2022 03:15:37 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2022 03:15:36 -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, 1 Jul 2022 03:15:36 -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, 1 Jul 2022 03:15:30 -0700 Date: Fri, 1 Jul 2022 15:45:26 +0530 From: Pavan Kondeti To: Matthias Kaehlcke CC: Krishna Kurapati PSSNV , Stephen Boyd , Pavan Kondeti , "Bjorn Andersson" , Felipe Balbi , Krzysztof Kozlowski , Rob Herring , Andy Gross , Greg Kroah-Hartman , Doug Anderson , "Mathias Nyman" , , , , , , , Subject: Re: [PATCH v20 2/5] usb: dwc3: core: Host wake up support from system suspend Message-ID: <20220701101526.GA30468@hu-pkondeti-hyd.qualcomm.com> References: <20220616091110.GA24114@hu-pkondeti-hyd.qualcomm.com> <20220620085415.GA13744@hu-pkondeti-hyd.qualcomm.com> <20220628053148.GA21797@hu-pkondeti-hyd.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: 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,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 Thu, Jun 30, 2022 at 06:10:50PM -0700, Matthias Kaehlcke wrote: > > > dwc3-qcom should wait for dwc3 core to call component_add() and then do > > > whatever needs to be done once the dwc3 core is registered in the > > > dwc3-qcom bind callback. Honestly this may all be a little overkill if > > > there's only two drivers here, dwc3-qcom and dwc3 core. It could > > > probably just be some callback from dwc3 core at the end of probe that > > > calls some function in dwc3-qcom. > > Since the issue we are facing is that the ssphy device links are not ready > > causing the dwc3 probe not being invoked, can we add an API as Pavan > > suggested > > to check if deferred_probe listfor dwc3 device is empty or not andbased on > > that we can choose to defer our qcomprobe ? In this case, we don't need to > > touch the dwc3 core driver and would be making changesonly in qcom glue > > driver. > > As mentioned above, it shouldn't be necessary to add component support to > all the glue drivers. An API to check for deferred probing is an option, > however there is a possible race condition: When the dwc3-qcom driver checks > for a deferred probe the core could still be probing, in that situation the > glue would proceed before the core driver is ready. That could be avoided > with the component based approach. The race can happen only if asynchronous probe is enabled, otherwise the child's probe happens synchronously in of_platform_populate() OTOH, would the below condition suffice for our needs here? if our device is not bounded to a driver, we check the state of initcalls and return either error or -EPROBE_DEFER diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index 7b6eff5..519a503 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 driver_deferred_probe_check_state(&qcom->dwc3->dev); + node_put: of_node_put(dwc3_np); Thanks, Pavan