Return-path: Received: from mail-ie0-f175.google.com ([209.85.223.175]:44598 "EHLO mail-ie0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753976AbaAaQZB (ORCPT ); Fri, 31 Jan 2014 11:25:01 -0500 Received: by mail-ie0-f175.google.com with SMTP id ar20so4373393iec.6 for ; Fri, 31 Jan 2014 08:25:01 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1391149038.22155.33.camel@porter.coelho.fi> References: <1391149038.22155.33.camel@porter.coelho.fi> Date: Fri, 31 Jan 2014 11:25:00 -0500 Message-ID: (sfid-20140131_172533_933440_195616D9) Subject: Re: wlcore-spi crash From: Charles To: Luca Coelho Cc: linux-wireless Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-wireless-owner@vger.kernel.org List-ID: Thanks Luca, > > Try this: > > > diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c > index b2c018d..1278583 100644 > --- a/drivers/net/wireless/ti/wlcore/spi.c > +++ b/drivers/net/wireless/ti/wlcore/spi.c > @@ -316,6 +316,16 @@ static int __must_check wl12xx_spi_raw_write(struct device *child, int addr, > return 0; > } > > +static int wl12xx_spi_power(struct device *child, bool enable) > +{ > + struct wl12xx_spi_glue *glue = dev_get_drvdata(child->parent); > + struct wlcore_platdev_data *pdev_data = glue->core->dev.platform_data; > + > + pdev_data->pdata->set_power(enable); > + > + return 0; > +} > + > static struct wl1271_if_operations spi_ops = { > .read = wl12xx_spi_raw_read, > .write = wl12xx_spi_raw_write, > > Note that this is only compile-tested, so I have no clue if it really > works. > > I'm *not* saying this is the right way to do it, I just hacked it up > quickly. > I know there are not many wl1271 spi users out there, so I'm not sure how far down this lonely road I'll head, but we'll see. Yes this compiles as you say. But wlcore_spi crashes when I load it: root@sbc:~# modprobe wl12xx [ 72.602903] Disabling lock debugging due to kernel taint [ 72.616192] Loading modules backported from Linux version v3.12.8-0-g97f15f1 [ 72.623593] Backport generated by backports.git v3.12.8-1-0-geb41fad [ 72.723635] cfg80211: Calling CRDA to update world regulatory domain root@sbc:~# lsmod Module Size Used by wl12xx 47146 0 wlcore 164050 1 wl12xx mac80211 290411 2 wlcore,wl12xx cfg80211 194677 2 mac80211,wlcore compat 11642 4 cfg80211,mac80211,wlcore,wl12xx autofs4 24712 2 root@sbc:~# modprobe wlcore_spi root@sbc:~# [ 102.873513] wlcore: loaded [ 106.609236] Unable to handle kernel paging request at virtual address 00203fec [ 106.616801] pgd = cf6bc000 [ 106.619626] [00203fec] *pgd=00000000 [ 106.623370] Internal error: Oops: 5 [#1] [ 106.627464] Modules linked in: wlcore_spi(O) crc7 wl12xx(O) wlcore(O) mac80211(O) cfg80211(O) compat(O) autofs4 [ 106.638055] CPU: 0 Tainted: G O (3.2.0-) [ 106.646535] PC is at omap2_mcspi_transfer+0x3c/0x410 [ 106.651725] LR is at __spi_async+0xb4/0xc0 [ 106.656006] pc : [] lr : [] psr: a0000093 [ 106.656015] sp : cd015a00 ip : cd015a48 fp : cd015a44 [ 106.668005] r10: 00000000 r9 : cd015b08 r8 : cd015adc [ 106.673463] r7 : cf099344 r6 : cf099200 r5 : 00000000 r4 : 60000013 [ 106.680283] r3 : c029e6ec r2 : 00203ff0 r1 : cd015adc r0 : cf099000 [ 106.687105] Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user [ 106.694653] Control: 10c5387d Table: 8f6bc019 DAC: 00000015 [ 106.700657] Process ifconfig (pid: 1679, stack limit = 0xcd0142f0) [ 106.707112] Stack: (0xcd015a00 to 0xcd016000) [ 106.711670] 5a00: c044a9bc c044b298 cd015ae0 00000001 cf3ceb80 cf099000 00100100 60000013 [ 106.720220] 5a20: 00000000 cf099200 cf099344 cd015adc cd015b08 00000000 cd015a64 cd015a48 [ 106.728770] 5a40: c029e280 c02a021c 00000000 60000013 cd015a84 cf099000 cd015a7c cd015a68 [ 106.737321] 5a60: c029e2dc c029e1d8 00000000 cd015adc cd015aac cd015a80 c029e528 c029e2d0 [ 106.745871] 5a80: c029e568 00000000 cd015a88 cd015a88 0000000a 00000000 cd015c4c cd08c000 [ 106.754423] 5aa0: cd015abc cd015ab0 c029e568 c029e4a4 cd015c9c cd015ac0 bf10145c c029e560 [ 106.762972] 5ac0: cd04f680 00004000 00000000 1ff80000 1ff80ffc 1ff81ff8 1ff82ff4 00203ff0 [ 106.771522] 5ae0: cd015c68 cf099000 00000000 c029e6ec cd015a84 00000000 00000000 00000000 [ 106.780073] 5b00: 00000000 00000000 cd015acc 00000000 00000004 00000000 00000000 00000000 [ 106.788621] 5b20: 00000000 cd015b48 cd015adc cd088000 00000000 00000ffc 00000000 00000000 [ 106.797172] 5b40: 00000000 00000000 cd015b6c cd015b24 cd015ad0 00000000 00000004 00000000 [ 106.805722] 5b60: 00000000 00000000 00000000 cd015b90 cd015b48 cd088ffc 00000000 00000ffc [ 106.814271] 5b80: 00000000 00000000 00000000 00000000 cd015bb4 cd015b6c cd015ad4 00000000 [ 106.822819] 5ba0: 00000004 00000000 00000000 00000000 00000000 cd015bd8 cd015b90 cd089ff8 [ 106.831369] 5bc0: 00000000 00000ffc 00000000 00000000 00000000 00000000 cd015bfc cd015bb4 [ 106.839918] 5be0: cd015ad8 00000000 00000004 00000000 00000000 00000000 00000000 cd015c20 [ 106.848468] 5c00: cd015bd8 cd08aff4 00000000 00000ffc 00000000 00000000 00000000 00000000 [ 106.857018] 5c20: cd015c44 cd015bfc cd015adc 00000000 00000004 00000000 00000000 00000000 [ 106.865568] 5c40: 00000000 cd015c68 cd015c20 cd08bff0 00000000 00000010 00000000 00000000 [ 106.874118] 5c60: 00000000 00000000 cd015adc cd015c44 bf0be390 00000000 000177c0 00000000 [ 106.882670] 5c80: bf0d4fe4 cd088000 cd061480 d0b1600c cd015d0c cd015ca0 bf0c5a04 bf10132c [ 106.891220] 5ca0: 00000000 00000000 00000005 d0b1600c 0000000b 00000000 0002ffc0 d0b1600c [ 106.899770] 5cc0: 000177c0 00000000 00008800 00300000 00000000 00000000 00000000 00000000 [ 106.908323] 5ce0: bf0eb57c cd061480 00000000 c061e4c8 cd015d1e ffffb4d8 bf0f4df0 bf0d4fe4 [ 106.916874] 5d00: cd015d4c cd015d10 bf0ecd58 bf0c5854 00000000 cd061480 cd015d4c 0f015d28 [ 106.925426] 5d20: bf0b52e0 00000000 cd0614b4 bf0d4fe4 cd095b60 cd095b64 00000003 cd061480 [ 106.933978] 5d40: cd015dac cd015d50 bf0b855c bf0ec410 00000200 cd095a68 cd060100 cd0616ec [ 106.942527] 5d60: cd095b48 00000000 00000000 cd095a68 00000000 00000000 cd095a68 00000000 [ 106.951078] 5d80: 00000000 cd0953c8 cd060b20 cd095000 cd0953c0 00000001 cd095a68 ffffffff [ 106.959629] 5da0: cd015dfc cd015db0 bf0658d8 bf0b81c8 0000000d 00000001 00001002 00008914 [ 106.968179] 5dc0: cd015dfc cd015dd0 00000000 c03af0c0 000000ff cd095000 bf08e71c 00000001 [ 106.976730] 5de0: 00001002 00008914 cd014000 00000000 cd015e14 cd015e00 bf065eb8 bf0653dc [ 106.985280] 5e00: bf065e40 cd095000 cd015e2c cd015e18 c03a4a0c bf065e4c cd095000 00001043 [ 106.993831] 5e20: cd015e4c cd015e30 c03a4c54 c03a4968 cd095000 00001002 cf474a80 00000000 [ 107.002382] 5e40: cd015e6c cd015e50 c03a4d88 c03a4bdc 00000000 cf474a80 cf6412cc cf474a80 [ 107.010933] 5e60: cd015ed4 cd015e70 c03f57ac c03a4d7c beb06bb8 cd095000 cf6412cc 00000014 [ 107.019483] 5e80: cf6412c0 beb06bb8 6e616c77 00000030 00000000 00000000 beb01043 beb06e8c [ 107.028032] 5ea0: beb06f64 ffffffc1 beb01002 00008914 ffffff24 beb06bb8 c0682298 beb06bb8 [ 107.036584] 5ec0: ce8f5220 00000000 cd015ee4 cd015ed8 c03f62e8 c03f5158 cd015f04 cd015ee8 [ 107.045134] 5ee0: c03901a4 c03f613c cea29718 beb06bb8 00008914 cf45c8c0 cd015f74 cd015f08 [ 107.053685] 5f00: c00b98e0 c0390138 c005a310 c0019a58 ffffffff cf77401c cf3ceb80 c061cff0 [ 107.062236] 5f20: cf76b800 cf599380 cd015f4c cd015f38 c005a3d0 c005a2d0 00000000 cd015f48 [ 107.070786] 5f40: cd015f64 cd015f50 c005a3f8 00000000 beb06bb8 00008914 cf45c8c0 00000004 [ 107.079336] 5f60: cd014000 00000000 cd015fa4 cd015f78 c00b9dd4 c00b9864 beb06c0c 00000000 [ 107.087888] 5f80: 00000036 beb06c70 0001b5bc 00001043 00000036 c0014a28 00000000 cd015fa8 [ 107.096439] 5fa0: c0014880 c00b9d6c beb06c70 0001b5bc 00000004 00008914 beb06bb8 00001002 [ 107.104991] 5fc0: beb06c70 0001b5bc 00001043 00000036 ffffffc1 00000000 4788f000 00000000 [ 107.113542] 5fe0: 0001b17c beb06bb4 0000b6ac 4795cd8c 60000010 00000004 00000000 00000000 [ 107.122083] Backtrace: [ 107.124658] [] (omap2_mcspi_transfer+0x0/0x410) from [] (__spi_async+0xb4/0xc0) [ 107.134122] [] (__spi_async+0x0/0xc0) from [] (spi_async_locked+0x18/0x20) [ 107.143118] r6:cf099000 r5:cd015a84 r4:60000013 r3:00000000 [ 107.149062] [] (spi_async_locked+0x0/0x20) from [] (__spi_sync+0x90/0xa4) [ 107.157967] r4:cd015adc r3:00000000 [ 107.161719] [] (__spi_sync+0x0/0xa4) from [] (spi_sync+0x14/0x18) [ 107.169898] r7:cd08c000 r6:cd015c4c r5:00000000 r4:0000000a [ 107.175852] [] (spi_sync+0x0/0x18) from [] (wl12xx_spi_raw_write+0x13c/0x180 [wlcore_spi]) [ 107.186412] [] (wl12xx_spi_raw_write+0x0/0x180 [wlcore_spi]) from [] (wlcore_boot_upload_firmware+0x1bc/0x488 [wlcore]) [ 107.199570] [] (wlcore_boot_upload_firmware+0x0/0x488 [wlcore]) from [] (wl12xx_boot+0x954/0xe08 [wl12xx]) [ 107.211521] [] (wl12xx_boot+0x0/0xe08 [wl12xx]) from [] (wl1271_op_add_interface+0x3a0/0x800 [wlcore]) [ 107.223243] [] (wl1271_op_add_interface+0x0/0x800 [wlcore]) from [] (ieee80211_do_open+0x508/0xa70 [mac80211]) [ 107.235627] [] (ieee80211_do_open+0x0/0xa70 [mac80211]) from [] (ieee80211_open+0x78/0x7c [mac80211]) [ 107.247145] [] (ieee80211_open+0x0/0x7c [mac80211]) from [] (__dev_open+0xb0/0x104) [ 107.256957] r4:cd095000 r3:bf065e40 [ 107.260709] [] (__dev_open+0x0/0x104) from [] (__dev_change_flags+0x84/0x13c) [ 107.269975] r5:00001043 r4:cd095000 [ 107.273729] [] (__dev_change_flags+0x0/0x13c) from [] (dev_change_flags+0x18/0x50) [ 107.283450] r7:00000000 r6:cf474a80 r5:00001002 r4:cd095000 [ 107.289396] [] (dev_change_flags+0x0/0x50) from [] (devinet_ioctl+0x660/0x774) [ 107.298753] r6:cf474a80 r5:cf6412cc r4:cf474a80 r3:00000000 [ 107.304694] [] (devinet_ioctl+0x0/0x774) from [] (inet_ioctl+0x1b8/0x1c8) [ 107.313621] [] (inet_ioctl+0x0/0x1c8) from [] (sock_ioctl+0x78/0x274) [ 107.322189] [] (sock_ioctl+0x0/0x274) from [] (do_vfs_ioctl+0x88/0x508) [ 107.330910] r7:cf45c8c0 r6:00008914 r5:beb06bb8 r4:cea29718 [ 107.336855] [] (do_vfs_ioctl+0x0/0x508) from [] (sys_ioctl+0x74/0x84) [ 107.345422] [] (sys_ioctl+0x0/0x84) from [] (ret_fast_syscall+0x0/0x30) [ 107.354144] r8:c0014a28 r7:00000036 r6:00001043 r5:0001b5bc r4:beb06c70 [ 107.361178] Code: 0a000084 e5913010 e3530000 0a000081 (e5123004) [ 107.368147] ---[ end trace 82bc410ad17967c2 ]---