jernejsk / OpenELEC-OPi2

OpenELEC - The living room PC for everyone
http://openelec.tv
87 stars 25 forks source link

kernel panic with wireless modules #11

Closed tmpdo closed 8 years ago

tmpdo commented 8 years ago

I successfully built rt2800 and 8188eu modules for my OPiPC, but when i load it then kenel panics: [ 315.332006] ------------[ cut here ]------------ [ 315.332083] WARNING: at net//wireless/reg.c:401 regulatory_init+0xa0/0x134 [cfg80211]() [ 315.332093] db.txt is empty, you should update it... [ 315.332100] Modules linked in: cfg80211(O+) 8021q mali(O) ump(O) [ 315.332147] from [ 315.332168] from [ 315.332186] from [ 315.332242] from [](regulatory_init+0xa0/0x134 [cfg80211]) [ 315.332335] [](regulatory_init+0xa0/0x134 [cfg80211]) from [](cfg80211_init+0x60/0xd0 [cfg80211]) [ 315.332391] [](cfg80211_init+0x60/0xd0 [cfg80211]) from [ 315.332414] from [ 315.332435] from [ 315.332449] ---[ end trace 75e9594b395cf7e3 ]--- [ 315.332512] cfg80211: Calling CRDA to update world regulatory domain [ 331.050303] lib80211: common routines for IEEE802.11 drivers [ 331.050321] lib80211_crypt: registered algorithm 'NULL' [ 355.184012] RTL871X: module init start [ 355.184032] RTL871X: rtl8188eu v4.3.0.6_12167.20140828 [ 355.184040] RTL871X: build time: Jan 14 2016 17:09:10 [ 355.184054] sw_usb_enable_hcd: usbc_num = 2 [ 355.184061] notice: set wl_reg_on 0 to power on 8188eu in sun8iw7p1! [ 355.184071] [wifi_pm]: wrong module select 0 ! [ 355.194085] hci: ERR: sunxi_ehci is already enable, can not enable again [ 355.194100] hci: ERR: sunxi_ohci is already enable, can not enable again [ 355.199090] bFWReady == _FALSE call reset 8051... [ 355.252054] Unable to handle kernel NULL pointer dereference at virtual address 00000000 [ 355.252072] pgd = e5840000 [ 355.252079] [00000000] pgd=64eb4831, pte=00000000, *ppte=00000000 [ 355.252102] Internal error: Oops: 817 [#1] PREEMPT SMP ARM [ 355.258206] Modules linked in: 8188eu(O+) mac80211(O) lib80211(O) cfg80211(O) 8021q mali(O) ump(O) [ 355.261676] CPU: 1 Tainted: G W O (3.4.39 #1) [ 355.261676] PC is at memcpy+0xb4/0x330 [ 355.261676] LR is at 0xbefa540 [ 355.261676] pc : [] lr : [<0befa540>] psr: 00070013 [ 355.261676] sp : e62afcec ip : 0000001c fp : e62afd14 [ 355.261676] r10: 00004580 r9 : 0000469f r8 : ee6f5000 [ 355.261676] r7 : 00000000 r6 : ee6f5000 r5 : edef4000 r4 : f0fd3000 [ 355.261676] r3 : f0fd3000 r2 : ffffffe6 r1 : f0fd648c r0 : 00000000 [ 355.261676] Flags: nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user [ 355.261676] Control: 10c5387d Table: 6584006a DAC: 00000015 [ 355.261676] [ 355.261676] PC: 0xc029dd34: [ 355.261676] dd34 f5d1f01c ba000002 f5d1f03c f5d1f05c f5d1f07c e8b151f8 e2522020 e8a051f8 [ 355.261676] dd54 aafffffa e3720060 aafffff9 e212c01c e26cc020 108ff00c ea000011 e320f000

It seems any usb or other subsystem missed in kernel. Kould u please build 8188eu, r2800usb, cfg80211 modules in feature?

jernejsk commented 8 years ago

How did you compile your drivers? Driver 8189es for native OPi2 wifi works well, also usb wifi dongle 8192cu works. Unfortunatelly I don't have any 8188eu or r2800usb dongle.

tmpdo commented 8 years ago

I took kernel from your repo and built modules with my own cross-compiler. cfg80211 module loading ok, but 8188 crashes kernel. I think my kernel config broken, so, please, try include this modules with your build

jernejsk commented 8 years ago

How did you manage to compile this driver? Which patches did you use?

