Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1437836 > unrolled thread

Re: [RESEND PATCH] usb: dwc2: Add reset control to dwc2

Started byPhilipp Zabel <p.zabel@pengutronix.de>
First post2016-07-06 18:30 +0200
Last post2016-07-07 20:00 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RESEND PATCH] usb: dwc2: Add reset control to dwc2 Philipp Zabel <p.zabel@pengutronix.de> - 2016-07-06 18:30 +0200
    Re: [RESEND PATCH] usb: dwc2: Add reset control to dwc2 John Youn <John.Youn@synopsys.com> - 2016-07-06 19:50 +0200
      Re: [RESEND PATCH] usb: dwc2: Add reset control to dwc2 Philipp Zabel <p.zabel@pengutronix.de> - 2016-07-07 11:20 +0200
        Re: [RESEND PATCH] usb: dwc2: Add reset control to dwc2 John Youn <John.Youn@synopsys.com> - 2016-07-07 20:00 +0200

#1437836 — Re: [RESEND PATCH] usb: dwc2: Add reset control to dwc2

FromPhilipp Zabel <p.zabel@pengutronix.de>
Date2016-07-06 18:30 +0200
SubjectRe: [RESEND PATCH] usb: dwc2: Add reset control to dwc2
Message-ID<rRXS1-32X-25@gated-at.bofh.it>
Hi Dinh,

Am Dienstag, den 21.06.2016, 14:12 -0500 schrieb
dinguyen@opensource.altera.com:
> From: Dinh Nguyen <dinguyen@opensource.altera.com>
> 
> Allow for platforms that have a reset controller driver in place to bring
> the USB IP out of reset.
> 
> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
> Acked-by: John Youn <johnyoun@synopsys.com>
> Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
> Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>

This is an USB patch. Doesn't John collect patches and send pull
requests? Then you should put Greg Kroah-Hartman and
linux-usb@vger.kernel.org into Cc:. Things get easily lost on
linux-kernel.

regards
Philipp

> ---
> v7: Use devm_reset_control_get_optional()
> v6: fix 80 line checkpatch warning in dev_err print
> v5: updated error conditions for not finding the reset property
> v4: use dev_dbg() if not a -EPROBE_DEFER
> v3: fix compile error
> v2: move to lowlevel_hw_init()
> ---
>  drivers/usb/dwc2/core.h     |    1 +
>  drivers/usb/dwc2/platform.c |   22 ++++++++++++++++++++++
>  2 files changed, 23 insertions(+)
> 
> diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
> index 3c58d63..f748132 100644
> --- a/drivers/usb/dwc2/core.h
> +++ b/drivers/usb/dwc2/core.h
> @@ -837,6 +837,7 @@ struct dwc2_hsotg {
>  	void *priv;
>  	int     irq;
>  	struct clk *clk;
> +	struct reset_control *reset;
>  
>  	unsigned int queuing_high_bandwidth:1;
>  	unsigned int srp_success:1;
> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
> index 88629be..d34f169 100644
> --- a/drivers/usb/dwc2/platform.c
> +++ b/drivers/usb/dwc2/platform.c
> @@ -45,6 +45,7 @@
>  #include <linux/platform_device.h>
>  #include <linux/phy/phy.h>
>  #include <linux/platform_data/s3c-hsotg.h>
> +#include <linux/reset.h>
>  
>  #include <linux/usb/of.h>
>  
> @@ -337,6 +338,24 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg)
>  {
>  	int i, ret;
>  
> +	hsotg->reset = devm_reset_control_get_optional(hsotg->dev, "dwc2");
> +	if (IS_ERR(hsotg->reset)) {
> +		ret = PTR_ERR(hsotg->reset);
> +		switch (ret) {
> +		case -ENOENT:
> +		case -ENOTSUPP:
> +			hsotg->reset = NULL;
> +			break;
> +		default:
> +			dev_err(hsotg->dev, "error getting reset control %d\n",
> +				ret);
> +			return ret;
> +		}
> +	}
> +
> +	if (hsotg->reset)
> +		reset_control_deassert(hsotg->reset);
> +
>  	/* Set default UTMI width */
>  	hsotg->phyif = GUSBCFG_PHYIF16;
>  
> @@ -434,6 +453,9 @@ static int dwc2_driver_remove(struct platform_device *dev)
>  	if (hsotg->ll_hw_enabled)
>  		dwc2_lowlevel_hw_disable(hsotg);
>  
> +	if (hsotg->reset)
> +		reset_control_assert(hsotg->reset);
> +
>  	return 0;
>  }
>  

[toc] | [next] | [standalone]


#1437870

