Re: [PATCH 2/3] dma: apbh: check for errors when resetting ip core

2012-10-31 Thread Wolfram Sang

> > There is nothing a user could do in this case except asking a developer
> > what could have happened? And that's the best option here.
> 
> "MXS: Timeout resetting block via register . Please ask the 
> developer 
> for a solution"

"You can do this by writing an email. Further information can be found
here: http://www.wikihow.com/Write-an-Email-to-a-Friend";

Geez, but now we need to explain every browser on every platform...
And that should be applied to every error message, oh noes!

Jürgen, I certainly support your wish to have proper error messages.
Yet, I also think there is a line somewhere to not state too obvious
things?

-- 
Pengutronix e.K.   | Wolfram Sang|
Industrial Linux Solutions | http://www.pengutronix.de/  |


signature.asc
Description: Digital signature
___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 2/3] dma: apbh: check for errors when resetting ip core

2012-10-31 Thread Juergen Beisert
Wolfram Sang wrote:
> On Wed, Oct 31, 2012 at 09:48:31AM +0100, Juergen Beisert wrote:
> > Wolfram Sang wrote:
> > > On Wed, Oct 31, 2012 at 09:29:56AM +0100, Juergen Beisert wrote:
> > > > Wolfram Sang wrote:
> > > > > Signed-off-by: Wolfram Sang 
> > > > > ---
> > > > >  drivers/dma/apbh_dma.c |4 +++-
> > > > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/drivers/dma/apbh_dma.c b/drivers/dma/apbh_dma.c
> > > > > index 363878f..d30b8fb 100644
> > > > > --- a/drivers/dma/apbh_dma.c
> > > > > +++ b/drivers/dma/apbh_dma.c
> > > > > @@ -555,7 +555,9 @@ int mxs_dma_init(void)
> > > > >   int ret, channel;
> > > > >   u32 val, reg;
> > > > >
> > > > > - mxs_reset_block(apbh_regs, 0);
> > > > > + ret = mxs_reset_block(apbh_regs, 0);
> > > > > + if (ret)
> > > > > + return ret;
> > > >
> > > > In this case the user faces a "MXS: Timeout resetting block via
> > > > register ...". Do you think this message is helpful to give the user
> > > > a pointer *where* the failure happens?
> > >
> > > Yes, since it points to the IP core which was used here. Which again,
> > > makes clear which driver was trying to reset the IP core.
> >
> > You mean the reported register offset points to the corresponding IP
> > core?
>
> Yes, sure. Otherwise the error message would be useless :)
>
> > But also Barebox has more users than developers.
>
> There is nothing a user could do in this case except asking a developer
> what could have happened? And that's the best option here.

"MXS: Timeout resetting block via register . Please ask the developer 
for a solution"

:))

jbe

-- 
Pengutronix e.K.  | Juergen Beisert |
Linux Solutions for Science and Industry  | http://www.pengutronix.de/  |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 2/3] dma: apbh: check for errors when resetting ip core

2012-10-31 Thread Wolfram Sang
On Wed, Oct 31, 2012 at 09:48:31AM +0100, Juergen Beisert wrote:
> Wolfram Sang wrote:
> > On Wed, Oct 31, 2012 at 09:29:56AM +0100, Juergen Beisert wrote:
> > > Wolfram Sang wrote:
> > > > Signed-off-by: Wolfram Sang 
> > > > ---
> > > >  drivers/dma/apbh_dma.c |4 +++-
> > > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/dma/apbh_dma.c b/drivers/dma/apbh_dma.c
> > > > index 363878f..d30b8fb 100644
> > > > --- a/drivers/dma/apbh_dma.c
> > > > +++ b/drivers/dma/apbh_dma.c
> > > > @@ -555,7 +555,9 @@ int mxs_dma_init(void)
> > > > int ret, channel;
> > > > u32 val, reg;
> > > >
> > > > -   mxs_reset_block(apbh_regs, 0);
> > > > +   ret = mxs_reset_block(apbh_regs, 0);
> > > > +   if (ret)
> > > > +   return ret;
> > >
> > > In this case the user faces a "MXS: Timeout resetting block via register
> > > ...". Do you think this message is helpful to give the user a pointer
> > > *where* the failure happens?
> >
> > Yes, since it points to the IP core which was used here. Which again,
> > makes clear which driver was trying to reset the IP core.
> 
> You mean the reported register offset points to the corresponding IP core?

Yes, sure. Otherwise the error message would be useless :)

