All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <mka@chromium.org>
To: Krishna Kurapati <quic_kriskura@quicinc.com>
Cc: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	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
Date: Wed, 27 Jul 2022 10:31:04 -0700	[thread overview]
Message-ID: <YuF2WLOx8iGiwvWO@google.com> (raw)
In-Reply-To: <YtHRFcol5uslEel1@google.com>

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 <quic_kriskura@quicinc.com>
> 
> Reported-by: Matthias Kaehlcke <mka@chromium.org>
> Tested-by: Matthias Kaehlcke <mka@chromium.org>
> Reviewed-by: Matthias Kaehlcke <mka@chromium.org>

(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

  parent reply	other threads:[~2022-07-27 18:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15 13:21 [PATCH v2] usb: dwc3: qcom: Defer dwc3-qcom probe if dwc3 isn't probed properly Krishna Kurapati
2022-07-15 20:41 ` Matthias Kaehlcke
2022-07-16  4:13   ` Krishna Kurapati PSSNV
2022-07-27 17:31   ` Matthias Kaehlcke [this message]
2022-08-02 16:10 ` Johan Hovold
2022-08-04  4:50   ` Krishna Kurapati PSSNV

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YuF2WLOx8iGiwvWO@google.com \
    --to=mka@chromium.org \
    --cc=agross@kernel.org \
    --cc=balbi@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=quic_kriskura@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.