New IT forum
26 June 2022, 05:08:31 pm *
Welcome, %1$s. Please login or register.

: PiHub now in stock.
 
Pages: [1]

Author Topic: Mwifiex driver failed  (Read 27493 times)

noidea

  • Newbie
  • *
  • Posts: 11
Mwifiex driver failed
« on: 22 October 2013, 08:08:22 pm »

    Hello!

 I've build a 3.12rc6 kernel with the mwifiex drivers.

Everything seems ok (firmware initialisation and interface creation) but "iw mlan0 scan" cause a timeout error (mwifiex_cmd_timeout_func: Timeout cmd id (...) = 0x6, act = 0x3) and the card is resetting but without success (prog_fw failed ret=0xffffffff)

Here is the log:
Code: [Select]
bus: 'sdio': add driver mwifiex_sdio
bus: 'sdio': driver_probe_device: matched device mmc0:0001:1 with driver mwifiex_sdio
bus: 'sdio': really_probe: probing driver mwifiex_sdio with device mmc0:0001:1
mwifiex_sdio mmc0:0001:1: no default pinctrl state
driver: 'mmc0:0001:1': driver_bound: bound to device 'mwifiex_sdio'
bus: 'sdio': really_probe: bound device mmc0:0001:1 to driver mwifiex_sdio
__allocate_fw_buf: fw-mrvl/sd8787_uapsta.bin buf=eea2d640
mwifiex_sdio mmc0:0001:1: firmware: direct-loading firmware mrvl/sd8787_uapsta.bin
fw_set_page_data: fw-mrvl/sd8787_uapsta.bin buf=eea2d640 data=f1095000 size=447384
mwifiex_sdio mmc0:0001:1: WLAN FW is active
device: 'phy0': device_add
PM: Adding info for No Bus:phy0
cfg80211: Ignoring regulatory request Set by core since the driver uses its own custom regulatory domain
ieee80211 phy0: ignoring F/W country code US
device: 'mlan0': device_add
PM: Adding info for No Bus:mlan0
8mwifiex_sdio mmc0:0001:1: driver_version = mwifiex 1.0 (14.66.9.p96)
__fw_free_buf: fw-mrvl/sd8787_uapsta.bin buf=eea2d640 data=f1095000 size=447384
mwifiex_sdio mmc0:0001:1: mwifiex_cmd_timeout_func: Timeout cmd id (1382469273.572068) = 0x6, act = 0x3
mwifiex_sdio mmc0:0001:1: num_data_h2c_failure = 0
mwifiex_sdio mmc0:0001:1: num_cmd_h2c_failure = 0
mwifiex_sdio mmc0:0001:1: num_cmd_timeout = 1
mwifiex_sdio mmc0:0001:1: num_tx_timeout = 0
mwifiex_sdio mmc0:0001:1: last_cmd_index = 2
mwifiex_sdio mmc0:0001:1: last_cmd_id: 10 00 06 00 06 00 10 00 e4 00
mwifiex_sdio mmc0:0001:1: last_cmd_act: 01 00 03 00 03 00 01 00 ff 00
mwifiex_sdio mmc0:0001:1: last_cmd_resp_index = 1
mwifiex_sdio mmc0:0001:1: last_cmd_resp_id: 10 80 06 80 10 80 10 80 e4 80
mwifiex_sdio mmc0:0001:1: last_event_index = 4
mwifiex_sdio mmc0:0001:1: last_event: 00 00 0b 00 0a 00 0b 00 0a 00
mwifiex_sdio mmc0:0001:1: data_sent=0 cmd_sent=1
mwifiex_sdio mmc0:0001:1: ps_mode=1 ps_state=0
mwifiex_sdio mmc0:0001:1: cmd timeout
mwifiex_sdio: Resetting card...
bus: 'sdio': remove device mmc0:0001:1
PM: Removing info for No Bus:mlan0
PM: Removing info for No Bus:phy0
fw_name_devm_release: fw_name-mrvl/sd8787_uapsta.bin devm-ee8d6750 released
PM: Removing info for sdio:mmc0:0001:1
bus: 'sdio': remove device mmc0:0001:2
PM: Removing info for sdio:mmc0:0001:2
bus: 'sdio': remove device mmc0:0001:3
PM: Removing info for sdio:mmc0:0001:3
mmc0: card 0001 removed
bus: 'mmc': remove device mmc0:0001
PM: Removing info for mmc:mmc0:0001
PM: Removing info for No Bus:mmc0
device: 'mmc0': device_add
PM: Adding info for No Bus:mmc0
mmc0: new high speed SDIO card at address 0001
device: 'mmc0:0001': device_add
bus: 'mmc': add device mmc0:0001
PM: Adding info for mmc:mmc0:0001
bus: 'mmc': driver_probe_device: matched device mmc0:0001 with driver mmcblk
bus: 'mmc': really_probe: probing driver mmcblk with device mmc0:0001
mmcblk mmc0:0001: no default pinctrl state
mmcblk: probe of mmc0:0001 rejects match -19
device: 'mmc0:0001:1': device_add
bus: 'sdio': add device mmc0:0001:1
PM: Adding info for sdio:mmc0:0001:1
bus: 'sdio': driver_probe_device: matched device mmc0:0001:1 with driver mwifiex_sdio
bus: 'sdio': really_probe: probing driver mwifiex_sdio with device mmc0:0001:1
mwifiex_sdio mmc0:0001:1: no default pinctrl state
driver: 'mmc0:0001:1': driver_bound: bound to device 'mwifiex_sdio'
bus: 'sdio': really_probe: bound device mmc0:0001:1 to driver mwifiex_sdio
device: 'mmc0:0001:2': device_add
bus: 'sdio': add device mmc0:0001:2
PM: Adding info for sdio:mmc0:0001:2
device: 'mmc0:0001:3': device_add
bus: 'sdio': add device mmc0:0001:3
PM: Adding info for sdio:mmc0:0001:3
__allocate_fw_buf: fw-mrvl/sd8787_uapsta.bin buf=eea2d440
mwifiex_sdio mmc0:0001:1: firmware: direct-loading firmware mrvl/sd8787_uapsta.bin
fw_set_page_data: fw-mrvl/sd8787_uapsta.bin buf=eea2d440 data=f1110000 size=447384
mwifiex_sdio mmc0:0001:1: poll card status failed, tries = 100
mwifiex_sdio mmc0:0001:1: FW download with helper: poll status timeout @ 0
mwifiex_sdio mmc0:0001:1: prog_fw failed ret=0xffffffff
__fw_free_buf: fw-mrvl/sd8787_uapsta.bin buf=eea2d440 data=f1110000 size=447384

