All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Becker Stefan (Nokia-D/Salo)" <Stefan.Becker@nokia.com>
To: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Cc: ext Alan Stern <stern@rowland.harvard.edu>
Subject: BUG in 2.6.26-rc8 interrupt handling
Date: Sat, 28 Jun 2008 22:34:42 +0300	[thread overview]
Message-ID: <48669252.1000608@nokia.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0806281241200.23326-100000@netrider.rowland.org>

[-- Attachment #1: Type: text/plain, Size: 1325 bytes --]

Hi,

[I'm not subscribed to this list, so please CC: me]

[Subject has been changed, please read the rest of the thread for all 
the details]

On my AthlonXP single CPU laptop I experience random lockups when I 
access the external USB harddrive with kernels >2.6.23. The problem 
doesn't appear with 2.6.23.

Debugging revealed that a routine was called twice that takes a 
spinlock. But this actually shouldn't happen, because the function 
should only be invoked with interrupts disabled. A little more debugging 
revealed that apparently sometimes interrupts are enabled when the USB 
HCD interrupt handlers are called, although they are registered with 
IRQF_DISABLED.

With the attached patch ontop of 2.6.26-rc8 I get these messages:

kernel: USB_HCD_IRQ interrupts disabled 14206 enabled 6289
kernel: USB_HCD_IRQ interrupts disabled 14761 enabled 6290
kernel: USB_HCD_IRQ interrupts disabled 14761 enabled 6291

I also attached the contents from /proc/interrupts from the machine.

Any ideas what could be wrong or any suggestions in which direction I 
should continue debugging?

Regards,

	Stefan

---
Stefan Becker   Nokia-TP/Salo            Senior Specialist, EE SW
E-Mail: Stefan.Becker@nokia.com          SMS: 4871554@???.??
Office: +358-7180-71554                  FAX: +358-7180-44751
GSM   : +358-50-4871554

[-- Attachment #2: usb-hcd-interrupts.patch --]
[-- Type: text/plain, Size: 673 bytes --]

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 09a53e7..5814c5a 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1686,6 +1686,18 @@ irqreturn_t usb_hcd_irq (int irq, void *__hcd)
 	struct usb_hcd		*hcd = __hcd;
 	int			start = hcd->state;
 
+#ifdef DEBUG
+	static unsigned int _enabled  = 0;
+	static unsigned int _disabled = 0;
+	if (raw_irqs_disabled()) {
+		_disabled++;
+	} else {
+		_enabled++;
+		printk(KERN_CRIT "USB_HCD_IRQ interrupts disabled %d enabled %d\n",
+		       _disabled, _enabled);
+	}
+#endif
+
 	if (unlikely(start == HC_STATE_HALT ||
 	    !test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)))
 		return IRQ_NONE;

[-- Attachment #3: proc-interrupts.txt --]
[-- Type: text/plain, Size: 914 bytes --]

           CPU0       
  0:      31904    XT-PIC-XT        timer
  1:        112    XT-PIC-XT        i8042
  2:          0    XT-PIC-XT        cascade
  5:          1    XT-PIC-XT        firewire_ohci, VIA8233, VIA82XX-MODEM
  6:          1    XT-PIC-XT      
  7:          0    XT-PIC-XT        parport0
  9:         52    XT-PIC-XT        acpi
 10:         21    XT-PIC-XT        uhci_hcd:usb2
 11:         36    XT-PIC-XT        yenta, ehci_hcd:usb1, uhci_hcd:usb3
 12:        120    XT-PIC-XT        i8042
 14:       1959    XT-PIC-XT        pata_via
 15:         39    XT-PIC-XT        pata_via
NMI:          0   Non-maskable interrupts
LOC:          0   Local timer interrupts
RES:          0   Rescheduling interrupts
CAL:          0   function call interrupts
TLB:          0   TLB shootdowns
TRM:          0   Thermal event interrupts
SPU:          0   Spurious interrupts
ERR:          0
MIS:          0

  reply	other threads:[~2008-06-28 19:42 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-22 16:55 [REGRESSION] 2.6.24/25: random lockups when accessing external USB harddrive Stefan Becker
2008-06-22 17:42 ` Rene Herman
2008-06-22 19:31   ` Alan Stern
2008-06-23 15:52     ` Stefan Becker
2008-06-23 18:10       ` Alan Stern
2008-06-24 18:41         ` Stefan Becker
2008-06-24 21:15           ` Alan Stern
2008-06-25 15:52             ` Stefan Becker
2008-06-25 18:38               ` Alan Stern
2008-06-26  6:31                 ` Stefan Becker
2008-06-26 14:25                   ` Alan Stern
2008-06-26 22:07                     ` Stefan Becker
2008-06-27 16:07                       ` David Brownell
2008-06-28 14:31                         ` Stefan Becker
2008-06-27 16:10                       ` Alan Stern
2008-06-28 14:36                         ` Stefan Becker
2008-06-28 15:39                         ` Stefan Becker
2008-06-28 16:53                           ` Alan Stern
2008-06-28 19:34                             ` Becker Stefan (Nokia-D/Salo) [this message]
2008-06-28 19:51                               ` BUG in 2.6.26-rc8 interrupt handling David Brownell
2008-06-29 14:57                                 ` PATCH: 2.6.26-rc8: Fix IRQF_DISABLED for shared interrupts Stefan Becker
2008-06-30  3:09                                   ` David Brownell
2008-06-30  5:22                                     ` Stefan Becker
2008-06-30 14:28                                       ` Henrique de Moraes Holschuh
2008-06-30 14:26                                         ` Alan Cox
2008-06-30  9:34                                     ` Stefan Becker
2008-06-30 11:15                                       ` David Brownell
2008-06-30 14:37                                         ` Alan Stern
2008-06-30 18:53                                           ` [PATCH] USB: fix interrupt disabling for HCDs with shared interrupt handlers Stefan Becker
2008-06-30 19:35                                             ` Alan Stern
2008-06-30 20:31                                               ` David Brownell
2008-06-30 21:26                                                 ` Stefan Becker
2008-07-01 14:11                                                   ` Alan Stern
2008-07-01 14:19                                                     ` Leonardo Chiquitto
2008-07-01 16:19                                                     ` Stefan Becker
2008-07-01 18:25                                                       ` Greg KH
2008-07-01 18:59                                                         ` Alan Stern
2008-07-01 19:13                                                           ` Greg KH
2008-07-01 19:21                                                           ` David Brownell
2008-07-01 19:15                                                         ` Stefan Becker
2008-07-01 19:51                                                           ` Greg KH
2008-07-01 16:22                                                     ` David Brownell
2008-06-30 21:29                                                 ` Alan Stern
2008-06-30 21:48                                                   ` David Brownell
2008-06-30 19:57                                         ` PATCH: 2.6.26-rc8: Fix IRQF_DISABLED for shared interrupts David Brownell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48669252.1000608@nokia.com \
    --to=stefan.becker@nokia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.