public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] usb: musb: musb_cppi41: Update an error message
@ 2017-05-05 12:52 Alexandre Bailon
       [not found] ` <20170505125233.27015-1-abailon-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Bailon @ 2017-05-05 12:52 UTC (permalink / raw)
  To: b-liu-l0cyMroinI0
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, nsekhar-l0cyMroinI0,
	ptitiano-rdvid1DuHRBWk0Htik3J/w,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Alexandre Bailon

If dma_request_slave_channel() failed to return a channel,
then the driver will print an error and request to defer probe,
regardless of the cause of the failure.
Only defer if the DMA is not ready yet and print an error to explain
that we are deferring probe.

Signed-off-by: Alexandre Bailon <abailon-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
---
 drivers/usb/musb/musb_cppi41.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c
index e7c8b1b..4718d0d 100644
--- a/drivers/usb/musb/musb_cppi41.c
+++ b/drivers/usb/musb/musb_cppi41.c
@@ -673,10 +673,12 @@ static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller)
 		musb_dma->status = MUSB_DMA_STATUS_FREE;
 		musb_dma->max_len = SZ_4M;
 
-		dc = dma_request_slave_channel(dev->parent, str);
-		if (!dc) {
-			dev_err(dev, "Failed to request %s.\n", str);
-			ret = -EPROBE_DEFER;
+		dc = dma_request_chan(dev->parent, str);
+		if (IS_ERR(dc)) {
+			ret = PTR_ERR(dc);
+			dev_err(dev, "Failed to request %s%s.\n", str,
+				ret == -EPROBE_DEFER
+				? ", deferring probe" : "");
 			goto err;
 		}
 		cppi41_channel->dc = dc;
-- 
2.10.2

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] usb: musb: musb_cppi41: Update an error message
       [not found] ` <20170505125233.27015-1-abailon-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
@ 2017-05-10 19:45   ` Bin Liu
  2017-05-11  7:51     ` Johan Hovold
  0 siblings, 1 reply; 4+ messages in thread
From: Bin Liu @ 2017-05-10 19:45 UTC (permalink / raw)
  To: Alexandre Bailon
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Nori, Sekhar,
	ptitiano-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On Fri, May 05, 2017 at 07:52:33AM -0500, Alexandre Bailon wrote:
> If dma_request_slave_channel() failed to return a channel,
> then the driver will print an error and request to defer probe,
> regardless of the cause of the failure.
> Only defer if the DMA is not ready yet and print an error to explain
> that we are deferring probe.
> 
> Signed-off-by: Alexandre Bailon <abailon-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>

Applied. Thanks.
-Bin.

> ---
>  drivers/usb/musb/musb_cppi41.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c
> index e7c8b1b..4718d0d 100644
> --- a/drivers/usb/musb/musb_cppi41.c
> +++ b/drivers/usb/musb/musb_cppi41.c
> @@ -673,10 +673,12 @@ static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller)
>  		musb_dma->status = MUSB_DMA_STATUS_FREE;
>  		musb_dma->max_len = SZ_4M;
>  
> -		dc = dma_request_slave_channel(dev->parent, str);
> -		if (!dc) {
> -			dev_err(dev, "Failed to request %s.\n", str);
> -			ret = -EPROBE_DEFER;
> +		dc = dma_request_chan(dev->parent, str);
> +		if (IS_ERR(dc)) {
> +			ret = PTR_ERR(dc);
> +			dev_err(dev, "Failed to request %s%s.\n", str,
> +				ret == -EPROBE_DEFER
> +				? ", deferring probe" : "");
>  			goto err;
>  		}
>  		cppi41_channel->dc = dc;
> -- 
> 2.10.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] usb: musb: musb_cppi41: Update an error message
  2017-05-10 19:45   ` Bin Liu
@ 2017-05-11  7:51     ` Johan Hovold
  2017-05-11 14:06       ` Bin Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Johan Hovold @ 2017-05-11  7:51 UTC (permalink / raw)
  To: Bin Liu
  Cc: Alexandre Bailon,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Nori, Sekhar,
	ptitiano-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On Wed, May 10, 2017 at 02:45:13PM -0500, Bin Liu wrote:
> On Fri, May 05, 2017 at 07:52:33AM -0500, Alexandre Bailon wrote:
> > If dma_request_slave_channel() failed to return a channel,
> > then the driver will print an error and request to defer probe,
> > regardless of the cause of the failure.
> > Only defer if the DMA is not ready yet and print an error to explain
> > that we are deferring probe.
> > 
> > Signed-off-by: Alexandre Bailon <abailon-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
> 
> Applied. Thanks.
> 
> > ---
> >  drivers/usb/musb/musb_cppi41.c | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c
> > index e7c8b1b..4718d0d 100644
> > --- a/drivers/usb/musb/musb_cppi41.c
> > +++ b/drivers/usb/musb/musb_cppi41.c
> > @@ -673,10 +673,12 @@ static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller)
> >  		musb_dma->status = MUSB_DMA_STATUS_FREE;
> >  		musb_dma->max_len = SZ_4M;
> >  
> > -		dc = dma_request_slave_channel(dev->parent, str);
> > -		if (!dc) {
> > -			dev_err(dev, "Failed to request %s.\n", str);
> > -			ret = -EPROBE_DEFER;
> > +		dc = dma_request_chan(dev->parent, str);
> > +		if (IS_ERR(dc)) {
> > +			ret = PTR_ERR(dc);
> > +			dev_err(dev, "Failed to request %s%s.\n", str,
> > +				ret == -EPROBE_DEFER
> > +				? ", deferring probe" : "");

Probe deferral is not really an error, and we typically suppress any
error messages otherwise printed when a subsystem requests it to avoid
noise during boot. (There is a debug statement in driver core that
anyone interested can enable instead).

> >  			goto err;
> >  		}

So this should really be

	if (IS_ERR(DC)) {
		ret = PTR_ERR(dc);
		if (ret != -EPROBE_DEFER)
			dev_err(dev, ...);
		goto err;
	}

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] usb: musb: musb_cppi41: Update an error message
  2017-05-11  7:51     ` Johan Hovold
