kuba-moo / mt7630e

Mediatek driver for MT7630E WiFi+BT combo with my fixes
42 stars 8 forks source link

Unhandled IRQ when unloading mt7630e #19

Open euspectre opened 8 years ago

euspectre commented 8 years ago

OS: ROSA R6 Linux, x64. Kernel 4.1.3. The PCI IDs of the device are 14c3-7630-103c-197c.

The problem shows up when I try to unload mt7630e (modprobe -r mt7630e).

As described in https://github.com/kuba-moo/mt7630e/issues/15, I have commented out the call to Set_BtDump_Proc() as a workaround.

The system no longer crashes here but complains as follows right after I unload mt7630e module:

kernel: irq 16: nobody cared (try booting with the "irqpoll" option)
kernel: CPU: 0 PID: 0 Comm: swapper/0 Tainted: G          IO    4.1.3-nrj-desktop-1rosa-x86_64 #1
kernel: Hardware name: System manufacturer System Product Name/Rampage III GENE, BIOS 0704    09/21/2010
kernel:  ffff88003732368c ffff8801b9203e28 ffffffff8174da0e 0000000000040400
kernel:  ffff880037323600 ffff8801b9203e58 ffffffff810cfb86 0000000000000000
kernel:  ffff880037323600 0000000000000000 0000000000000010 ffff8801b9203e98
kernel: Call Trace:
kernel:    [] dump_stack+0x4c/0x6e
kernel:  [] __report_bad_irq+0x36/0xd0
kernel:  [] note_interrupt+0x247/0x290
kernel:  [] handle_irq_event_percpu+0xae/0x1f0
kernel:  [] handle_irq_event+0x41/0x70
kernel:  [] handle_fasteoi_irq+0x86/0x140
kernel:  [] handle_irq+0x22/0x40
kernel:  [] do_IRQ+0x4f/0xf0
kernel:  [] common_interrupt+0x6e/0x6e
kernel:    [] ? cpuidle_enter_state+0xae/0x240
kernel:  [] ? cpuidle_enter_state+0x80/0x240
kernel:  [] cpuidle_enter+0x17/0x20
kernel:  [] cpu_startup_entry+0x3ae/0x430
kernel:  [] rest_init+0x8a/0x90
kernel:  [] start_kernel+0x434/0x441
kernel:  [] ? early_idt_handler_array+0x120/0x120
kernel:  [] x86_64_start_reservations+0x2a/0x2c
kernel:  [] x86_64_start_kernel+0x13b/0x14a
kernel: handlers:
kernel: [] irq_handler [firewire_ohci]
kernel: [] usb_hcd_irq
kernel: Disabling IRQ #16 

Looks unrelated at the first glance but happens each time after I unload mt7630e, which is suspicious.

By the way, if I try to load mt7630e again then, the system hangs completely (no virt. console, no SSH access, even no reaction to SysRq key that worked before).

I'd guess, the driver does not cleanup something properly and the first suspect is its IRQ line. From what I see in the code, rt2x00lib_start() calls request_irq(). Should not rt2x00lib_stop() call free_irq() then? Or free_irq() in rt2x00mmio_uninitialize() is supposed to do the trick somehow?

It looks strange that the call to request_irq() in rt2x00mmio_initialize() is disabled by #if 0 but rt2x00mmio_uninitialize() still calls free_irq().

Besides, it looks like, the error handling in rt2x00lib_start() has enough room for improvement. For example, if request_irq() succeeds but rt2x00lib_load_firmware() (or other operations that may fail) returns error after that, free_irq() should be called but it is not.