linux_dsm_epyc7002/drivers/net/wireless/ath/ath6kl
Mohammed Shafi Shajakhan de2070fc4a ath6kl: Fix kernel panic on continuous driver load/unload
On continuous loading and unloading of AR6004 ath6kl USB
driver it triggers a panic due to NULL pointer dereference of
'target' pointer.

while true; do sudo modprobe -v ath6kl_core;
sudo modprobe -v ath6kl_usb; sudo modprobe -r usb;
sudo modprobe -r ath6kl_core; done

ar->htc_target can be NULL due to a race condition that can occur
during driver initialization(we do 'ath6kl_hif_power_on' before
initializing 'ar->htc_target' via 'ath6kl_htc_create').
'ath6kl_hif_power_on' assigns 'ath6kl_recv_complete' as
usb_complete_t/callback function for 'usb_fill_bulk_urb'.
Thus the possibility of ar->htc_target being NULL
via ath6kl_recv_complete -> ath6kl_usb_io_comp_work
before even 'ath6kl_htc_create' is finished to initialize
ar->htc_create.

Worth noting is the obvious solution  of doing 'ath6kl_hif_power_on'
later(i.e after we are done with 'ath6kl_htc_create', causes a
h/w bring up failure in AR6003 SDIO, as 'ath6kl_hif_power_on' is a
pre-requisite to get the target version 'ath6kl_bmi_get_target_info'.
So simply check for NULL pointer for 'ar->htc_target' and bail out.

[23614.518282] BUG: unable to handle kernel NULL pointer dereference at
00000904
[23614.518463] IP: [<c012e7a6>] __ticket_spin_trylock+0x6/0x30
[23614.518570] *pde = 00000000
[23614.518664] Oops: 0000 [#1] SMP
[23614.518795] Modules linked in: ath6kl_usb(O+) ath6kl_core(O)
[23614.520012] EIP: 0060:[<c012e7a6>] EFLAGS: 00010286 CPU: 0
[23614.520012] EIP is at __ticket_spin_trylock+0x6/0x30
Call Trace:
	[<c03f2a44>] do_raw_spin_trylock+0x14/0x40
	[<c06daa12>] _raw_spin_lock_bh+0x52/0x80
	[<f85464b4>] ? ath6kl_htc_pipe_rx_complete+0x3b4/0x4c0 [ath6kl_core]
	[<f85464b4>] ath6kl_htc_pipe_rx_complete+0x3b4/0x4c0 [ath6kl_core]
	[<c05bc272>] ? skb_dequeue+0x22/0x70
	[<c05bc272>] ? skb_dequeue+0x22/0x70
	[<f855bb32>] ath6kl_core_rx_complete+0x12/0x20 [ath6kl_core]
	[<f848771a>] ath6kl_usb_io_comp_work+0xaa/0xb0 [ath6kl_usb]
	[<c015b863>] process_one_work+0x1a3/0x5e0
	[<c015b7e7>] ? process_one_work+0x127/0x5e0
	[<f8487670>] ? ath6kl_usb_reset_resume+0x30/0x30 [ath6kl_usb]
	[<c015bfde>] worker_thread+0x11e/0x3f0
	Kernel panic - not syncing: Fatal exception in interrupt

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2012-11-27 21:44:27 +02:00
..
bmi.c ath6kl: alignment should match open parenthesis 2012-03-07 20:03:57 +02:00
bmi.h ath6kl: make ath6kl_bmi_[read|write]_hi32() endian safe 2012-03-07 20:04:00 +02:00
cfg80211.c ath6kl: Fix a mismatch in power management debug message 2012-11-16 13:18:41 +02:00
cfg80211.h ath6kl: rework scheduled scan 2012-10-24 11:49:46 +03:00
common.h ath6kl: Configure htcap in fw based on the channel type in AP mode 2012-04-09 18:25:56 +03:00
core.c ath6kl: Make fw error recovery configurable 2012-10-24 11:49:49 +03:00
core.h ath6kl: Add a hardware flag for SDIO CRC error workaround 2012-10-24 11:49:57 +03:00
debug.c Merge branch 'for-linville' of git://github.com/kvalo/ath6kl 2012-05-16 10:57:32 -04:00
debug.h ath6kl: Recover from fw crash 2012-10-24 11:49:48 +03:00
hif-ops.h ath6kl: Add HTC pipe implementation 2012-03-26 16:36:46 +03:00
hif.c drivers/net/wireless/ath/ath6kl/hif.c: drop if around WARN_ON 2012-11-16 13:38:48 +02:00
hif.h ath6kl: Add HTC pipe implementation 2012-03-26 16:36:46 +03:00
htc_mbox.c ath6kl: Remove obselete USB device related checks 2012-10-24 11:49:56 +03:00
htc_pipe.c ath6kl: Fix kernel panic on continuous driver load/unload 2012-11-27 21:44:27 +02:00
htc-ops.h ath6kl: add htc ops 2012-03-26 16:36:46 +03:00
htc.h ath6kl: Add HTC pipe implementation 2012-03-26 16:36:46 +03:00
init.c ath6kl: Remove erroneous flag clearing 2012-11-27 21:44:27 +02:00
Kconfig ath6kl: add support for changing contry code 2012-10-24 11:49:37 +03:00
main.c ath6kl: Blocked client notification 2012-10-24 11:49:54 +03:00
Makefile ath6kl: Recover from fw crash 2012-10-24 11:49:48 +03:00
recovery.c ath6kl: Make fw error recovery configurable 2012-10-24 11:49:49 +03:00
sdio.c ath6kl: fix uninitialized variable in ath6kl_sdio_enable_scatter() 2012-10-24 11:49:50 +03:00
target.h ath6kl: Fix missing gpio pin 9 configuration 2012-05-24 10:11:06 +03:00
testmode.c ath6kl: Stop using NLA_PUT*(). 2012-04-02 04:33:44 -04:00
testmode.h ath6kl: Update license header 2012-02-08 11:31:31 +02:00
txrx.c ath6kl: Check for valid endpoint ID in ath6kl_tx_complete() 2012-10-24 11:49:55 +03:00
usb.c ath6kl: remove unnecessary check for NULL skb 2012-11-27 21:44:27 +02:00
wmi.c ath6kl: remove unnecessary check for NULL skb 2012-11-27 21:44:27 +02:00
wmi.h ath6kl: Add support to detect fw error through heart beat 2012-10-24 11:49:48 +03:00