linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Krishna Kurapati PSSNV <quic_kriskura@quicinc.com>
Cc: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Felipe Balbi <balbi@kernel.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] usb: dwc3: qcom: Defer dwc3-qcom probe if dwc3 isn't probed properly
Date: Thu, 14 Jul 2022 17:28:23 +0200	[thread overview]
Message-ID: <YtA2FwnL9GRUU35i@kroah.com> (raw)
In-Reply-To: <2938c8ff-ecc6-0a6e-6011-f83f3e3fbaa1@quicinc.com>

On Thu, Jul 14, 2022 at 08:39:31PM +0530, Krishna Kurapati PSSNV wrote:
> 
> On 7/14/2022 8:32 PM, Greg Kroah-Hartman wrote:
> > 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 <quic_kriskura@quicinc.com>
> > > ---
> > >   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;
> > > +
> > Why not limit this check to a device type like your changelog mentions?
> > 
> > thanks,
> > 
> > greg k-h
> Hi Greg,
> 
> I wanted to make it common to any device using this driver. Although on
> devices
> ike SC7280,this issue is not seen but the code would hold good. Do you see
> any
> concerns if we do it this way ?

How many different types of hardware did you test this change on and
what was the results?

thanks,

greg k-h

  reply	other threads:[~2022-07-14 15:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14 14:55 [PATCH] usb: dwc3: qcom: Defer dwc3-qcom probe if dwc3 isn't probed properly Krishna Kurapati
2022-07-14 15:01 ` Greg Kroah-Hartman
2022-07-14 15:03   ` Krishna Kurapati PSSNV
2022-07-14 15:02 ` Greg Kroah-Hartman
2022-07-14 15:09   ` Krishna Kurapati PSSNV
2022-07-14 15:28     ` Greg Kroah-Hartman [this message]
2022-07-14 15:43       ` Krishna Kurapati PSSNV
2022-07-14 15:53   ` Matthias Kaehlcke
     [not found]     ` <b491bb80-aef5-f90b-4763-68fa5435b6d9@quicinc.com>
2022-07-27  9:34       ` Greg Kroah-Hartman
     [not found]     ` <9f8551be-4848-1f68-fe55-2c6108fa2f67@quicinc.com>
2022-07-27  9:55       ` Greg Kroah-Hartman
2022-07-14 15:56 ` Matthias Kaehlcke
2022-07-15  9:40 ` Pavan Kondeti
  -- strict thread matches above, loose matches on Subject: below --
2022-07-14 14:31 Krishna Kurapati

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=YtA2FwnL9GRUU35i@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=agross@kernel.org \
    --cc=balbi@kernel.org \
    --cc=bjorn.andersson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).