Any idea or suggestion ?
 
« Last Edit: 23 October 2013, 09:25:25 am by noidea »
Logged

josue

  • Newbie
  • *
  • Posts: 22
Re: Mwifiex driver failed
« Reply #1 on: 23 October 2013, 07:55:23 pm »

Hello,

I also have a problem with mwifiex. My kernel can't download the firmware. Or have you downloaded the fireware for mwifiex (sd8787.bin or sd8787_uapsta.bin). I have downloaded here :

http://git.marvell.com/?p=mwifiex-firmware.git;a=blob;f=mrvl/sd8787_uapsta.bin;h=3bf4e230daf51e4549e031d56e8fad6b793b11e3;hb=bac3567cdb38d5cfcf3045718618026d60478d05

My version on kernel is 3.11.6

I have this error :

Code: [Select]
mwifiex_sdio mmc0:0001:1: Failed to get firmware mrvl/sd8787_uapsta.bin
« Last Edit: 23 October 2013, 07:57:31 pm by josue »
Logged

noidea

  • Newbie
  • *
  • Posts: 11
Re: Mwifiex driver failed
« Reply #2 on: 24 October 2013, 03:55:31 pm »

I use the same file as you so maybe it's another problem.
Here's some tips that may be usefull:
The filename must strictly be "sd8787_uapsta.bin" and place in the /firmware/mrvl/ directory of the mirabox file system.
You can also incluled the firmware directly in the kernel image with the following kernel options:
           CONFIG_FIRMWARE_IN_KERNEL=y
           CONFIG_EXTRA_FIRMWARE="mrlv/sd8787_uapsta.bin"
In this case you have to place the file in firmware/mrvl in the kernel source directory before build the kernel.

Hope it can help you.




Logged

josue

  • Newbie
  • *
  • Posts: 22
Re: Mwifiex driver failed
« Reply #3 on: 05 November 2013, 08:49:56 pm »

Hello,

Thank your for your reply

I tried with the 3.12 kernel as you have proposed to me but I still have these errors.

Thank
Logged

mdipolt

  • Newbie
  • *
  • Posts: 4
Re: Mwifiex driver failed
« Reply #4 on: 07 January 2014, 09:26:02 am »

i had a similar problem with the sd8782

mwifiex_sdio mmc0:0001:1: poll card status failed, tries = 100
mwifiex_sdio mmc0:0001:1: FW download with helper: poll status timeout @ 0
mwifiex_sdio mmc0:0001:1: prog_fw failed ret=0xffffffff

i get the same error message like https://community.freescale.com/thread/315647

i get 0x04 instead of 0x09(DN_LD_CARD_RDY and IO_READY) read the
CARD_TO_HOST_EVENT_REG          0x30

which value did you read, can you insert a printf to get the value?

did you solved it yet?

@josue: are you sure that sd8787_uapsta.bin is in /lib/firmware/mrvl/

Logged

noidea

  • Newbie
  • *
  • Posts: 11
Re: Mwifiex driver failed
« Reply #5 on: 07 January 2014, 10:37:21 am »

   Hi,

I still have the same problem even with the 3.13-rc7 kernel. I don't know what to do to solve this problem, I have activated the debug option for MMC and I have the following result, so I think the problem was cause by the mmc driver and not mwfiex.

Code: [Select]
2:~# ------------[ cut here ]------------
WARNING: CPU: 0 PID: 4 at drivers/mmc/core/core.c:1702 _mmc_detect_change+0xa8/0xbc()
---[ end trace 4d8c78b49ff55fd8 ]---
mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz
mmc0: new high speed SDIO card at address 0001
mwifiex_sdio mmc0:0001:1: poll card status failed, tries = 100
mwifiex_sdio mmc0:0001:1: FW download with helper: poll status timeout @ 0
mwifiex_sdio mmc0:0001:1: prog_fw failed ret=0xffffffff

What do you want me to do with the printf function ?



Logged

mdipolt

  • Newbie
  • *
  • Posts: 4
Re: Mwifiex driver failed
« Reply #6 on: 07 January 2014, 01:31:29 pm »

have you soldered the wifi modul yourself?

mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz -> seems like connection problem to the modul, i got same error by the first chip i soldered

what do you get by :  
Code: [Select]
cat /sys/kernel/debug/mmc0/ios
it should look like this:

Code: [Select]
clock:          50000000 Hz
vdd:            20 (3.2 ~ 3.3 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      2 (4 bits)
timing spec:    2 (sd high-speed)
signal voltage: 0 (3.30 V)

if not you have connection problem to the ic, i use pci card as sdio interface, where i was able to enable log for the driver and i saw that i pci write command wasnt succesfull.


Quote
What do you want me to do with the printf function ?

The problem is in the

Code: [Select]
/*
 * This function polls the card status.mwifiex_sdio_poll_card_status
 */
static int
mwifiex_sdio_poll_card_status(struct mwifiex_adapter *adapter, u8 bits)
{
struct sdio_mmc_card *card = adapter->card;
u32 tries;
u8 cs;

for (tries = 0; tries < MAX_POLL_TRIES; tries++) {
if (mwifiex_read_reg(adapter, card->reg->poll_reg, &cs))
break;
else if ((cs & bits) == bits)
return 0;

usleep_range(10, 20);
}

dev_err(adapter->dev, "poll card status failed, tries = %d\n", tries);

return -1;
}

the cs value should be DN_LD_CARD_RDY | IO_READY  = 0x09, i get 0x04 would be interesting which value you read
« Last Edit: 07 January 2014, 02:31:51 pm by mdipolt »
Logged

josue

  • Newbie
  • *
  • Posts: 22
Re: Mwifiex driver failed
« Reply #7 on: 07 January 2014, 07:57:18 pm »

Hello,

With this configuration on the kernel I dont have problem :

MWIFIEX=m
MWIFIEX_SDIO=m

I dont know why It work with this config but the important thing is it working.

But I have also your problem with mwifiex.

Thank

Logged

noidea

  • Newbie
  • *
  • Posts: 11
Re: Mwifiex driver failed
« Reply #8 on: 08 January 2014, 01:02:50 pm »

  Hello,

The mirabox is a manufactured product by GlobalScale so I haven't soldered the wifi modul.

The result of the debugfs is almost the same as you :

Code: [Select]
clock:          50000000 Hz
vdd:            21 (3.3 ~ 3.4 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      2 (4 bits)
timing spec:    2 (sd high-speed)
signal voltage: 0 (3.30 V)

and the result for the cs value:

Code: [Select]
mwifiex_sdio mmc0:0001:1: CS value hex= 0xc
mwifiex_sdio mmc0:0001:1: poll card status failed, tries = 100

I will try to search the meaning of this value in the source to try to understand what happened.

Logged

mdipolt

  • Newbie
  • *
  • Posts: 4
Re: Mwifiex driver failed
« Reply #9 on: 08 January 2014, 02:20:55 pm »

as far as i seen it the driver polls for the value 9 which means 00001001 in binary

so it polls that DN_LD_CARD_RDY(Download card ready, BIT 0) and IO_READY(Card I/O ready, bit 3) bits are set.


in your case its 0xC instead of 0x3 -> 0x1100

so instead of DN_LD_CARD_RDY(Download card ready, BIT 0) it is the CIS_CARD_RDY (CIS card ready, Bit 2) set

cis stands for  Card Information Structure (CIS) but i have no clue what the bit is used for.

maybe this helps you http://blog.sina.com.cn/s/blog_533074eb01013hgq.html

but i think its not for the 878x series and the 8686 downloads also first a firmware helper and then the firmware instead downloading the whole firmware image at once


@josue: which kernel version do you have?

does it work with the mirabox debian version?
« Last Edit: 09 January 2014, 12:37:31 pm by mdipolt »
Logged

josue

  • Newbie
  • *
  • Posts: 22
Re: Mwifiex driver failed
« Reply #10 on: 11 January 2014, 01:30:19 pm »

Hello,

Quote
@josue: which kernel version do you have?

I have tested with the 3.11, 3.12, and 3,13

Quote
does it work with the mirabox debian version?

I don't know because I have created my rootfs with debootstrap

Thank
Logged

mdipolt

  • Newbie
  • *
  • Posts: 4
Re: Mwifiex driver failed
« Reply #11 on: 13 January 2014, 09:07:15 am »

there was many changes at the mmc core in the new kernel versions http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/drivers/mmc/core/sdio.c

so maybe some make troubles with the mwiefiex sdio would be interesting if it works with old kernel from the mirabox debian.

could you look or anyone else where it is working how your card gets detected (message from dmesg when you connect or boot the system with the wlan modul connected)?

i get mmc0:
Code: [Select]
new SDHC card at address 000
and i think i should get
Code: [Select]
mmc0: new SDIO card at address 0001
Logged

noidea

  • Newbie
  • *
  • Posts: 11
Re: Mwifiex driver failed
« Reply #12 on: 13 January 2014, 03:07:56 pm »

Here's the dmesg output for mmc:
Code: [Select]
[    0.121151] bus: 'mmc': registered
[    0.121159] device class 'mmc_host': registering
[    1.279295] device: 'mmc0': device_add
[    1.279337] PM: Adding info for No Bus:mmc0
[    1.422482] mmc0: new high speed SDIO card at address 0001
[    1.428003] device: 'mmc0:0001': device_add
[    1.428031] bus: 'mmc': add device mmc0:0001
[    1.428064] PM: Adding info for mmc:mmc0:0001
[    1.428209] device: 'mmc0:0001:1': device_add
[    1.428227] bus: 'sdio': add device mmc0:0001:1
[    1.428263] PM: Adding info for sdio:mmc0:0001:1
[    1.428367] device: 'mmc0:0001:2': device_add
[    1.428383] bus: 'sdio': add device mmc0:0001:2
[    1.428417] PM: Adding info for sdio:mmc0:0001:2
[    1.428517] device: 'mmc0:0001:3': device_add
[    1.428534] bus: 'sdio': add device mmc0:0001:3
[    1.428573] PM: Adding info for sdio:mmc0:0001:3
[    7.201991] bus: 'sdio': driver_probe_device: matched device mmc0:0001:1 with driver mwifiex_sdio
[    7.202000] bus: 'sdio': really_probe: probing driver mwifiex_sdio with device mmc0:0001:1
[    7.202013] mwifiex_sdio mmc0:0001:1: no of_node; not parsing pinctrl DT
[    7.202024] mwifiex_sdio mmc0:0001:1: no default pinctrl state
[    7.218973] driver: 'mmc0:0001:1': driver_bound: bound to device 'mwifiex_sdio'
[    7.218996] bus: 'sdio': really_probe: bound device mmc0:0001:1 to driver mwifiex_sdio
[    7.273277] mwifiex_sdio mmc0:0001:1: firmware: direct-loading firmware mrvl/sd8787_uapsta.bin
[    8.184060] mwifiex_sdio mmc0:0001:1: WLAN FW is active
[    8.603365] mwifiex_sdio mmc0:0001:1: driver_version = mwifiex 1.0 (14.66.9.p96)

The kernel provided with the mirabox is a modified 2.6.35 version and Mwifiex wasn't available for this kernel as many others features for the armada 370/xp. So it's difficult to compare (Globalscale/Marvell applied a lot of patches to get working things). With recent kernel everything is ok except the wifi. (I havn't test nand support).

Logged

fishdav

  • Newbie
  • *
  • Posts: 1
Re: Mwifiex driver failed
« Reply #13 on: 09 September 2014, 06:14:45 pm »

I found the fix for this.

Assuming you're using the I.MX6...there is a patch for the SDIO controller.

http://article.gmane.org/gmane.linux.kernel.mmc/20121%5D

You need to revert this patch...it causes the IMX6 to block.

Dave
Logged

noidea

  • Newbie
  • *
  • Posts: 11
Re: Mwifiex driver failed
« Reply #14 on: 11 January 2015, 08:31:35 pm »

   Hi,

It seems the problem was caused by the mmc driver mvsdio. This patch solved the problem : https://www.marc.info/?l=linux-mmc&m=141583022814913&w=2

Great thanks to Andrew Lunn.


Logged
Pages: [1]
 
 

Powered by MySQL Powered by PHP SMF 2.0.10 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!