Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp856778iog; Thu, 30 Jun 2022 11:27:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1srcmsCY4swRxvCjnAvGImX9s1HYhPNGXFioFBZm8af0eWuv6IMX8B/GfX7h+Q5v6qcdI3q X-Received: by 2002:a17:903:328e:b0:16b:8745:bb77 with SMTP id jh14-20020a170903328e00b0016b8745bb77mr16854312plb.70.1656613664929; Thu, 30 Jun 2022 11:27:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656613664; cv=none; d=google.com; s=arc-20160816; b=veCmTp9nnuzd+BeubQyBL+e9gOUwfwlLLMMS3j5rWRNkarg880na+BMByyZpcj8QYX aP55DztigXIOLHMcu9FHjXNhvEPPk13cZC4dY654O2vb8zY/KtgwlkFG7TJarMNUWz0/ LTfiRAwJNX54j15bxAstUuHYOvnEwFyHVCiqFrsjV8Hh9Znnm3WtfF/gIpDVWiY236Yt sk0cXm1bcZ1FP86k9wBZh+/rNcdCYRPx9sBvqHwJpDr9KKQ3crLKgyW4mwFSSVz5lGTS +UO98I1wbAPRSm17dDn4X2Q+ealgHGslhY8u/TwpGAxoLlj57zV9lXB8d8Sjr3LK87od DlVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=PEKZxYZlf0wcPMg3FnbHkkbDO5CYIxcaK6zhZdRvs6E=; b=r6qBqBSFQzYKewRjkOCqom0ZDqeLgk2lkf7lRdJQLtTBZ9oYpNaT1vk/Z3Q/sBJr4J /cxSiCauU/AknCeU/vO+d4lZyT+lrhdXpCr6YJlE8qZ5pYKB3ASKnNrQtf0hHNbSf1fd lNsagp4jpb0Eka6p9iBJEfaQPCr4QjKsF1gNKJuP8CrAQqT3r94nlNO41VnpWpD8N8cN tSXZMmxqvGV8m7Y5P9UwrkHBxmkBz2qZl0lC+HmZ0xOG1+Wwk1OGPNRG4otdEswQ6ezY ua67ePQn/COrqwq4Ono+w/GwS/UUhLXxndyJWU9W5qkF63XNt5AvX2ryeiAOT9VVlBVT HzUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=CVcEjdAD; 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 s11-20020a17090a880b00b001ecfcc0a97dsi3114009pjn.71.2022.06.30.11.27.33; Thu, 30 Jun 2022 11:27:44 -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=CVcEjdAD; 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 S236588AbiF3SNR (ORCPT + 99 others); Thu, 30 Jun 2022 14:13:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232771AbiF3SNP (ORCPT ); Thu, 30 Jun 2022 14:13:15 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9707810E0; Thu, 30 Jun 2022 11:13:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1656612794; x=1688148794; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=PEKZxYZlf0wcPMg3FnbHkkbDO5CYIxcaK6zhZdRvs6E=; b=CVcEjdAD/stI+71OPiaOFw3053D9mP5f9gO0aqBcMXKC330nm6L1gjwe 1MnAXeANF1MGjwhPhfUWJ6xFBktg+LwipR7q7Fc/AudYqOUAevrwesELO EOrUCgWBNgbRHbkI9pGspZhZebF47Qm4ufKMVZ04M2NPx57zM9sXTl+Sr s=; Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 30 Jun 2022 11:13:12 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 11:13:11 -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; Thu, 30 Jun 2022 11:13:11 -0700 Received: from [10.216.41.79] (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; Thu, 30 Jun 2022 11:13:05 -0700 Message-ID: Date: Thu, 30 Jun 2022 23:43:01 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v20 2/5] usb: dwc3: core: Host wake up support from system suspend Content-Language: en-US To: Stephen Boyd , Pavan Kondeti CC: Bjorn Andersson , Felipe Balbi , Matthias Kaehlcke , Krzysztof Kozlowski , Rob Herring , "Andy Gross" , Greg Kroah-Hartman , Doug Anderson , Mathias Nyman , , , , , , , References: <1654158277-12921-1-git-send-email-quic_kriskura@quicinc.com> <20220616091110.GA24114@hu-pkondeti-hyd.qualcomm.com> <20220620085415.GA13744@hu-pkondeti-hyd.qualcomm.com> <20220628053148.GA21797@hu-pkondeti-hyd.qualcomm.com> From: Krishna Kurapati PSSNV In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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,NICE_REPLY_A,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 6/30/2022 3:45 AM, Stephen Boyd wrote: > Quoting Pavan Kondeti (2022-06-27 22:31:48) >> On Mon, Jun 27, 2022 at 01:02:49PM -0700, Stephen Boyd wrote: >>> Quoting Pavan Kondeti (2022-06-20 01:54:15) >>>> Would like to hear other people thoughts on this. >>>> >>> I'm not following very closely but it sounds like a problem that may be >>> solved by using the component driver code (see >>> include/linux/component.h). That would let you move anything that needs >>> to be done once the child devices probe to the aggregate driver 'bind' >>> function (see struct component_master_ops::bind). >> Thanks Stephen for letting us know about the component device framework. >> >> IIUC, >> >> - dwc3-qcom (parent of the dwc3 core) registers as a component master by >> calling component_master_add_with_match() before calling >> of_platform_populate(). The match callback could be as simple as comparing >> the device against our child device. >> >> - The dwc3 core (child) at the end of its probe can add as a component by calling >> component_add(). >> >> - The above triggers the component_master_ops::bind callback implemented in >> dwc3-qcom driver which signals that we are good to go. >> >> - The dwc-qcom can call component_bind_all() to finish the formality i.e >> telling the dwc3 core that we are good to go. >> >> Is my understanding correct? This is what we are looking for i.e a way for >> the child device(s) to signal the parent when the former is bounded. > Sounds about right to me. > >> Also what happens when the child device probe fails for any reason. i.e >> component_add() would never be called so the master driver i.e dwc3-qcom would >> wait indefinitely. May be it needs to implement a timeout or runtime suspend >> etc should take care of keeping the resoures in suspend state. > When the child fails probe, it should return -EPROBE_DEFER if probe > needs to be deferred. Then the driver will attempt probe at a later > time. If probe fails without defer then it will never work and dwc3-qcom > will wait indefinitely. Not much we can do in that situation. Hi Stephen,   Thanks for the idea. But doesn't adding dwc3 as a component to an agg driver meanthat this change needs to be done on all glue drivers, as component_bind_all( ) from master componentis supposed to let the dwc3 core know that we are good to go ? > 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.