Patchwork [U-Boot,v3,4/8] arm: bootm: call udc_disable() before booting linux

login
register
mail settings
Submitter Mike Dunn
Date April 12, 2013, 6:59 p.m.
Message ID <1365793160-18247-5-git-send-email-mikedunn@newsguy.com>
Download mbox | patch
Permalink /patch/236178/
State Accepted
Delegated to: Marek Vasut
Headers show

Comments

Mike Dunn - April 12, 2013, 6:59 p.m.
On the pxa270, if the udc device is not disabled before jumping to linux, the
device fails to initialize in linux because it was left in a running state, and
the linux driver assumes that it is in a disabled state.

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
---
Changelog:
  v3: no change
  v2: no change

Arguably, this is a bug in the linux driver, but it seemed pretty simple and
benign to just disable it in u-boot.  I'll also send a patch to upstream kernel
to fix its driver.

 arch/arm/include/asm/bootm.h |    1 +
 arch/arm/lib/bootm.c         |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
Marek Vasut - April 14, 2013, 5:26 p.m.
Dear Mike Dunn,

> On the pxa270, if the udc device is not disabled before jumping to linux,
> the device fails to initialize in linux because it was left in a running
> state, and the linux driver assumes that it is in a disabled state.
> 
> Signed-off-by: Mike Dunn <mikedunn@newsguy.com>

Albert, can I get your ACK on this?

Best regards,
Marek Vasut
Albert ARIBAUD - April 14, 2013, 7:22 p.m.
Hi Mike,

On Fri, 12 Apr 2013 11:59:16 -0700, Mike Dunn <mikedunn@newsguy.com>
wrote:

> On the pxa270, if the udc device is not disabled before jumping to linux, the
> device fails to initialize in linux because it was left in a running state, and
> the linux driver assumes that it is in a disabled state.
> 
> Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
> ---
> Changelog:
>   v3: no change
>   v2: no change
> 
> Arguably, this is a bug in the linux driver, but it seemed pretty simple and
> benign to just disable it in u-boot.  I'll also send a patch to upstream kernel
> to fix its driver.
> 
>  arch/arm/include/asm/bootm.h |    1 +
>  arch/arm/lib/bootm.c         |    1 +
>  2 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/include/asm/bootm.h b/arch/arm/include/asm/bootm.h
> index db2ff94..68189cc 100644
> --- a/arch/arm/include/asm/bootm.h
> +++ b/arch/arm/include/asm/bootm.h
> @@ -21,6 +21,7 @@
>  
>  #ifdef CONFIG_USB_DEVICE
>  extern void udc_disconnect(void);
> +extern void udc_disable(void);
>  #endif
>  
>  #endif
> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> index f3b30c5..6daa7bf 100644
> --- a/arch/arm/lib/bootm.c
> +++ b/arch/arm/lib/bootm.c
> @@ -105,6 +105,7 @@ static void announce_and_cleanup(void)
>  
>  #ifdef CONFIG_USB_DEVICE
>  	udc_disconnect();
> +	udc_disable();
>  #endif
>  	cleanup_before_linux();
>  }

Acked-By: Albert ARIBAUD <albert.u.boot@aribaud.net>

Amicalement,
Marek Vasut - April 14, 2013, 8:12 p.m.
Dear Albert ARIBAUD,

> Hi Mike,
> 
> On Fri, 12 Apr 2013 11:59:16 -0700, Mike Dunn <mikedunn@newsguy.com>
> 
> wrote:
> > On the pxa270, if the udc device is not disabled before jumping to linux,
> > the device fails to initialize in linux because it was left in a running
> > state, and the linux driver assumes that it is in a disabled state.
> > 
> > Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
> > ---
> > 
> > Changelog:
> >   v3: no change
> >   v2: no change
> > 
> > Arguably, this is a bug in the linux driver, but it seemed pretty simple
> > and benign to just disable it in u-boot.  I'll also send a patch to
> > upstream kernel to fix its driver.
> > 
> >  arch/arm/include/asm/bootm.h |    1 +
> >  arch/arm/lib/bootm.c         |    1 +
> >  2 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/include/asm/bootm.h b/arch/arm/include/asm/bootm.h
> > index db2ff94..68189cc 100644
> > --- a/arch/arm/include/asm/bootm.h
> > +++ b/arch/arm/include/asm/bootm.h
> > @@ -21,6 +21,7 @@
> > 
> >  #ifdef CONFIG_USB_DEVICE
> >  extern void udc_disconnect(void);
> > 
> > +extern void udc_disable(void);
> > 
> >  #endif
> >  
> >  #endif
> > 
> > diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> > index f3b30c5..6daa7bf 100644
> > --- a/arch/arm/lib/bootm.c
> > +++ b/arch/arm/lib/bootm.c
> > @@ -105,6 +105,7 @@ static void announce_and_cleanup(void)
> > 
> >  #ifdef CONFIG_USB_DEVICE
> >  
> >  	udc_disconnect();
> > 
> > +	udc_disable();
> > 
> >  #endif
> >  
> >  	cleanup_before_linux();
> >  
> >  }
> 
> Acked-By: Albert ARIBAUD <albert.u.boot@aribaud.net>