@ 2017-05-11 14:06       ` Bin Liu
  0 siblings, 0 replies; 4+ messages in thread
From: Bin Liu @ 2017-05-11 14:06 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Alexandre Bailon,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Nori, Sekhar,
	ptitiano-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On Thu, May 11, 2017 at 09:51:11AM +0200, Johan Hovold wrote:
> On Wed, May 10, 2017 at 02:45:13PM -0500, Bin Liu wrote:
> > On Fri, May 05, 2017 at 07:52:33AM -0500, Alexandre Bailon wrote:
> > > If dma_request_slave_channel() failed to return a channel,
> > > then the driver will print an error and request to defer probe,
> > > regardless of the cause of the failure.
> > > Only defer if the DMA is not ready yet and print an error to explain
> > > that we are deferring probe.
> > > 
> > > Signed-off-by: Alexandre Bailon <abailon-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
> > 
> > Applied. Thanks.
> > 
> > > ---
> > >  drivers/usb/musb/musb_cppi41.c | 10 ++++++----
> > >  1 file changed, 6 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c
> > > index e7c8b1b..4718d0d 100644
> > > --- a/drivers/usb/musb/musb_cppi41.c
> > > +++ b/drivers/usb/musb/musb_cppi41.c
> > > @@ -673,10 +673,12 @@ static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller)
> > >  		musb_dma->status = MUSB_DMA_STATUS_FREE;
> > >  		musb_dma->max_len = SZ_4M;
> > >  
> > > -		dc = dma_request_slave_channel(dev->parent, str);
> > > -		if (!dc) {
> > > -			dev_err(dev, "Failed to request %s.\n", str);
> > > -			ret = -EPROBE_DEFER;
> > > +		dc = dma_request_chan(dev->parent, str);
> > > +		if (IS_ERR(dc)) {
> > > +			ret = PTR_ERR(dc);
> > > +			dev_err(dev, "Failed to request %s%s.\n", str,
> > > +				ret == -EPROBE_DEFER
> > > +				? ", deferring probe" : "");
> 
> Probe deferral is not really an error, and we typically suppress any
> error messages otherwise printed when a subsystem requests it to avoid
> noise during boot. (There is a debug statement in driver core that

Valid point, the deferral log shouldn't use the error level.
So dropped this patch from my tree.

> anyone interested can enable instead).
> 
> > >  			goto err;
> > >  		}
> 
> So this should really be
> 
> 	if (IS_ERR(DC)) {
> 		ret = PTR_ERR(dc);
> 		if (ret != -EPROBE_DEFER)
> 			dev_err(dev, ...);
> 		goto err;
> 	}

Regards,
-Bin.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-05-11 14:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-05 12:52 [PATCH v2] usb: musb: musb_cppi41: Update an error message Alexandre Bailon
     [not found] ` <20170505125233.27015-1-abailon-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
2017-05-10 19:45   ` Bin Liu
2017-05-11  7:51     ` Johan Hovold
2017-05-11 14:06       ` Bin Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox