Problems getting mwifiex with sd8887 to work
Hi,
I am trying to get a SD8887 based SDIO card to work with my Renesas H3 Salvator-X board. The card is either a u-blox emmy-w1-evk or a ZComax AC-180M, I am evaluating both. I really prefer to run the upstream driver instead of the paperwork protected and surprisingly old custom ones.
However, for both cards, I run into an error I cannot parse:
[ 4.028588] mwifiex_sdio mmc2:0001:1: mwifiex_process_cmdresp: cmd 0x242 failed during initialization
I use a v4.9-rc2 based tree called 'renesas-drives' [1] which has a few Renesas specific patches on top but nothing mwifiex related AFAICT. I use the firmware from the linux-firmware tree.
Any further use of the interface mlan0 or reading eeprom via debugfs will result in a timeout.
[ 18.146710] mwifiex_sdio mmc2:0001:1: mwifiex_cmd_timeout_func: Timeout cmd id = 0x10, act = 0x1
I assume this is a follow-up problem so I skip the logs for these timeouts (can easily send them, of course, in case they are interesting). I'll attach a full debug output from mwifiex from insertion until the initial 0x242 error.
For full disclaimer, I am the maintainer of the underlying Renesas SD driver and I want to use this setup to create a test scenario for SDIO with UHS speeds. So, if there is something wrong in the SD part, I'll happily hack on that.
But for now, I simply would need a starting point :) 0x242 is "HostCmd_CMD_CHAN_REGION_CFG". Could this mean it cannot load configuration data? I did search around but couldn't find anything useful.
Thanks,
Wolfram
[1] https://git.kernel.org/cgit/linux/kernel/git/geert/renesas-drivers.git/
[ 3.139424] mmc2: new ultra high speed SDR50 SDIO card at address 0001 [ 3.142867] mwifiex_sdio: info: vendor=0x02DF device=0x9135 class=0 function=1 [ 3.146696] mwifiex: rx work enabled, cpus 4 [ 3.267184] mwifiex_sdio mmc2:0001:1: info: downloading FW image (391772 bytes) [ 3.452377] mwifiex_sdio mmc2:0001:1: info: FW download over, size 391772 bytes [ 3.671191] mwifiex_sdio mmc2:0001:1: WLAN FW is active [ 3.673910] mwifiex_sdio mmc2:0001:1: cmd: QUEUE_CMD: cmd=0xa9, cmd_pending=1 [ 3.677550] mwifiex_sdio mmc2:0001:1: cmd: DNLD_CMD: 0xa9, act 0x0, len 8, seqno 0x1 [ 3.681429] cmd buffer:00000000: a9 00 08 00 01 00 00 00 [ 3.684089] mwifiex_sdio mmc2:0001:1: info: mwifiex_host_to_card_mp_aggr: tx aggregation disabled [ 3.688527] mwifiex_sdio mmc2:0001:1: data: mwifiex_host_to_card_mp_aggr: send current buffer 32768 [ 3.693652] mwifiex_sdio mmc2:0001:1: int: sdio_ireg = 0x80 [ 3.696443] mwifiex_sdio mmc2:0001:1: info: cmd_sent=0 data_sent=1 [ 3.700321] mwifiex_sdio mmc2:0001:1: int: sdio_ireg = 0x82 [ 3.703106] mwifiex_sdio mmc2:0001:1: int: DNLD: wr_bitmap=0xffffffff [ 3.706328] mwifiex_sdio mmc2:0001:1: info: <--- Tx DONE Interrupt ---> [ 3.709680] mwifiex_sdio mmc2:0001:1: info: cmd_sent=0 data_sent=0 [ 3.712811] mwifiex_sdio mmc2:0001:1: int: sdio_ireg = 0x40 [ 3.715600] mwifiex_sdio mmc2:0001:1: info: rx_len = 256 [ 3.718292] mwifiex_sdio mmc2:0001:1: info: --- Rx: Cmd Response --- [ 3.721471] mwifiex_sdio mmc2:0001:1: info: cmd_sent=0 data_sent=0 [ 3.724563] mwifiex_sdio mmc2:0001:1: cmd: CMD_RESP: 0x80a9, result 0, len 8, seqno 0x1 [ 3.728565] CMD_RESP buffer:00000000: a9 00 08 00 01 00 00 00 [ 3.731439] mwifiex_sdio mmc2:0001:1: cmd completed: status=0 [ 3.734312] mwifiex_sdio mmc2:0001:1: cmd: FREE_CMD: cmd=0xa9, cmd_pending=0 [ 3.737930] mwifiex_sdio mmc2:0001:1: cmd: QUEUE_CMD: cmd=0x3, cmd_pending=1 [ 3.741459] mwifiex_sdio mmc2:0001:1: cmd: DNLD_CMD: 0x3, act 0x0, len 71, seqno 0x2 [ 3.745333] cmd buffer:00000000: 03 00 47 00 02 00 00 00 00 00 00 00 00 00 00 00 [ 3.749031] cmd buffer:00000010: ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00 [ 3.752729] cmd buffer:00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 3.756426] cmd buffer:00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 3.760189] cmd buffer:00000040: 00 00 00 00 00 00 00 [ 3.762714] mwifiex_sdio mmc2:0001:1: info: mwifiex_host_to_card_mp_aggr: tx aggregation disabled [ 3.767156] mwifiex_sdio mmc2:0001:1: data: mwifiex_host_to_card_mp_aggr: send current buffer 32768 [ 3.771814] mwifiex_sdio mmc2:0001:1: int: sdio_ireg = 0x80 [ 3.774599] mwifiex_sdio mmc2:0001:1: info: cmd_sent=0 data_sent=0 [ 3.777728] mwifiex_sdio mmc2:0001:1: int: sdio_ireg = 0x40 [ 3.780517] mwifiex_sdio mmc2:0001:1: info: rx_len = 256 [ 3.783210] mwifiex_sdio mmc2:0001:1: info: --- Rx: Cmd Response --- [ 3.786386] mwifiex_sdio mmc2:0001:1: info: cmd_sent=0 data_sent=0 [ 3.789484] mwifiex_sdio mmc2:0001:1: cmd: CMD_RESP: 0x8003, result 0, len 79, seqno 0x2 [ 3.793530] CMD_RESP buffer:00000000: 03 00 4f 00 02 00 00 00 02 00 02 42 00 00 40 00 [ 3.797444] CMD_RESP buffer:00000010: d4 ca 6e 00 03 94 10 00 01 00 07 44 0f 05 00 00 [ 3.801359] CMD_RESP buffer:00000020: 00 00 00 00 00 00 00 00 00 00 03 ff 00 00 11 00 [ 3.805273] CMD_RESP buffer:00000030: d3 65 11 20 00 0e 00 00 00 00 00 00 00 00 00 30 [ 3.809188] CMD_RESP buffer:00000040: 71 c0 33 fe ff fe ff c7 01 04 00 01 00 02 00 [ 3.812974] mwifiex_sdio mmc2:0001:1: key_api v2.0 [ 3.815370] mwifiex_sdio mmc2:0001:1: info: GET_HW_SPEC: fw_release_number- 0x50f4407 [ 3.819285] mwifiex_sdio mmc2:0001:1: info: GET_HW_SPEC: permanent addr: d4:ca:6e:00:03:94 [ 3.823417] mwifiex_sdio mmc2:0001:1: info: GET_HW_SPEC: hw_if_version=0x2 version=0x4202 [ 3.827507] mwifiex_sdio mmc2:0001:1: cmd: mp_end_port 32, data port mask 0xffffffff [ 3.831379] mwifiex_sdio mmc2:0001:1: cmd completed: status=0 [ 3.834251] mwifiex_sdio mmc2:0001:1: cmd: FREE_CMD: cmd=0x3, cmd_pending=0 [ 3.837886] mwifiex_sdio mmc2:0001:1: cmd: set tx_buf=2048 [ 3.840631] mwifiex_sdio mmc2:0001:1: cmd: QUEUE_CMD: cmd=0xd9, cmd_pending=1 [ 3.844228] mwifiex_sdio mmc2:0001:1: cmd: DNLD_CMD: 0xd9, act 0x1, len 16, seqno 0x3 [ 3.848151] cmd buffer:00000000: d9 00 10 00 03 00 00 00 01 00 00 08 00 00 00 00 [ 3.851850] mwifiex_sdio mmc2:0001:1: info: mwifiex_host_to_card_mp_aggr: tx aggregation disabled [ 3.856286] mwifiex_sdio mmc2:0001:1: data: mwifiex_host_to_card_mp_aggr: send current buffer 32768 [ 3.861255] mwifiex_sdio mmc2:0001:1: int: sdio_ireg = 0x82 [ 3.864043] mwifiex_sdio mmc2:0001:1: int: DNLD: wr_bitmap=0xffffffff [ 3.867266] mwifiex_sdio mmc2:0001:1: info: cmd_sent=0 data_sent=0 [ 3.870391] mwifiex_sdio mmc2:0001:1: int: sdio_ireg = 0x40 [ 3.873187] mwifiex_sdio mmc2:0001:1: info: rx_len = 256 [ 3.875881] mwifiex_sdio mmc2:0001:1: info: --- Rx: Cmd Response --- [ 3.879057] mwifiex_sdio mmc2:0001:1: info: cmd_sent=0 data_sent=0 [ 3.882148] mwifiex_sdio mmc2:0001:1: cmd: CMD_RESP: 0x80d9, result 0, len 16, seqno 0x3 [ 3.886194] CMD_RESP buffer:00000000: d9 00 10 00 03 00 00 00 01 00 00 06 20 00 00 00 [ 3.890110] mwifiex_sdio mmc2:0001:1: cmd: curr_tx_buf_size=1536 [ 3.893113] mwifiex_sdio mmc2:0001:1: cmd: mp_end_port 32, data port mask 0xffffffff [ 3.896984] mwifiex_sdio mmc2:0001:1: cmd completed: status=0 [ 3.899859] mwifiex_sdio mmc2:0001:1: cmd: FREE_CMD: cmd=0xd9, cmd_pending=0 [ 3.903480] mwifiex_sdio mmc2:0001:1: cmd: PS Command: Enter PS [ 3.906439] mwifiex_sdio mmc2:0001:1: cmd: QUEUE_CMD: cmd=0xe4, cmd_pending=1 [ 3.910042] mwifiex_sdio mmc2:0001:1: cmd: DNLD_CMD: 0xe4, act 0xff, len 30, seqno 0x4 [ 3.914003] cmd buffer:00000000: e4 00 1e 00 04 00 00 00 ff 00 10 00 72 01 0e 00 [ 3.917701] cmd buffer:00000010: 00 00 01 00 05 00 00 00 00 00 01 00 e8 03 [ 3.921139] mwifiex_sdio mmc2:0001:1: info: mwifiex_host_to_card_mp_aggr: tx aggregation disabled [ 3.925575] mwifiex_sdio mmc2:0001:1: data: mwifiex_host_to_card_mp_aggr: send current buffer 32768 [ 3.930274] mwifiex_sdio mmc2:0001:1: int: sdio_ireg = 0x80 [ 3.933065] mwifiex_sdio mmc2:0001:1: info: cmd_sent=0 data_sent=0 [ 3.936193] mwifiex_sdio mmc2:0001:1: int: sdio_ireg = 0x40 [ 3.938977] mwifiex_sdio mmc2:0001:1: info: rx_len = 256 [ 3.941672] mwifiex_sdio mmc2:0001:1: info: --- Rx: Cmd Response --- [ 3.944851] mwifiex_sdio mmc2:0001:1: info: cmd_sent=0 data_sent=0 [ 3.947942] mwifiex_sdio mmc2:0001:1: cmd: CMD_RESP: 0x80e4, result 0, len 30, seqno 0x4 [ 3.951987] CMD_RESP buffer:00000000: e4 00 1e 00 04 00 00 00 ff 00 10 00 72 01 0e 00 [ 3.955902] CMD_RESP buffer:00000010: 00 00 01 00 05 00 00 00 00 00 01 00 e8 03 [ 3.959558] mwifiex_sdio mmc2:0001:1: info: mwifiex_ret_enh_power_mode: PS_MODE cmd reply result=0x0 action=0XFF [ 3.964645] mwifiex_sdio mmc2:0001:1: cmd: Enabled STA power save [ 3.967692] mwifiex_sdio mmc2:0001:1: cmd completed: status=0 [ 3.970563] mwifiex_sdio mmc2:0001:1: cmd: FREE_CMD: cmd=0xe4, cmd_pending=0 [ 3.974188] mwifiex_sdio mmc2:0001:1: cmd: QUEUE_CMD: cmd=0x242, cmd_pending=1 [ 3.977808] mwifiex_sdio mmc2:0001:1: cmd: DNLD_CMD: 0x242, act 0x0, len 10, seqno 0x5 [ 3.981768] cmd buffer:00000000: 42 02 0a 00 05 00 00 00 00 00 [ 3.984685] mwifiex_sdio mmc2:0001:1: info: mwifiex_host_to_card_mp_aggr: tx aggregation disabled [ 3.989121] mwifiex_sdio mmc2:0001:1: data: mwifiex_host_to_card_mp_aggr: send current buffer 32768 [ 3.993759] mwifiex_sdio mmc2:0001:1: int: sdio_ireg = 0x80 [ 3.996547] mwifiex_sdio mmc2:0001:1: info: cmd_sent=0 data_sent=0 [ 3.999679] mwifiex_sdio mmc2:0001:1: int: sdio_ireg = 0x40 [ 4.002464] mwifiex_sdio mmc2:0001:1: info: rx_len = 256 [ 4.005160] mwifiex_sdio mmc2:0001:1: info: --- Rx: Cmd Response --- [ 4.008339] mwifiex_sdio mmc2:0001:1: info: cmd_sent=0 data_sent=0 [ 4.011435] mwifiex_sdio mmc2:0001:1: cmd: CMD_RESP: 0x8242, result 2, len 10, seqno 0x5 [ 4.015481] CMD_RESP buffer:00000000: 42 02 0a 00 05 00 02 00 00 00 [ 4.018614] mwifiex_sdio mmc2:0001:1: CMD_RESP: cmd 0x242 error, result=0x2 [ 4.022099] mwifiex_sdio mmc2:0001:1: cmd completed: status=-1 [ 4.025017] mwifiex_sdio mmc2:0001:1: cmd: FREE_CMD: cmd=0x242, cmd_pending=0 [ 4.028588] mwifiex_sdio mmc2:0001:1: mwifiex_process_cmdresp: cmd 0x242 failed during initialization
Quoted 39 lines
From: Wolfram Sang [mailto:[email protected]]
Sent: Thursday, November 10, 2016 11:29 PM
To: [email protected]
Cc: Amitkumar Karwar; Nishant Sarmukadam; Kalle Valo
Subject: Problems getting mwifiex with sd8887 to workHi,
I am trying to get a SD8887 based SDIO card to work with my Renesas H3 Salvator-X board. The card is either a u-blox emmy-w1-evk or a ZComax AC-180M, I am evaluating both. I really prefer to run the upstream driver instead of the paperwork protected and surprisingly old custom ones.
However, for both cards, I run into an error I cannot parse:
[ 4.028588] mwifiex_sdio mmc2:0001:1: mwifiex_process_cmdresp: cmd
0x242failed during initializationI use a v4.9-rc2 based tree called 'renesas-drives' [1] which has a few Renesas specific patches on top but nothing mwifiex related AFAICT. I use the firmware from the linux-firmware tree.
Any further use of the interface mlan0 or reading eeprom via debugfs will result in a timeout.
[ 18.146710] mwifiex_sdio mmc2:0001:1: mwifiex_cmd_timeout_func:Timeout cmd id =
0x10, act =0x1I assume this is a follow-up problem so I skip the logs for these timeouts (can easily send them, of course, in case they are interesting). I'll attach a full debug output from mwifiex from insertion until the initial
0x242error.For full disclaimer, I am the maintainer of the underlying Renesas SD driver and I want to use this setup to create a test scenario for SDIO with UHS speeds. So, if there is something wrong in the SD part, I'll happily hack on that.
Quoted 4 lines
But for now, I simply would need a starting point :)
0x242is "HostCmd_CMD_CHAN_REGION_CFG". Could this mean it cannot load configuration data? I did search around but couldn't find anything useful.
0x242 command failure is expected for sd8887, as It's not supported. Driver shouldn't abort initialization in this case. You can try below change. I will prepare a patch to send this command based on firmware version/capability.
-------
@ -2304,8 +2304,8 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
return -1;
}- mwifiex_send_cmd(priv, HostCmd_CMD_CHAN_REGION_CFG,
- HostCmd_ACT_GEN_GET, 0, NULL, true);
+// mwifiex_send_cmd(priv, HostCmd_CMD_CHAN_REGION_CFG,
+// HostCmd_ACT_GEN_GET, 0, NULL, true);
}---------
Regards,
Amitkumar
Quoted 5 lines
0x242command failure is expected for sd8887, as It's not supported. Driver shouldn't abort initialization in this case. You can try below change. I will prepare a patch to send this command based on firmware version/capability.
Thanks for the heads up. If you CC me on the patch, I'll happily ack it.
Meanwhile, I nailed my problem down to some SDIO IRQ delivery issue.
Thanks again.
Quoted 1 line
0x242command failure is expected for sd8887, as It's not supported.
Is the same true for 0x10f?
mwifiex_sdio mmc2:0001:1: CMD_RESP: cmd 0x10f error, result=0x2
Otherwise I can connect to the network and run performance tests now.
Quoted 11 lines
From: Wolfram Sang [mailto:[email protected]]
Sent: Sunday, November 13, 2016 7:44 PM
To: Amitkumar Karwar
Cc: [email protected]; Nishant Sarmukadam; Kalle Valo
Subject: Re: Problems getting mwifiex with sd8887 to workQuoted 1 line
0x242command failure is expected for sd8887, as It's not supported.Is the same true for
0x10f?
mwifiex_sdiommc2:0001:1:CMD_RESP: cmd0x10ferror, result=0x2
Yes. Error code 2 here means command not supported by firmware.
Regards,
Amitkumar
Hi Wolfram,
Quoted 6 lines
From: Wolfram Sang [mailto:[email protected]]
Sent: Sunday, November 13, 2016 7:44 PM
To: Amitkumar Karwar
Cc: [email protected]; Nishant Sarmukadam; Kalle Valo
Subject: Re: Problems getting mwifiex with sd8887 to work
Quoted 7 lines
Quoted 1 line
0x242command failure is expected for sd8887, as It's not supported.Is the same true for
0x10f?
mwifiex_sdiommc2:0001:1:CMD_RESP: cmd0x10ferror, result=0x2Otherwise I can connect to the network and run performance tests now.
Error code 2 from firmware is unsupported command. You can ignore this and earlier error seen for 0x242 command. They aren't harmful.
Regards,
Amitkumar
Hi All,
I'm also using sd8887 and I'm trying to make it work in adhoc mode and encrypt the channel with wpa-none, but I got some trouble.
If I make the same specific test with from the driver from marvel intranet, is working (maybe because the firmware is more recent ?) but anyway the general stability with the driver is poor, I get frequent kernel crash, I see at [1] that this driver is based on android and I've personally to admit that mwifiex driver solved the stability side but unfortunately introduce a regression on wpa-none.
With mwifiex backport driver of Linux 4.1 is not working, I mean the link seems to be established always even when the password is wrong.
I saw on older thread on linux wireless with similar issue but more related to fix ibss-rns, but with my test ibss-rns never worked with mwifiex as with intranet one, so I think will be more important fix the regression with wpa-none.
[1] https://www.u-blox.com/sites/default/files/EVK-EMMY-W1_UserGuide_%28UBX-15012713%29.pdf
Thanks and Regards,
Federico