Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp727937imw; Thu, 14 Jul 2022 09:44:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1svT1kXzjeZGi/C0GyfGU2KooGdnIzj5H35+KLclmtYl5HFcWrhTIDzK7MqTFYPM3Jgn4fk X-Received: by 2002:a17:90a:d50d:b0:1ef:9130:f96b with SMTP id t13-20020a17090ad50d00b001ef9130f96bmr16769331pju.235.1657817053702; Thu, 14 Jul 2022 09:44:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657817053; cv=none; d=google.com; s=arc-20160816; b=mcK1BhWh7aPKxXrINwndf45QPobw3ZGjo5zyRohBFm0mSqMv8vq/1djS7M7Qis4M+p LDbAKYD3Wqz02LXDWjdgPuApTXPROVWjPiNASTCcb4Ip+NcKqo2O7oSHhc7xfFMM07U5 ZIJVY4vDtlk+5GNIuPYZTWVklTrmXvxR8WDZhu0SZq9Xzfr/atW+efg8imJJdAjxx7f2 bJoM0rTYl8TBYeyRvRwogLw0y3Sp2VlqFV2cxiGbRjHVzWnC/xjsIrijlZ+/F4BP4tA9 HNqnDpa9laHEjGAoaoxVOclb0Tsq1Es5hmDd5z4Og0uiBshG99g3fuIH4tmyk8qu4Gmr U30g== 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=lLviYBi0EEVTEK9OZBXA1Mtdyl9BBuGrQsiJWIffSLo=; b=ghDjxqFRjwFiWrn7gcYn/berc+PWhm538DNjImdwQ0IJzIyM5J167474Ouc8DAdwDo o+WP+5T85+vPlx5D7SzXN8EKp/oMRofUXb0z3mkd9qIHB+wLQLsQI+AOoU7uFj1V2u6O 32PlnXUToCb+YnRtkDeJUanW+sB42TbY9oDw6hZM1rL6GL2YWsZtNV3A/K06giDGlrqG VQV8UXMuR0/BG0L1j+2kpfEbjImwwJFE6b4ydrCLLDULgklweweuP9qlOchZT2HKJTw4 gILP0K0k5Rjeud/paDbG+Kx2Phc4yNXmEwQUjrwrrgcrBi3CFgnt6KJvLUQMbwBBCC/6 ESWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=L3oAEpzX; 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 t16-20020a17090340d000b0016bda9d975esi2301829pld.555.2022.07.14.09.43.54; Thu, 14 Jul 2022 09:44:13 -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=L3oAEpzX; 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 S240227AbiGNP47 (ORCPT + 99 others); Thu, 14 Jul 2022 11:56:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239603AbiGNP46 (ORCPT ); Thu, 14 Jul 2022 11:56:58 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF9A65A2D8 for ; Thu, 14 Jul 2022 08:56:56 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id c3so1313918pfb.13 for ; Thu, 14 Jul 2022 08:56:56 -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=lLviYBi0EEVTEK9OZBXA1Mtdyl9BBuGrQsiJWIffSLo=; b=L3oAEpzX0IX2pH4VwwwjyTXoosibanseQN4CDqsjA6Bu4+C/xlawuV4emkuBaqsH0n n6BkBG4l0rDXU3BA2GEmNtU4B0c5mLs9hBJ1VZVjnydtMVITrjAUI2SH8RqtCzt4NnZd F9wGpE2vTbfRscRHmyyRN4/BoDOBIhu2kr5MA= 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=lLviYBi0EEVTEK9OZBXA1Mtdyl9BBuGrQsiJWIffSLo=; b=j399GJA4Sir+bnGOYSVpz6PeXP/31DMSeKifIQOsYT61EXNWt2M+QLFw/Uw6ihhiTo q6+/k9xtSvqPfCiCT6laCp2ZGqKUB+SVJRNsJWX8vPC3EV3LvVeZtu9+Pf6yVBVbGBed mBVJspwXyLGoNtkxadPsylKExMs1T1dFCBzZH3XdKSY7nTR3J22j7y9U7t73xZSob9NT os4qxikg5yewXYS4QyCAJk/7LRCrkf+l8LIPZAl1UPGOW9um/GhcmnAl0y/pThCHOe4K Oe4rqvgb4cHJyGgtc5nF24s7gXR/Va/M8rK4ziAe0dFM7FoFnuWJjyez0vDjoHDu5tRf I9mQ== X-Gm-Message-State: AJIora+AMWxeTu4CFBoa+Ain8iyIxmGmrO88b9BU1Cdi9p/idc81alvW pxn23BArwTfMzIEEyISsWrq5NQ== X-Received: by 2002:a05:6a00:1812:b0:52a:c171:7cc5 with SMTP id y18-20020a056a00181200b0052ac1717cc5mr9018198pfa.81.1657814216173; Thu, 14 Jul 2022 08:56:56 -0700 (PDT) Received: from localhost ([2620:15c:11a:202:f9cb:38e0:c8f1:abe1]) by smtp.gmail.com with UTF8SMTPSA id b3-20020a170902d50300b0016bedcced2fsm1719648plg.35.2022.07.14.08.56.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Jul 2022 08:56:55 -0700 (PDT) Date: Thu, 14 Jul 2022 08:56:54 -0700 From: Matthias Kaehlcke To: Krishna Kurapati Cc: Andy Gross , Bjorn Andersson , Felipe Balbi , Greg Kroah-Hartman , Philipp Zabel , linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: dwc3: qcom: Defer dwc3-qcom probe if dwc3 isn't probed properly Message-ID: References: <1657810516-31143-1-git-send-email-quic_kriskura@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1657810516-31143-1-git-send-email-quic_kriskura@quicinc.com> X-Spam-Status: No, score=-2.7 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=unavailable 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 Fixes: 649f5c842ba3 ("usb: dwc3: core: Host wake up support from system suspend") > --- > 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; change this to: ret = -EPROBE_DEFER; to put 'dwc3_np' > + > node_put: > of_node_put(dwc3_np); > > -- > 2.7.4 >