> But also Barebox has more users than developers.

There is nothing a user could do in this case except asking a developer
what could have happened? And that's the best option here.

-- 
Pengutronix e.K.   | Wolfram Sang|
Industrial Linux Solutions | http://www.pengutronix.de/  |


signature.asc
Description: Digital signature
___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 2/3] dma: apbh: check for errors when resetting ip core

2012-10-31 Thread Juergen Beisert
Wolfram Sang wrote:
> On Wed, Oct 31, 2012 at 09:29:56AM +0100, Juergen Beisert wrote:
> > Wolfram Sang wrote:
> > > Signed-off-by: Wolfram Sang 
> > > ---
> > >  drivers/dma/apbh_dma.c |4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/dma/apbh_dma.c b/drivers/dma/apbh_dma.c
> > > index 363878f..d30b8fb 100644
> > > --- a/drivers/dma/apbh_dma.c
> > > +++ b/drivers/dma/apbh_dma.c
> > > @@ -555,7 +555,9 @@ int mxs_dma_init(void)
> > >   int ret, channel;
> > >   u32 val, reg;
> > >
> > > - mxs_reset_block(apbh_regs, 0);
> > > + ret = mxs_reset_block(apbh_regs, 0);
> > > + if (ret)
> > > + return ret;
> >
> > In this case the user faces a "MXS: Timeout resetting block via register
> > ...". Do you think this message is helpful to give the user a pointer
> > *where* the failure happens?
>
> Yes, since it points to the IP core which was used here. Which again,
> makes clear which driver was trying to reset the IP core.

You mean the reported register offset points to the corresponding IP core?

Just my 2cents: a generic routine should report a failure to the caller. And 
the caller should output a valuable failure message which makes clear what 
the caller had tried to do by calling the generic routine. I think such a 
message would be more helpful. Your generic message is for developers only. 
But also Barebox has more users than developers.

jbe

-- 
Pengutronix e.K.  | Juergen Beisert |
Linux Solutions for Science and Industry  | http://www.pengutronix.de/  |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 2/3] dma: apbh: check for errors when resetting ip core

2012-10-31 Thread Wolfram Sang
On Wed, Oct 31, 2012 at 09:29:56AM +0100, Juergen Beisert wrote:
> Wolfram Sang wrote:
> > Signed-off-by: Wolfram Sang 
> > ---
> >  drivers/dma/apbh_dma.c |4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/dma/apbh_dma.c b/drivers/dma/apbh_dma.c
> > index 363878f..d30b8fb 100644
> > --- a/drivers/dma/apbh_dma.c
> > +++ b/drivers/dma/apbh_dma.c
> > @@ -555,7 +555,9 @@ int mxs_dma_init(void)
> > int ret, channel;
> > u32 val, reg;
> >
> > -   mxs_reset_block(apbh_regs, 0);
> > +   ret = mxs_reset_block(apbh_regs, 0);
> > +   if (ret)
> > +   return ret;
> 
> In this case the user faces a "MXS: Timeout resetting block via register 
> ...". 
> Do you think this message is helpful to give the user a pointer *where* the 
> failure happens?

Yes, since it points to the IP core which was used here. Which again,
makes clear which driver was trying to reset the IP core.

-- 
Pengutronix e.K.   | Wolfram Sang|
Industrial Linux Solutions | http://www.pengutronix.de/  |


signature.asc
Description: Digital signature
___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 2/3] dma: apbh: check for errors when resetting ip core

2012-10-31 Thread Juergen Beisert
Wolfram Sang wrote:
> Signed-off-by: Wolfram Sang 
> ---
>  drivers/dma/apbh_dma.c |4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/apbh_dma.c b/drivers/dma/apbh_dma.c
> index 363878f..d30b8fb 100644
> --- a/drivers/dma/apbh_dma.c
> +++ b/drivers/dma/apbh_dma.c
> @@ -555,7 +555,9 @@ int mxs_dma_init(void)
>   int ret, channel;
>   u32 val, reg;
>
> - mxs_reset_block(apbh_regs, 0);
> + ret = mxs_reset_block(apbh_regs, 0);
> + if (ret)
> + return ret;

In this case the user faces a "MXS: Timeout resetting block via register ...". 
Do you think this message is helpful to give the user a pointer *where* the 
failure happens?

jbe

-- 
Pengutronix e.K.  | Juergen Beisert |
Linux Solutions for Science and Industry  | http://www.pengutronix.de/  |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox