mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Köry Maincent" <kory.maincent@bootlin.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: Jisheng Zhang <jszhang@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Lu jicong <jiconglu58@gmail.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH] usb: dwc3: don't reset device side if dwc3 was configured as host-only
Date: Tue, 21 Nov 2023 10:49:17 +0100	[thread overview]
Message-ID: <20231121104917.0fd67952@kmaincent-XPS-13-7390> (raw)
In-Reply-To: <20231117015527.jqoh6i3n4ywg7qui@synopsys.com>

Hello Thinh,

On Fri, 17 Nov 2023 01:55:30 +0000
Thinh Nguyen <Thinh.Nguyen@synopsys.com> wrote:

> > How many ports do you use? Can you try this:
> > 
> > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> > index 0328c86ef806..9921c2737829 100644
> > --- a/drivers/usb/dwc3/core.c
> > +++ b/drivers/usb/dwc3/core.c
> > @@ -296,23 +296,28 @@ int dwc3_core_soft_reset(struct dwc3 *dwc)
> >  	if (dwc->dr_mode == USB_DR_MODE_HOST) {
> >  		u32 usb3_port;
> >  		u32 usb2_port;
> > +		int i;
> >  
> > -		usb3_port = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0));
> > -		usb3_port |= DWC3_GUSB3PIPECTL_PHYSOFTRST;
> > -		dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), usb3_port);
> > +		for (i = 0; i < 16; i++) {
> > +			usb3_port = dwc3_readl(dwc->regs,
> > DWC3_GUSB3PIPECTL(i));
> > +			usb3_port |= DWC3_GUSB3PIPECTL_PHYSOFTRST;
> > +			dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(i),
> > usb3_port); 
> > -		usb2_port = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
> > -		usb2_port |= DWC3_GUSB2PHYCFG_PHYSOFTRST;
> > -		dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), usb2_port);
> > +			usb2_port = dwc3_readl(dwc->regs,
> > DWC3_GUSB2PHYCFG(i));
> > +			usb2_port |= DWC3_GUSB2PHYCFG_PHYSOFTRST;
> > +			dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(i),
> > usb2_port);
> > +		}
> >  
> >  		/* Small delay for phy reset assertion */
> >  		usleep_range(1000, 2000);
> >  
> > -		usb3_port &= ~DWC3_GUSB3PIPECTL_PHYSOFTRST;
> > -		dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), usb3_port);
> > +		for (i = 0; i < 16; i++) {
> > +			usb3_port &= ~DWC3_GUSB3PIPECTL_PHYSOFTRST;
> > +			dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(i),
> > usb3_port); 
> > -		usb2_port &= ~DWC3_GUSB2PHYCFG_PHYSOFTRST;
> > -		dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), usb2_port);
> > +			usb2_port &= ~DWC3_GUSB2PHYCFG_PHYSOFTRST;
> > +			dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(i),
> > usb2_port);
> > +		}
> >  
> >  		/* Wait for clock synchronization */
> >  		msleep(50);
> > --  

Still not working on my side.

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

  parent reply	other threads:[~2023-11-21  9:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-16 16:42 Köry Maincent
2023-11-16 16:59 ` Köry Maincent
2023-11-17  1:40   ` Thinh Nguyen
2023-11-17  1:55     ` Thinh Nguyen
2023-11-17  9:22       ` Köry Maincent
2023-11-21  9:49       ` Köry Maincent [this message]
2023-12-01  9:09         ` Köry Maincent
2023-12-02  0:26           ` Thinh Nguyen
2023-12-05  1:27             ` Thinh Nguyen
2023-12-05 13:56               ` Jisheng Zhang
2023-12-05 14:19             ` Köry Maincent
  -- strict thread matches above, loose matches on Subject: below --
2023-06-27 16:20 Jisheng Zhang
2023-06-30 22:23 ` Thinh Nguyen
2023-09-30  7:43 ` Lu jicong

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=20231121104917.0fd67952@kmaincent-XPS-13-7390 \
    --to=kory.maincent@bootlin.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jiconglu58@gmail.com \
    --cc=jszhang@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=thomas.petazzoni@bootlin.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

all inboxes | Powered by JetHome®