jernejsk commented 8 years ago

I think I managed to enable both wifi drivers you requested. Can you please fetch latest changes and try if it works now?

tmpdo commented 8 years ago

stuck on pulseaudio build: /usr/lib/libgcc_s.so: file not recognized: File format not recognized collect2: error: ld returned 1 exit status libtool: install: error: relink `libpulse-simple.la' with the above command before installing it Makefile:4895: recipe for target 'install-libLTLIBRARIES' failed make[5]: *\ [install-libLTLIBRARIES] Error 1

jernejsk commented 8 years ago

Try clean build - delete build directory.

tmpdo commented 8 years ago

Already done, same error

jernejsk commented 8 years ago

I never had such problem. I did clean build on Kubuntu 15.10 and everything built smoothly.

tmpdo commented 8 years ago

seems my PKG_CONFIG broken. will try add some extra options to mk script for pulseaudio

tmpdo commented 8 years ago

Upgraded to latest commit, module loads ok, but now i get firmware loading error: for 8188eu: [ 18.328691] Chip Version Info: CHIP_8188E_Normal_Chip_TSMC_UNKNOWN_CUT(10)_1T1R_RomVer(0) [ 18.361991] EEPROM ID = 0x8129 [ 18.364602] usbcore: registered new interface driver r8188eu [ 82.080183] Request firmware failed with error 0xfffffffe firmware at place: -rw-rw-r-- 1 root root 13904 Jan 15 2016 /lib/firmware/rtlwifi/rtl8188eufw.bin for ralink3572 dongle: [ 402.020108] usb 3-1: new high-speed USB device number 3 using sunxi-ehci [ 402.214450] cfg80211: Calling CRDA to update world regulatory domain [ 402.214510] cfg80211: World regulatory domain updated: [ 402.214522] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) [ 402.214535] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (2000 mBi, 0 mBm) [ 402.214546] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (2000 mBi, 0 mBm) [ 402.214557] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (2000 mBi, 0 mBm) [ 402.214568] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (2000 mBi, 0 mBm) [ 402.214584] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz), (2000 mBi, 0 mBm) [ 402.214595] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (2000 mBi, 0 mBm) [ 402.214606] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (2000 mBi, 0 mBm) [ 402.214616] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm) [ 402.380187] usb 3-1: reset high-speed USB device number 3 using sunxi-ehci [ 402.556717] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht' [ 402.558004] Registered led device: rt2800usb-phy0::radio [ 402.558112] Registered led device: rt2800usb-phy0::assoc [ 402.558208] Registered led device: rt2800usb-phy0::quality [ 402.558346] usbcore: registered new interface driver rt2800usb [ 463.040284] phy0 -> rt2x00lib_request_firmware: Error - Failed to request Firmware. firmware at place: -rw-rw-r-- 1 root root 8192 Jan 15 2016 /lib/firmware/rt2870.bin

jernejsk commented 8 years ago

This is systemd's fault. It doesn't support loading FW anymore and must be loaded by kernel. However, at least kernel 3.7 is needed for this to work. This kind of troubles are one reason I almost give up on the project. I won't fix this quickly, if at all. The best way for now would be to port FW loading from older systemd versions. If you do this, please send me a patch.

tmpdo commented 8 years ago

Where i can find tech drama's about it?

jernejsk commented 8 years ago

Just search for "systemd firmware loading" and you will get a lot of hits.

tmpdo commented 8 years ago

Is it https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1398458 ? As i can undrstand, best way roll back kernel helper?

jernejsk commented 8 years ago

Yes, this is one of the reports.

You have few choices:

  1. backport kernel support for loading FW from 3.7
  2. downgrade systemd to 216 (or 215, not sure)
  3. port support for FW loading to used systemd.

Choose whatever you like. Second options may seem easy, but be aware that other parts of the system may be affected. I would go for third option...

jernejsk commented 8 years ago

I stumbled on patch which backported FW loading functionality. I tested it and works for my ath9k_htc wifi card. Can you test it please and close the issue if it works?

tmpdo commented 8 years ago

Still cant build image with wrong linker in pulseaudio. So will wait for your build.

jernejsk commented 8 years ago

It is not in my interest to put every image after each commit on the internet. Those last images were done after a month or even more. I'm considering to pause this project for a longer period, so it would probably be in your interest to fix build issue on your end.

jernejsk commented 8 years ago

After multiple confirmations that wifi works I will close this issue.