linux/drivers/net/wireless
Ralf Baechle adeab1afb7 NET: Fix locking issues in PPP, 6pack, mkiss and strip line disciplines.
Guido Trentalancia reports:

I am trying to use the kiss driver in the Linux kernel that is being
shipped with Fedora 10 but unfortunately I get the following oops:

mkiss: AX.25 Multikiss, Hans Albas PE1AYX
mkiss: ax0: crc mode is auto.
ADDRCONF(NETDEV_CHANGE): ax0: link becomes ready
------------[ cut here ]------------
WARNING: at kernel/softirq.c:77 __local_bh_disable+0x2f/0x83() (Not
tainted)
[...]
unloaded: microcode]
Pid: 0, comm: swapper Not tainted 2.6.27.25-170.2.72.fc10.i686 #1
 [<c042ddfb>] warn_on_slowpath+0x65/0x8b
 [<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
 [<c04228b4>] ? __enqueue_entity+0xe3/0xeb
 [<c042431e>] ? enqueue_entity+0x203/0x20b
 [<c0424361>] ? enqueue_task_fair+0x3b/0x3f
 [<c041f88c>] ? resched_task+0x3a/0x6e
 [<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
 [<c06ab4e2>] ? _spin_lock_bh+0xb/0x16
 [<c043255b>] __local_bh_disable+0x2f/0x83
 [<c04325ba>] local_bh_disable+0xb/0xd
 [<c06ab4e2>] _spin_lock_bh+0xb/0x16
 [<f8b6f600>] mkiss_receive_buf+0x2fb/0x3a6 [mkiss]
 [<c0572a30>] flush_to_ldisc+0xf7/0x198
 [<c0572b12>] tty_flip_buffer_push+0x41/0x51
 [<f89477f2>] ftdi_process_read+0x375/0x4ad [ftdi_sio]
 [<f8947a5a>] ftdi_read_bulk_callback+0x130/0x138 [ftdi_sio]
 [<c05d4bec>] usb_hcd_giveback_urb+0x63/0x93
 [<c05ea290>] uhci_giveback_urb+0xe5/0x15f
 [<c05eaabf>] uhci_scan_schedule+0x52e/0x767
 [<c05f6288>] ? psmouse_handle_byte+0xc/0xe5
 [<c054df78>] ? acpi_ev_gpe_detect+0xd6/0xe1
 [<c05ec5b0>] uhci_irq+0x110/0x125
 [<c05d4834>] usb_hcd_irq+0x40/0xa3
 [<c0465313>] handle_IRQ_event+0x2f/0x64
 [<c046642b>] handle_level_irq+0x74/0xbe
 [<c04663b7>] ? handle_level_irq+0x0/0xbe
 [<c0406e6e>] do_IRQ+0xc7/0xfe
 [<c0405668>] common_interrupt+0x28/0x30
 [<c056821a>] ? acpi_idle_enter_simple+0x162/0x19d
 [<c0617f52>] cpuidle_idle_call+0x60/0x92
 [<c0403c61>] cpu_idle+0x101/0x134
 [<c069b1ba>] rest_init+0x4e/0x50
 =======================
---[ end trace b7cc8076093467ad ]---
------------[ cut here ]------------
WARNING: at kernel/softirq.c:136 _local_bh_enable_ip+0x3d/0xc4()
[...]
Pid: 0, comm: swapper Tainted: G        W 2.6.27.25-170.2.72.fc10.i686
 [<c042ddfb>] warn_on_slowpath+0x65/0x8b
 [<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
 [<c04228b4>] ? __enqueue_entity+0xe3/0xeb
 [<c042431e>] ? enqueue_entity+0x203/0x20b
 [<c0424361>] ? enqueue_task_fair+0x3b/0x3f
 [<c041f88c>] ? resched_task+0x3a/0x6e
 [<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
 [<c06ab4e2>] ? _spin_lock_bh+0xb/0x16
 [<f8b6f642>] ? mkiss_receive_buf+0x33d/0x3a6 [mkiss]
 [<c04325f9>] _local_bh_enable_ip+0x3d/0xc4
 [<c0432688>] local_bh_enable_ip+0x8/0xa
 [<c06ab54d>] _spin_unlock_bh+0x11/0x13
 [<f8b6f642>] mkiss_receive_buf+0x33d/0x3a6 [mkiss]
 [<c0572a30>] flush_to_ldisc+0xf7/0x198
 [<c0572b12>] tty_flip_buffer_push+0x41/0x51
 [<f89477f2>] ftdi_process_read+0x375/0x4ad [ftdi_sio]
 [<f8947a5a>] ftdi_read_bulk_callback+0x130/0x138 [ftdi_sio]
 [<c05d4bec>] usb_hcd_giveback_urb+0x63/0x93
 [<c05ea290>] uhci_giveback_urb+0xe5/0x15f
 [<c05eaabf>] uhci_scan_schedule+0x52e/0x767
 [<c05f6288>] ? psmouse_handle_byte+0xc/0xe5
 [<c054df78>] ? acpi_ev_gpe_detect+0xd6/0xe1
 [<c05ec5b0>] uhci_irq+0x110/0x125
 [<c05d4834>] usb_hcd_irq+0x40/0xa3
 [<c0465313>] handle_IRQ_event+0x2f/0x64
 [<c046642b>] handle_level_irq+0x74/0xbe
 [<c04663b7>] ? handle_level_irq+0x0/0xbe
 [<c0406e6e>] do_IRQ+0xc7/0xfe
 [<c0405668>] common_interrupt+0x28/0x30
 [<c056821a>] ? acpi_idle_enter_simple+0x162/0x19d
 [<c0617f52>] cpuidle_idle_call+0x60/0x92
 [<c0403c61>] cpu_idle+0x101/0x134
 [<c069b1ba>] rest_init+0x4e/0x50
 =======================
---[ end trace b7cc8076093467ad ]---
mkiss: ax0: Trying crc-smack
mkiss: ax0: Trying crc-flexnet

The issue was, that the locking code in mkiss was assuming it was only
ever being called in process or bh context.  Fixed by converting the
involved locking code to use irq-safe locks.

Review of other networking line disciplines shows that 6pack, both sync
and async PPP and STRIP have similar issues.  The ppp_async one is the
most interesting one as it sorts out half of the issue as far back as
2004 in commit http://git.kernel.org/?p=linux/kernel/git/tglx/history.git;a=commitdiff;h=2996d8deaeddd01820691a872550dc0cfba0c37d

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Reported-by: Guido Trentalancia <guido@trentalancia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-12 21:09:20 -07:00
..
ath Atheros Kconfig needs to be dependent on WLAN_80211 2009-07-08 15:24:29 -04:00
b43 b43: Add support for 4318E 2009-07-08 15:24:24 -04:00
b43legacy b43/b43legacy: fix radio LED initialization 2009-07-07 12:55:26 -04:00
hostap Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-06-15 03:02:23 -07:00
ipw2x00 net: use symbolic values for ndo_start_xmit() return codes 2009-06-13 01:18:50 -07:00
iwlwifi iwlwifi/iwl3945: fix suspend resume association bug 2009-06-15 15:05:53 -04:00
iwmc3200wifi iwmc3200wifi: add Kconfig help 2009-07-07 12:55:27 -04:00
libertas Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2009-06-18 14:07:15 -07:00
libertas_tf mac80211: unify config_interface and bss_info_changed 2009-05-06 15:14:36 -04:00
orinoco netdev: restore MAC address set and validate operations 2009-07-12 14:20:02 -07:00
p54 p54: tx refused but queue active 2009-07-08 15:24:30 -04:00
prism54 net: fix network drivers ndo_start_xmit() return values (part 3) 2009-06-13 01:18:37 -07:00
rt2x00 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-06-15 03:02:23 -07:00
rtl818x Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-06-03 02:43:41 -07:00
wl12xx wireless: WL12XX should depend on GENERIC_HARDIRQS 2009-05-11 15:23:54 -04:00
zd1211rw zd1211rw: adding SONY IFU-WLM2 (054c:0257) as a zd1211b device 2009-07-08 15:24:23 -04:00
adm8211.c mac80211: unify config_interface and bss_info_changed 2009-05-06 15:14:36 -04:00
adm8211.h
airo_cs.c
airo.c net: use symbolic values for ndo_start_xmit() return codes 2009-06-13 01:18:50 -07:00
airo.h
arlan-main.c net: use symbolic values for ndo_start_xmit() return codes 2009-06-13 01:18:50 -07:00
arlan-proc.c
arlan.h
at76c50x-usb.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-06-03 02:43:41 -07:00
at76c50x-usb.h
atmel_cs.c Wireless: remove driver_data direct access of struct device 2009-05-06 15:15:01 -04:00
atmel_pci.c
atmel.c net: use symbolic values for ndo_start_xmit() return codes 2009-06-13 01:18:50 -07:00
atmel.h
i82586.h
i82593.h
Kconfig Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-06-15 03:02:23 -07:00
mac80211_hwsim.c mac80211_hwsim: avoid NULL access 2009-07-08 15:24:26 -04:00
Makefile iwmc3200wifi: Add new Intel Wireless Multicomm 802.11 driver 2009-05-22 14:06:02 -04:00
mwl8k.c mac80211: move HT operation mode BSS info 2009-05-11 15:23:57 -04:00
netwave_cs.c
ray_cs.c net: use symbolic values for ndo_start_xmit() return codes 2009-06-13 01:18:50 -07:00
ray_cs.h
rayctl.h
rndis_wlan.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-06-15 03:02:23 -07:00
strip.c NET: Fix locking issues in PPP, 6pack, mkiss and strip line disciplines. 2009-07-12 21:09:20 -07:00
wavelan_cs.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-06-15 03:02:23 -07:00
wavelan_cs.h
wavelan_cs.p.h
wavelan.c net: use symbolic values for ndo_start_xmit() return codes 2009-06-13 01:18:50 -07:00
wavelan.h
wavelan.p.h
wl3501_cs.c net: fix network drivers ndo_start_xmit() return values (part 3) 2009-06-13 01:18:37 -07:00
wl3501.h
zd1201.c net: fix network drivers ndo_start_xmit() return values (part 3) 2009-06-13 01:18:37 -07:00
zd1201.h