Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp488635imn; Wed, 27 Jul 2022 11:36:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vz0KRX8v4jwQ8j3aeUf3Z+E/o+05lEttIa1M7EHs7OTQopavHD5/tJQJ/7+UPAnoCVcVTW X-Received: by 2002:a17:90a:4402:b0:1f2:3507:5f96 with SMTP id s2-20020a17090a440200b001f235075f96mr5940799pjg.22.1658946980129; Wed, 27 Jul 2022 11:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658946980; cv=none; d=google.com; s=arc-20160816; b=lj247Fj9c+mWQoJvVpWcXa/7/VflR5kQJYdkquUEqAZLxNCnVcvpQPM6PdmnUHgTx8 5rilVBDT1ExOOGJB6iNul8cZZBs72JoNbc3HSPnZd0MTAVvtUyfpsFXUzX3+Vv/jgk1m sGpIY0zS4r5A4KGiiXomSXmT6O7qSHxWSonnK8P4YHWh8R0MzL3EruryjMNZ081y1mml 0/Z0oecbfpIT+YfznCCT2q1MSdfqV5ZP39xHNcmz8svEqsw8r7AVZzhO/pfEP4roF7ea 023ZJiHpWdWFidxgSLEEf+nql8/i9FPCYPsD6Ies8JXMD+wwmsfXycOMcjQhYROP4rfZ 0fhw== 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=LmCBfs2WW3NfL4Q2WAECQ3SJcL3MvIgv0G1LKqCA5+s=; b=gHVYTU9ZzAJAm0FOzKrXdcg4ykZJjXCWj+rBsskRPFzNie8RRZiwsBtiRsrnqX3hIE c6o9GaDUYHxu7w6FqlEWPZaz3DEZ5IufMCMyAu8xWDqNZG2LKzdDyG3L3cMVYk+R+rQc xEtfTXZLoVnBH0iOLM1sPXxVVfgPnGbLwkIS0uKtt41jinlYFNh2z/He3ze7YJkhRQfY b306C23kQNxq9MhTDvhQ1LYm/zAS18vKzdH7lHmmDK/XpsPNLM2dAD6gL3VVr9XYwHek iHGLbKH5u2moS7cXGfmqysA5ZkQTbAF7KmnhykEpoxHRsA9FK44gXnBF6yWx9YEcQugu cvpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=luD3Yki0; 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 23-20020a631857000000b00412b0de505csi4786733pgy.29.2022.07.27.11.36.03; Wed, 27 Jul 2022 11:36:20 -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=luD3Yki0; 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 S235240AbiG0Sd2 (ORCPT + 99 others); Wed, 27 Jul 2022 14:33:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235727AbiG0SdJ (ORCPT ); Wed, 27 Jul 2022 14:33:09 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CFE994652 for ; Wed, 27 Jul 2022 10:31:09 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id e1so6408582pjl.1 for ; Wed, 27 Jul 2022 10:31:09 -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=LmCBfs2WW3NfL4Q2WAECQ3SJcL3MvIgv0G1LKqCA5+s=; b=luD3Yki0EVhKjTfuukT9qc77ZjHYo27BbgwSsT+U1g9rxEwphDlqqmXs62NaigLL0l CBc7BJ3b7nd9qn1Sm8nKdgjnEjkM4NBc6YvblNcJ+2iIcydBSLfN4wfB6DlxNaCfovpP z7XxvoxOQfJNGNrJ6P5rv7WTu8ghKariGrFss= 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=LmCBfs2WW3NfL4Q2WAECQ3SJcL3MvIgv0G1LKqCA5+s=; b=PUG0NPNjLhcCs/SYqvMagTlfDTZ9smUgdyEY6UD+xbdcj4aLjpTP9b3+X/8z66WVyk gjDOqhfizfd5qGcejdAyyxI9ZDxmOq21J0FRPU7eFIusf5Wz5Q17IIc15hxggfCLgeH3 M7X907oXa7XsQ8moUetfIj5A9uCT6XM4pdCew8akwg0NF0ifcglF7qgVA6ppE4LNyFny vP9KdvkE0TtflSXb9FOUAshVlDfGoZ0j5ECSOaHlX+AVeuQCxb5SucX4l3WV9+DJzsfY H0fjhWhIxrvjIzU1Tu8BY0shtUq7Gw0ItrKWlqNQksH22Lnj8hNSLKV4J7BQDqZdqK/r MtQw== X-Gm-Message-State: AJIora862HjGDRE7T46gK+1bS/TcnLIKf0MJQFnyBWSYxLvSj+GBMjzH JiGboT2Z4ZMx4tOFCOxjfxkPpQ== X-Received: by 2002:a17:902:d651:b0:16b:f55e:c626 with SMTP id y17-20020a170902d65100b0016bf55ec626mr22746641plh.78.1658943066729; Wed, 27 Jul 2022 10:31:06 -0700 (PDT) Received: from localhost ([2620:15c:11a:202:472c:7351:bacf:5228]) by smtp.gmail.com with UTF8SMTPSA id mj1-20020a17090b368100b001f310564e8bsm1456767pjb.30.2022.07.27.10.31.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Jul 2022 10:31:06 -0700 (PDT) Date: Wed, 27 Jul 2022 10:31:04 -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 v2] usb: dwc3: qcom: Defer dwc3-qcom probe if dwc3 isn't probed properly Message-ID: References: <1657891312-21748-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: 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 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 Fri, Jul 15, 2022 at 01:41:57PM -0700, Matthias Kaehlcke wrote: > On Fri, Jul 15, 2022 at 06:51:52PM +0530, Krishna Kurapati wrote: > > > Subject: usb: dwc3: qcom: Defer dwc3-qcom probe if dwc3 isn't probed properly > > nit: "isn't probed properly" sounds like a bug or HW issue. In case > you re-spin maybe change it to "hasn't probed yet" or similar. > > > 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. > > > > Fixes: 649f5c842ba3 ("usb: dwc3: core: Host wake up support from system suspend") > > Signed-off-by: Krishna Kurapati > > Reported-by: Matthias Kaehlcke > Tested-by: Matthias Kaehlcke > Reviewed-by: Matthias Kaehlcke (attempt to 'summarize' and move the discussion from v1 [1] to here) gregkh> Why not limit this check to a device type like your changelog mentions? mka> It is not an sc7180 specific issue. It can occur on any platform where the mka> dwc3 core has supplies that aren't ready when the dwc3-qcom driver probes. mka> mka> It won't blow up right away since it requires 'wakeup-source' to be set for mka> the dwc3 core, which currently is only the case for 'usb@a600000' of the mka> sc7280 AFAIK (I set it for sc7180 in my tree for testing, which is when I mka> found the issue this patch intends to address). krishna> As Mathias pointed out, no issue was seen so far on present QC targets krishna> as wakeup-source property was added recently and only for SC7180 and krishna> SC7280. We ran into some issues like wakeup from system suspend in krishna> host mode wasn't happening although we enabled wakeup-source in SC7180 krishna> that eventually led us to this bug. But, we tried to add debug prints krishna> to follow the code flow and see that the issue is present on SM8350 krishna> as well : "supplier 88e9000.phy-wrapper not ready" and deferring dwc3 krishna> probe. This doesn't seem to be specific to SC7180. krishna> krishna> Since this is seen on multiple platforms, can we go ahead without krishna> having any platforms specific checks in the code as in V2 version ? [1] https://lore.kernel.org/all/YtAv1U1VYkhIY1GA@kroah.com/t/#m6714bf1f2309cfe8be92e6c270ef2a99a9b09ac6