lwfinger / rtl8192du

Source code for RTL8192DU device
77 stars 52 forks source link

kernel crash on ARM after ifconfig up #14

Open sporockel opened 10 years ago

sporockel commented 10 years ago

Hi, I've tried to get a RTL8192Du running on a ARM platform, kernel 3.14.0-rc6. The same with 3.12.0. Any idea where to start searching?

insmod /lib/modules/3.14.0-rc6/kernel/drivers/net/wireless/8192du.ko
[ 1507.776697] r8192du: EEPROM type is E-FUSE, E-CUT chip
[ 1508.023634] r8192du: MacPhyMode: SINGLEMAC_SINGLEPHY
[ 1508.055153] usbcore: registered new interface driver rtl8192du

ifconfig wlan1 up

[ 1517.392721] 
[ 1517.394324] =============================================
[ 1517.399964] [ INFO: possible recursive locking detected ]
[ 1517.405609] 3.14.0-rc6 #1 Tainted: G           O
[ 1517.410427] ---------------------------------------------
[ 1517.416065] ifconfig/184 is trying to acquire lock:
[ 1517.421159]  (pmutex){+.+...}, at: [<bf0a9ec8>] usbctrl_vendorreq+0xac/0x208 [8192du]
[ 1517.429727] 
[ 1517.429727] but task is already holding lock:
[ 1517.435824]  (pmutex){+.+...}, at: [<bf0ac6dc>] netdev_open+0x1c/0x3c [8192du]
[ 1517.443565] 
[ 1517.443565] other info that might help us debug this:
[ 1517.450384]  Possible unsafe locking scenario:
[ 1517.450384] 
[ 1517.456564]        CPU0
[ 1517.459117]        ----
[ 1517.461669]   lock(pmutex);
[ 1517.464600]   lock(pmutex);
[ 1517.467531] 
[ 1517.467531]  *** DEADLOCK ***
[ 1517.467531] 
[ 1517.473716]  May be due to missing lock nesting notation
[ 1517.473716] 
[ 1517.480807] 2 locks held by ifconfig/184:
[ 1517.484991]  #0:  (rtnl_mutex){+.+.+.}, at: [<c045cb58>] devinet_ioctl+0xd0/0x764
[ 1517.492867]  #1:  (pmutex){+.+...}, at: [<bf0ac6dc>] netdev_open+0x1c/0x3c [8192du]
[ 1517.501043] 
[ 1517.501043] stack backtrace:
[ 1517.505606] CPU: 0 PID: 184 Comm: ifconfig Tainted: G           O 3.14.0-rc6 #1
[ 1517.513279] [<c00137b8>] (unwind_backtrace) from [<c00115bc>] (show_stack+0x10/0x14)
[ 1517.521386] [<c00115bc>] (show_stack) from [<c0068bb8>] (validate_chain.isra.33+0xd6c/0x1178)
[ 1517.530302] [<c0068bb8>] (validate_chain.isra.33) from [<c006a1a4>] (__lock_acquire+0x3cc/0xae4)
[ 1517.539485] [<c006a1a4>] (__lock_acquire) from [<c006b060>] (lock_acquire+0x68/0x7c)
[ 1517.547589] [<c006b060>] (lock_acquire) from [<c051fd6c>] (mutex_lock_nested+0x54/0x3a0)
[ 1517.556189] [<c051fd6c>] (mutex_lock_nested) from [<bf0a9ec8>] (usbctrl_vendorreq+0xac/0x208 [8192du])
[ 1517.566158] [<bf0a9ec8>] (usbctrl_vendorreq [8192du]) from [<bf0aa08c>] (usb_write_reg+0x68/0x70 [8192du])
[ 1517.576486] [<bf0aa08c>] (usb_write_reg [8192du]) from [<bf0aa15c>] (usb_write8+0x20/0x28 [8192du])
[ 1517.586134] [<bf0aa15c>] (usb_write8 [8192du]) from [<bf06c708>] (_rtw_write8+0x1c/0x24 [8192du])
[ 1517.595597] [<bf06c708>] (_rtw_write8 [8192du]) from [<bf0a4bfc>] (rtl8192du_hal_init+0x164/0xb38 [8192du])
[ 1517.605995] [<bf0a4bfc>] (rtl8192du_hal_init [8192du]) from [<bf0922c8>] (rtw_hal_init+0x30/0x114 [8192du])
[ 1517.616396] [<bf0922c8>] (rtw_hal_init [8192du]) from [<bf0ac330>] (_netdev_open+0x98/0x428 [8192du])
[ 1517.626266] [<bf0ac330>] (_netdev_open [8192du]) from [<bf0ac6e4>] (netdev_open+0x24/0x3c [8192du])
[ 1517.635853] [<bf0ac6e4>] (netdev_open [8192du]) from [<c0407008>] (__dev_open+0xb8/0x11c)
[ 1517.644409] [<c0407008>] (__dev_open) from [<c0407290>] (__dev_change_flags+0x94/0x168)
[ 1517.652780] [<c0407290>] (__dev_change_flags) from [<c040737c>] (dev_change_flags+0x18/0x48)
[ 1517.661602] [<c040737c>] (dev_change_flags) from [<c045d11c>] (devinet_ioctl+0x694/0x764)
[ 1517.670169] [<c045d11c>] (devinet_ioctl) from [<c03ee2cc>] (sock_ioctl+0x1d8/0x2a8)
[ 1517.678181] [<c03ee2cc>] (sock_ioctl) from [<c00e9c68>] (do_vfs_ioctl+0x3fc/0x5f0)
[ 1517.686093] [<c00e9c68>] (do_vfs_ioctl) from [<c00e9ec8>] (SyS_ioctl+0x6c/0x7c)
[ 1517.693736] [<c00e9ec8>] (SyS_ioctl) from [<c000e340>] (ret_fast_syscall+0x0/0x48)
[ 1517.708668] r8192du: MacPhyMode: SINGLEMAC_SINGLEPHY
[ 1517.771356] r8192du: Loaded firmware file rtlwifi/rtl8192dufw.bin of 32302 bytes
[ 1519.031042] pdmpriv->TxPowerTrackControl = 1
[ 1519.049144] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
lwfinger commented 10 years ago