Tom, will this not break any of your musb-toys?

Best regards,
Marek Vasut
Tom Rini - April 15, 2013, 12:45 p.m.
On Sun, Apr 14, 2013 at 10:12:36PM +0200, Marek Vasut wrote:
> Dear Albert ARIBAUD,
> 
> > Hi Mike,
> > 
> > On Fri, 12 Apr 2013 11:59:16 -0700, Mike Dunn <mikedunn@newsguy.com>
> > 
> > wrote:
> > > On the pxa270, if the udc device is not disabled before jumping to linux,
> > > the device fails to initialize in linux because it was left in a running
> > > state, and the linux driver assumes that it is in a disabled state.
> > > 
> > > Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
> > > ---
> > > 
> > > Changelog:
> > >   v3: no change
> > >   v2: no change
> > > 
> > > Arguably, this is a bug in the linux driver, but it seemed pretty simple
> > > and benign to just disable it in u-boot.  I'll also send a patch to
> > > upstream kernel to fix its driver.
> > > 
> > >  arch/arm/include/asm/bootm.h |    1 +
> > >  arch/arm/lib/bootm.c         |    1 +
> > >  2 files changed, 2 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/arch/arm/include/asm/bootm.h b/arch/arm/include/asm/bootm.h
> > > index db2ff94..68189cc 100644
> > > --- a/arch/arm/include/asm/bootm.h
> > > +++ b/arch/arm/include/asm/bootm.h
> > > @@ -21,6 +21,7 @@
> > > 
> > >  #ifdef CONFIG_USB_DEVICE
> > >  extern void udc_disconnect(void);
> > > 
> > > +extern void udc_disable(void);
> > > 
> > >  #endif
> > >  
> > >  #endif
> > > 
> > > diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> > > index f3b30c5..6daa7bf 100644
> > > --- a/arch/arm/lib/bootm.c
> > > +++ b/arch/arm/lib/bootm.c
> > > @@ -105,6 +105,7 @@ static void announce_and_cleanup(void)
> > > 
> > >  #ifdef CONFIG_USB_DEVICE
> > >  
> > >  	udc_disconnect();
> > > 
> > > +	udc_disable();
> > > 
> > >  #endif
> > >  
> > >  	cleanup_before_linux();
> > >  
> > >  }
> > 
> > Acked-By: Albert ARIBAUD <albert.u.boot@aribaud.net>
> 
> Tom, will this not break any of your musb-toys?

Albert, did you test this on your musb using nearly released now board?
:)
Albert ARIBAUD - April 15, 2013, 12:56 p.m.
Hi Tom,

On Mon, 15 Apr 2013 08:45:07 -0400, Tom Rini <trini@ti.com> wrote:

> On Sun, Apr 14, 2013 at 10:12:36PM +0200, Marek Vasut wrote:
> > Dear Albert ARIBAUD,
> > 
> > > Hi Mike,
> > > 
> > > On Fri, 12 Apr 2013 11:59:16 -0700, Mike Dunn <mikedunn@newsguy.com>
> > > 
> > > wrote:
> > > > On the pxa270, if the udc device is not disabled before jumping to linux,
> > > > the device fails to initialize in linux because it was left in a running
> > > > state, and the linux driver assumes that it is in a disabled state.
> > > > 
> > > > Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
> > > > ---
> > > > 
> > > > Changelog:
> > > >   v3: no change
> > > >   v2: no change
> > > > 
> > > > Arguably, this is a bug in the linux driver, but it seemed pretty simple
> > > > and benign to just disable it in u-boot.  I'll also send a patch to
> > > > upstream kernel to fix its driver.
> > > > 
> > > >  arch/arm/include/asm/bootm.h |    1 +
> > > >  arch/arm/lib/bootm.c         |    1 +
> > > >  2 files changed, 2 insertions(+), 0 deletions(-)
> > > > 
> > > > diff --git a/arch/arm/include/asm/bootm.h b/arch/arm/include/asm/bootm.h
> > > > index db2ff94..68189cc 100644
> > > > --- a/arch/arm/include/asm/bootm.h
> > > > +++ b/arch/arm/include/asm/bootm.h
> > > > @@ -21,6 +21,7 @@
> > > > 
> > > >  #ifdef CONFIG_USB_DEVICE
> > > >  extern void udc_disconnect(void);
> > > > 
> > > > +extern void udc_disable(void);
> > > > 
> > > >  #endif
> > > >  
> > > >  #endif
> > > > 
> > > > diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> > > > index f3b30c5..6daa7bf 100644
> > > > --- a/arch/arm/lib/bootm.c
> > > > +++ b/arch/arm/lib/bootm.c
> > > > @@ -105,6 +105,7 @@ static void announce_and_cleanup(void)
> > > > 
> > > >  #ifdef CONFIG_USB_DEVICE
> > > >  
> > > >  	udc_disconnect();
> > > > 
> > > > +	udc_disable();
> > > > 
> > > >  #endif
> > > >  
> > > >  	cleanup_before_linux();
> > > >  
> > > >  }
> > > 
> > > Acked-By: Albert ARIBAUD <albert.u.boot@aribaud.net>
> > 
> > Tom, will this not break any of your musb-toys?
> 
> Albert, did you test this on your musb using nearly released now board?
> :)

