Bug 7750

Summary: open/close loop causes disabled irq
Product: Drivers Reporter: dann frazier (dannf)
Component: SerialAssignee: Russell King (rmk)
Status: CLOSED CODE_FIX    
Severity: normal CC: akpm, protasnb, stern
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.20-rc2 Subsystem:
Regression: --- Bisected commit-id:
Attachments: reproducer

Description dann frazier 2006-12-28 13:46:35 UTC
Most recent kernel where this bug did *NOT* occur: unknown (is reproducible with
2.6.18.5 and 2.6.20-rc2)
Distribution: Debian
Hardware Environment: HP nc6000 laptop
Software Environment:
Problem Description:
 A Debian user reported that a simple program that repeatedly opens and closes a
serial device will eventually cause an irq line to be disabled.

Debian report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=404815

I've also reproduced this on 2.6.20-rc2.

Steps to reproduce:
Run the attached program.
Comment 1 dann frazier 2006-12-28 13:50:03 UTC
Created attachment 9958 [details]
reproducer
Comment 2 Biswa ranjan Nayak 2007-01-16 04:45:54 UTC
I tried reproducing this issue and found that the issue is observed when the 
PREEMPTION is turned off. If kernel preemption is turned on then the error is 
not happening
Comment 3 Natalie Protasevich 2007-07-07 01:38:14 UTC
To refresh please test it with recent kernel. Is the problem still there?
Thanks.
Comment 4 dann frazier 2007-07-12 20:07:17 UTC
I attempted to reproduce this today under 2.6.22 and was unable to. I then used git bisect to try and identify the changeset that fixed the issue and ended up with the one below.

I wonder if this should be considered a security issue (DoS)?

commit 8528b0f1de1101c6002036fd53638fb21111d0ea
Author: Linus Torvalds <torvalds@woody.linux-foundation.org>
Date:   Tue Jan 23 14:16:31 2007 -0800

    Clear spurious irq stat information when adding irq handler
    
    Any newly added irq handler may obviously make any old spurious irq
    status invalid, since the new handler may well be the thing that is
    supposed to handle any interrupts that came in.
    
    So just clear the statistics when adding handlers.
    
    Pointed-out-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
    Acked-by: Thomas Gleixner <tglx@linutronix.de>
    Acked-by: Ingo Molnar <mingo@elte.hu>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

:040000 040000 d3bd3ddf15462bca9f796e899b96f2e17d30bc34 3ea41ebe53747377873202db8b59e2c4e84aef8c M      kernel
Comment 5 Natalie Protasevich 2007-07-15 13:00:03 UTC
Discussion: http://www.uwsg.iu.edu/hypermail/linux/kernel/0707.1/2731.html
Comment 6 Andrew Morton 2007-08-02 16:53:57 UTC
whee, we fixed one.  Thanks.