What crash? That lock dependency warning does not interrupt operations. If you do not ewant to see it, turn off lock dependency checking in your kernel.

If I knew what to fix, I would do it; however, I have more important thingd to look after.

sporockel commented 10 years ago

ok, it's not a crash, however iw list does not show a wireless interface and I thought it may have to do with the output. Maybe I'm overlooking something.

lwfinger commented 10 years ago

I do not see anything either.

Which branch of the repo are you running? If you are not using the kernel-version branch, please switch to it.

The only difference I see in your device is that yours is SINGLEMAC_SINGLEPHY while mine is DOUBLEMAC_DOUBLEPHY. That means I have both 2.4 GHz and 5 GHz radios, and both can work at the same time. It shouldn't make a difference, but who knows.

sporockel commented 10 years ago

it tried both, but there is no difference. I'm going to do further investigations in April, now it's vacation time :-). Thanks for reply

lwfinger commented 10 years ago

Have a good vacation. When you return, it will be better if you use the keernel-version branch as that is the one I am currently working on.

mun1r commented 10 years ago

hi lwfinger.how to compile the kernel-version branch.I have an error when make process.my kernel version is 3.2.0-60-generic

lwfinger commented 10 years ago

The kernel-version branch is only for kernel 3.14, although 3.13 may work. For old kernels such as 3.0, you must use the master branch!

mun1r commented 10 years ago

Oh i see thank you

sporockel commented 10 years ago

Hello,

I can confirm with latest kernel-version (#489e933c98f45ca793a995f747282d764c020b5e) the issue is gone.

okligaofeng commented 8 years ago

我也遇到了相同的问题最后解决了,我这边的原因:1.内核抢占模式为Low-Latency Desktop,改为自主强占 2.DEBUG_SPINLOCK需要禁掉,满足1.2才可以实现unlock and unlock_irq functions are inlined,说到底都是因为IO Schedulers不同造成的

lwfinger commented 8 years ago

I used Google Translate as I do not read Chinese to get the following:

"I also encountered the same problem finally solved, my side of reasons: 1. kernel preemption mode as Low-Latency Desktop, need to customize the seizure 2.DEBUG_SPINLOCK ban to meet before they can achieve 1.2 unlock and unlock_irq functions are inlined in the final analysis are caused because different IO Schedulers"

Sorry, but I do not understand what you are saying. Is there a patch that solves the problem? If so, perhaps I can understand it.

okligaofeng commented 8 years ago

kernel .config patch: @@ -219,7 +214,11 @@ CONFIG_IOSCHED_CFQ=y CONFIG_DEFAULT_CFQ=y

CONFIG_DEFAULT_NOOP is not set

CONFIG_DEFAULT_IOSCHED="cfq" -CONFIG_UNINLINE_SPIN_UNLOCK=y +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y +CONFIG_INLINE_READ_UNLOCK=y +CONFIG_INLINE_READ_UNLOCK_IRQ=y +CONFIG_INLINE_WRITE_UNLOCK=y +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y CONFIG_FREEZER=y

-# CONFIG_PREEMPT_VOLUNTARY is not set -CONFIG_PREEMPT=y -CONFIG_PREEMPT_COUNT=y +CONFIG_PREEMPT_VOLUNTARY=y +# CONFIG_PREEMPT is not set CONFIG_HZ_FIXED=0

Sorry, My English poll. I have found the solution . The issues to be further . I just know the issues to be caused by spinlock.