linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: r8a66597-hdc disable interrupts fix
@ 2010-01-27  7:41 Magnus Damm
  2010-01-29  3:08 ` Yoshihiro Shimoda
  2010-02-02  2:32 ` Paul Mundt
  0 siblings, 2 replies; 3+ messages in thread
From: Magnus Damm @ 2010-01-27  7:41 UTC (permalink / raw)
  To: linux-sh

From: Magnus Damm <damm@opensource.se>

This patch improves disable_controller() in the r8a66597-hdc
driver to disable all interrupts and clear status flags. It
also makes sure that disable_controller() is called during
probe(). This fixes the relatively rare case of unexpected
pending interrupts after kexec reboot.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 drivers/usb/host/r8a66597-hcd.c |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

--- 0001/drivers/usb/host/r8a66597-hcd.c
+++ work/drivers/usb/host/r8a66597-hcd.c	2010-01-26 18:12:57.000000000 +0900
@@ -216,8 +216,17 @@ static void disable_controller(struct r8
 {
 	int port;
 
+	/* disable interrupts */
 	r8a66597_write(r8a66597, 0, INTENB0);
-	r8a66597_write(r8a66597, 0, INTSTS0);
+	r8a66597_write(r8a66597, 0, INTENB1);
+	r8a66597_write(r8a66597, 0, BRDYENB);
+	r8a66597_write(r8a66597, 0, BEMPENB);
+	r8a66597_write(r8a66597, 0, NRDYENB);
+
+	/* clear status */
+	r8a66597_write(r8a66597, 0, BRDYSTS);
+	r8a66597_write(r8a66597, 0, NRDYSTS);
+	r8a66597_write(r8a66597, 0, BEMPSTS);
 
 	for (port = 0; port < r8a66597->max_root_hub; port++)
 		r8a66597_disable_port(r8a66597, port);
@@ -2466,6 +2475,12 @@ static int __devinit r8a66597_probe(stru
 	r8a66597->rh_timer.data = (unsigned long)r8a66597;
 	r8a66597->reg = (unsigned long)reg;
 
+	/* make sure no interrupts are pending */
+	ret = r8a66597_clock_enable(r8a66597);
+	if (ret < 0)
+		goto clean_up3;
+	disable_controller(r8a66597);
+
 	for (i = 0; i < R8A66597_MAX_NUM_PIPE; i++) {
 		INIT_LIST_HEAD(&r8a66597->pipe_queue[i]);
 		init_timer(&r8a66597->td_timer[i]);

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

* Re: [PATCH] usb: r8a66597-hdc disable interrupts fix
  2010-01-27  7:41 [PATCH] usb: r8a66597-hdc disable interrupts fix Magnus Damm
@ 2010-01-29  3:08 ` Yoshihiro Shimoda
  2010-02-02  2:32 ` Paul Mundt
  1 sibling, 0 replies; 3+ messages in thread
From: Yoshihiro Shimoda @ 2010-01-29  3:08 UTC (permalink / raw)
  To: linux-sh

Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
> 
> This patch improves disable_controller() in the r8a66597-hdc
> driver to disable all interrupts and clear status flags. It
> also makes sure that disable_controller() is called during
> probe(). This fixes the relatively rare case of unexpected
> pending interrupts after kexec reboot.

Thank you very much for your patch.

Acked-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>

Thanks,
Yoshihiro Shimoda

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

* Re: [PATCH] usb: r8a66597-hdc disable interrupts fix
  2010-01-27  7:41 [PATCH] usb: r8a66597-hdc disable interrupts fix Magnus Damm
  2010-01-29  3:08 ` Yoshihiro Shimoda
@ 2010-02-02  2:32 ` Paul Mundt
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Mundt @ 2010-02-02  2:32 UTC (permalink / raw)
  To: linux-sh

On Fri, Jan 29, 2010 at 12:08:13PM +0900, Yoshihiro Shimoda wrote:
> Magnus Damm wrote:
> > From: Magnus Damm <damm@opensource.se>
> > 
> > This patch improves disable_controller() in the r8a66597-hdc
> > driver to disable all interrupts and clear status flags. It
> > also makes sure that disable_controller() is called during
> > probe(). This fixes the relatively rare case of unexpected
> > pending interrupts after kexec reboot.
> 
> Thank you very much for your patch.
> 
> Acked-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
> 
Queued for 2.6.33, thanks.

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

end of thread, other threads:[~2010-02-02  2:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-27  7:41 [PATCH] usb: r8a66597-hdc disable interrupts fix Magnus Damm
2010-01-29  3:08 ` Yoshihiro Shimoda
2010-02-02  2:32 ` Paul Mundt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).