No, I haven't. I had assumed from Marex' request that this worked for
him and he wanted my formal ack on it.

Amicalement,
Marek Vasut - April 15, 2013, 1:08 p.m.
Dear Albert ARIBAUD,

> Hi Tom,
> 
> On Mon, 15 Apr 2013 08:45:07 -0400, Tom Rini <trini@ti.com> wrote:
> > On Sun, Apr 14, 2013 at 10:12:36PM +0200, Marek Vasut wrote:
> > > Dear Albert ARIBAUD,
> > > 
> > > > Hi Mike,
> > > > 
> > > > On Fri, 12 Apr 2013 11:59:16 -0700, Mike Dunn <mikedunn@newsguy.com>
> > > > 
> > > > wrote:
> > > > > On the pxa270, if the udc device is not disabled before jumping to
> > > > > linux, the device fails to initialize in linux because it was left
> > > > > in a running state, and the linux driver assumes that it is in a
> > > > > disabled state.
> > > > > 
> > > > > Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
> > > > > ---
> > > > > 
> > > > > Changelog:
> > > > >   v3: no change
> > > > >   v2: no change
> > > > > 
> > > > > Arguably, this is a bug in the linux driver, but it seemed pretty
> > > > > simple and benign to just disable it in u-boot.  I'll also send a
> > > > > patch to upstream kernel to fix its driver.
> > > > > 
> > > > >  arch/arm/include/asm/bootm.h |    1 +
> > > > >  arch/arm/lib/bootm.c         |    1 +
> > > > >  2 files changed, 2 insertions(+), 0 deletions(-)
> > > > > 
> > > > > diff --git a/arch/arm/include/asm/bootm.h
> > > > > b/arch/arm/include/asm/bootm.h index db2ff94..68189cc 100644
> > > > > --- a/arch/arm/include/asm/bootm.h
> > > > > +++ b/arch/arm/include/asm/bootm.h
> > > > > @@ -21,6 +21,7 @@
> > > > > 
> > > > >  #ifdef CONFIG_USB_DEVICE
> > > > >  extern void udc_disconnect(void);
> > > > > 
> > > > > +extern void udc_disable(void);
> > > > > 
> > > > >  #endif
> > > > >  
> > > > >  #endif
> > > > > 
> > > > > diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> > > > > index f3b30c5..6daa7bf 100644
> > > > > --- a/arch/arm/lib/bootm.c
> > > > > +++ b/arch/arm/lib/bootm.c
> > > > > @@ -105,6 +105,7 @@ static void announce_and_cleanup(void)
> > > > > 
> > > > >  #ifdef CONFIG_USB_DEVICE
> > > > >  
> > > > >  	udc_disconnect();
> > > > > 
> > > > > +	udc_disable();
> > > > > 
> > > > >  #endif
> > > > >  
> > > > >  	cleanup_before_linux();
> > > > >  
> > > > >  }
> > > > 
> > > > Acked-By: Albert ARIBAUD <albert.u.boot@aribaud.net>
> > > 
> > > Tom, will this not break any of your musb-toys?
> > 
> > Albert, did you test this on your musb using nearly released now board?
> > 
> > :)
> 
> No, I haven't. I had assumed from Marex' request that this worked for
> him and he wanted my formal ack on it.

I want ACK for a few more devices, thus I also CCed Tom to test on musb rigs.

Best regards,
Marek Vasut

Patch

diff --git a/arch/arm/include/asm/bootm.h b/arch/arm/include/asm/bootm.h
index db2ff94..68189cc 100644
--- a/arch/arm/include/asm/bootm.h
+++ b/arch/arm/include/asm/bootm.h
@@ -21,6 +21,7 @@ 
 
 #ifdef CONFIG_USB_DEVICE
 extern void udc_disconnect(void);
+extern void udc_disable(void);
 #endif
 
 #endif
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index f3b30c5..6daa7bf 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -105,6 +105,7 @@  static void announce_and_cleanup(void)
 
 #ifdef CONFIG_USB_DEVICE
 	udc_disconnect();
+	udc_disable();
 #endif
 	cleanup_before_linux();
 }