2010-04-27 19:35:51

by Steve deRosier

[permalink] [raw]
Subject: libertas sdio broken on XO-1.5s

Dan,

A change made by you on April 15th breaks firmware downloading to an
sdio connected 8686 on the OLPC's XO-1.5s. I reverted it and was able
to get firmware to load just fine, with it in, the firmware fails to
load.

commit 96021f096e5178582af296a2fbb6df7dbd6b695c
Author: Dan Williams <[email protected]>
Date: Thu Apr 15 13:27:44 2010 -0700

libertas: consolidate SDIO firmware wait code

Consolidate a bunch of C&P code that waits for the firmware to be ready.

Signed-off-by: Dan Williams <[email protected]>
Signed-off-by: John W. Linville <[email protected]>

dmesg:
[ 15.391242] libertas_sdio: Libertas SDIO driver
[ 15.391255] libertas_sdio: Copyright Pierre Ossman
[ 15.539475] libertas_sdio mmc0:0001:1: firmware: requesting sd8686_helper.bin
[ 17.540214] libertas: failed to load helper firmware
[ 17.541054] libertas_sdio: probe of mmc0:0001:1 failed with error -110

dmesg with it reverted:
[ 15.141728] libertas_sdio: Libertas SDIO driver
[ 15.141741] libertas_sdio: Copyright Pierre Ossman
[ 15.275322] libertas_sdio mmc0:0001:1: firmware: requesting sd8686_helper.bin
[ 16.430223] libertas_sdio mmc0:0001:1: firmware: requesting sd8686.bin
[ 17.172443] libertas: 00:50:43:28:26:40, fw 9.70.7p0, cap 0x00000303
[ 17.179552] libertas: wlan0: Marvell WLAN 802.11 adapter

I don't know if there's something unique with this device where
libertas_sdio works everywhere else and not with the XO-1.5, but I
suspect we'll encounter this issue with other libertas devices.

I apologize for not sending a patch, but I don't have time right now
to get to it. Perhaps you can get to it quicker, if so, I'll be happy
to test anything you come up with.

- Steve


2010-04-28 00:44:45

by Dan Williams

[permalink] [raw]
Subject: Re: libertas sdio broken on XO-1.5s

On Tue, 2010-04-27 at 12:35 -0700, Steve deRosier wrote:
> Dan,
>
> A change made by you on April 15th breaks firmware downloading to an
> sdio connected 8686 on the OLPC's XO-1.5s. I reverted it and was able
> to get firmware to load just fine, with it in, the firmware fails to
> load.

Ok, so we get to find out what fails with XO 1.5, and what works with
both the Wi2Wi and the Marvell 8686 dev board that I have that I tested
it with... I'll retest again I suppose.

> commit 96021f096e5178582af296a2fbb6df7dbd6b695c
> Author: Dan Williams <[email protected]>
> Date: Thu Apr 15 13:27:44 2010 -0700
>
> libertas: consolidate SDIO firmware wait code
>
> Consolidate a bunch of C&P code that waits for the firmware to be ready.
>
> Signed-off-by: Dan Williams <[email protected]>
> Signed-off-by: John W. Linville <[email protected]>
>
> dmesg:
> [ 15.391242] libertas_sdio: Libertas SDIO driver
> [ 15.391255] libertas_sdio: Copyright Pierre Ossman
> [ 15.539475] libertas_sdio mmc0:0001:1: firmware: requesting sd8686_helper.bin
> [ 17.540214] libertas: failed to load helper firmware
> [ 17.541054] libertas_sdio: probe of mmc0:0001:1 failed with error -110
>
> dmesg with it reverted:
> [ 15.141728] libertas_sdio: Libertas SDIO driver
> [ 15.141741] libertas_sdio: Copyright Pierre Ossman
> [ 15.275322] libertas_sdio mmc0:0001:1: firmware: requesting sd8686_helper.bin
> [ 16.430223] libertas_sdio mmc0:0001:1: firmware: requesting sd8686.bin
> [ 17.172443] libertas: 00:50:43:28:26:40, fw 9.70.7p0, cap 0x00000303
> [ 17.179552] libertas: wlan0: Marvell WLAN 802.11 adapter
>
> I don't know if there's something unique with this device where
> libertas_sdio works everywhere else and not with the XO-1.5, but I
> suspect we'll encounter this issue with other libertas devices.

The XO is all kinds of unique, but the 1.5 less so than the 1.0.

Dan

> I apologize for not sending a patch, but I don't have time right now
> to get to it. Perhaps you can get to it quicker, if so, I'll be happy
> to test anything you come up with.
>
> - Steve
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html



2010-04-28 23:33:30

by Steve deRosier

[permalink] [raw]
Subject: Re: [PATCH] libertas: fix 8686 firmware loading regression in 96021f096e5178582af296a2fbb6df7dbd6b695c

Dan,

I tried your patch, it works on the XO-1.5.

Thank you.

- Steve

On Wed, Apr 28, 2010 at 12:37 PM, Dan Williams <[email protected]> wrote:
> The 'ready' condition was incorrectly evaluated which sometimes lead to
> failures loading the second-stage firmware on 8686 devices.
>
> Signed-off-by: Dan Williams <[email protected]>
>
> ---
> diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
> index 13dfeda..64dd345 100644
> --- a/drivers/net/wireless/libertas/if_sdio.c
> +++ b/drivers/net/wireless/libertas/if_sdio.c
> @@ -324,7 +324,9 @@ static int if_sdio_wait_status(struct if_sdio_card *card, const u8 condition)
> ? ? ? ?timeout = jiffies + HZ;
> ? ? ? ?while (1) {
> ? ? ? ? ? ? ? ?status = sdio_readb(card->func, IF_SDIO_STATUS, &ret);
> - ? ? ? ? ? ? ? if (ret || (status & condition))
> + ? ? ? ? ? ? ? if (ret)
> + ? ? ? ? ? ? ? ? ? ? ? return ret;
> + ? ? ? ? ? ? ? if ((status & condition) == condition)
> ? ? ? ? ? ? ? ? ? ? ? ?break;
> ? ? ? ? ? ? ? ?if (time_after(jiffies, timeout))
> ? ? ? ? ? ? ? ? ? ? ? ?return -ETIMEDOUT;
>
>
>

2010-04-28 19:37:50

by Dan Williams

[permalink] [raw]
Subject: [PATCH] libertas: fix 8686 firmware loading regression in 96021f096e5178582af296a2fbb6df7dbd6b695c

The 'ready' condition was incorrectly evaluated which sometimes lead to
failures loading the second-stage firmware on 8686 devices.

Signed-off-by: Dan Williams <[email protected]>

---
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 13dfeda..64dd345 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -324,7 +324,9 @@ static int if_sdio_wait_status(struct if_sdio_card *card, const u8 condition)
timeout = jiffies + HZ;
while (1) {
status = sdio_readb(card->func, IF_SDIO_STATUS, &ret);
- if (ret || (status & condition))
+ if (ret)
+ return ret;
+ if ((status & condition) == condition)
break;
if (time_after(jiffies, timeout))
return -ETIMEDOUT;