FromJohn Youn <John.Youn@synopsys.com>
Date2016-07-06 19:50 +0200
Message-ID<rRZ7s-3Lq-5@gated-at.bofh.it>
In reply to#1437836
On 7/6/2016 9:25 AM, Philipp Zabel wrote:
> Hi Dinh,
> 
> Am Dienstag, den 21.06.2016, 14:12 -0500 schrieb
> dinguyen@opensource.altera.com:
>> From: Dinh Nguyen <dinguyen@opensource.altera.com>
>>
>> Allow for platforms that have a reset controller driver in place to bring
>> the USB IP out of reset.
>>
>> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
>> Acked-by: John Youn <johnyoun@synopsys.com>
>> Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
>> Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
> 
> Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
> 
> This is an USB patch. Doesn't John collect patches and send pull
> requests? Then you should put Greg Kroah-Hartman and
> linux-usb@vger.kernel.org into Cc:. Things get easily lost on
> linux-kernel.
> 

Hi Philipp,

Could you take this patch for 4.8 on your reset-next?

Without the following fix from your tree, Dinh's patch will break
several platforms.

http://marc.info/?l=linux-usb&m=146473891018262&w=2

If it's too late we can probably have it go through Felipe's tree
during -rc.

Regards,
John

[toc] | [prev] | [next] | [standalone]


#1438430

FromPhilipp Zabel <p.zabel@pengutronix.de>
Date2016-07-07 11:20 +0200
Message-ID<rSdDr-4Xv-9@gated-at.bofh.it>
In reply to#1437870
Am Mittwoch, den 06.07.2016, 10:48 -0700 schrieb John Youn:
> On 7/6/2016 9:25 AM, Philipp Zabel wrote:
> > Hi Dinh,
> > 
> > Am Dienstag, den 21.06.2016, 14:12 -0500 schrieb
> > dinguyen@opensource.altera.com:
> >> From: Dinh Nguyen <dinguyen@opensource.altera.com>
> >>
> >> Allow for platforms that have a reset controller driver in place to bring
> >> the USB IP out of reset.
> >>
> >> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
> >> Acked-by: John Youn <johnyoun@synopsys.com>
> >> Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
> >> Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
> > 
> > Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
> > 
> > This is an USB patch. Doesn't John collect patches and send pull
> > requests? Then you should put Greg Kroah-Hartman and
> > linux-usb@vger.kernel.org into Cc:. Things get easily lost on
> > linux-kernel.
> > 
> 
> Hi Philipp,
> 
> Could you take this patch for 4.8 on your reset-next?
>
> Without the following fix from your tree, Dinh's patch will break
> several platforms.
> 
> http://marc.info/?l=linux-usb&m=146473891018262&w=2

My apologies, I have completely missed your mail from 21.06.

> If it's too late we can probably have it go through Felipe's tree
> during -rc.

Yes, I got two pull requests merged this round, but the last one
probably was already too late. I'd prefer this patch to go the USB
route.

regards
Philipp

[toc] | [prev] | [next] | [standalone]


#1438778

FromJohn Youn <John.Youn@synopsys.com>
Date2016-07-07 20:00 +0200
Message-ID<rSlKF-1Il-1@gated-at.bofh.it>
In reply to#1438430
On 7/7/2016 2:12 AM, Philipp Zabel wrote:
> Am Mittwoch, den 06.07.2016, 10:48 -0700 schrieb John Youn:
>> On 7/6/2016 9:25 AM, Philipp Zabel wrote:
>>> Hi Dinh,
>>>
>>> Am Dienstag, den 21.06.2016, 14:12 -0500 schrieb
>>> dinguyen@opensource.altera.com:
>>>> From: Dinh Nguyen <dinguyen@opensource.altera.com>
>>>>
>>>> Allow for platforms that have a reset controller driver in place to bring
>>>> the USB IP out of reset.
>>>>
>>>> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
>>>> Acked-by: John Youn <johnyoun@synopsys.com>
>>>> Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
>>>> Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
>>>
>>> Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
>>>
>>> This is an USB patch. Doesn't John collect patches and send pull
>>> requests? Then you should put Greg Kroah-Hartman and
>>> linux-usb@vger.kernel.org into Cc:. Things get easily lost on
>>> linux-kernel.
>>>
>>
>> Hi Philipp,
>>
>> Could you take this patch for 4.8 on your reset-next?
>>
>> Without the following fix from your tree, Dinh's patch will break
>> several platforms.
>>
>> http://marc.info/?l=linux-usb&m=146473891018262&w=2
> 
> My apologies, I have completely missed your mail from 21.06.
> 
>> If it's too late we can probably have it go through Felipe's tree
>> during -rc.
> 
> Yes, I got two pull requests merged this round, but the last one
> probably was already too late. I'd prefer this patch to go the USB
> route.
> 

Sure we'll do that.

Thanks,
John

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web