libertas_sdio doesn't work after reloading
Matt Reimer
mreimer at sdgsystems.com
Tue Feb 3 15:17:02 EST 2009
On Tue, Feb 3, 2009 at 11:44 AM, Dan Williams <dcbw at redhat.com> wrote:
> On Tue, 2009-02-03 at 14:27 -0500, Dan Williams wrote:
>> On Tue, 2009-02-03 at 11:09 -0800, Matt Reimer wrote:
>> > On Tue, Feb 3, 2009 at 7:42 AM, Dan Williams <dcbw at redhat.com> wrote:
>> > > On Tue, 2009-02-03 at 11:20 +0000, Jonathan Cameron wrote:
>> > >> Matt Reimer wrote:
>> > >> > On Mon, Feb 2, 2009 at 1:58 PM, Andrey Yurovsky <andrey at cozybit.com> wrote:
>> > >> >> Hi Matt. Is this on an embedded system or on a desktop PC with some
>> > >> >> host controller? If so, which one? I'm curious because module reload
>> > >> >> seems to work fine with my Ricoh host controller.
>> > >> >
>> > >> > This is on an embedded system, using the SD controller on a pxa320.
>> > >> >
>> > >> > Matt
>> > >> >
>> > >> I ran into exactly the same issue with a pxa271 board, but never figured
>> > >> out what was going on. Very interested to hear if you do!
>> > >
>> > > The only method I have found to reset the libertas chip is to pull the
>> > > power from the card or unplug it. There hasn't been any other method
>> > > that we can figure out to hard-reset the card, either with SDIO commands
>> > > or with CMD_802_11_RESET. I'd be quite interested if anyone found a
>> > > mechanism for doing a full reset while the card's plugged in.
>> >
>> > Do you think the problem could be that after reset the libertas chip
>> > is talking to the controller at the wrong bus speed and bus width?
>>
>> It could well be. Pierre, I and Philip Rakity are having a side
>> conversation right now about this sort of thing. Let me see if Philip
>> would mind if I pasted in his debugging patch for that. Basically,
>> issue an SDIO ABORT/reset during MMC bus rescan. That could kick the
>> card hard enough for it to be re-enumerated and take firmware upload
>> again.
>
> Philip's patch is below. The mmc/core/core.c stuff doesn't apply
> directly any more, but the function getting patched is mmc_rescan() as
> far as I can tell. Give it a shot and see if it helps you.
>
> Pierre tried something similar a while ago but noticed problems with the
> cards getting wedged because they saw the SDIO ABORT on the bus before
> being fully enumerated, or something like that.
I applied Philip's patch to 2.6.28, putting the mmc_force_reset() here
in mmc_rescan():
/*
* First we search for SDIO...
*/
mmc_force_reset(host);
err = mmc_send_io_op_cond(host, 0, &ocr);
if (!err) {
if (mmc_attach_sdio(host, ocr))
mmc_power_off(host);
goto out;
}
And got the same result:
/ # insmod ./libertas_sdio.ko
libertas_sdio: Libertas SDIO driver
libertas_sdio: Copyright Pierre Ossman
read_scratch: 0x00000094
libertas_sdio mmc1:0001:1: firmware: requesting sd8686_helper.bin
libertas: failed to load helper firmware
libertas_sdio: probe of mmc1:0001:1 failed with error -110
The fact that we're still reading 0x00000094 from the scratch register
(which is the same value read after a normal, successful
initialization, before rmmod'ing the driver) suggests that we are
still properly talking to the card.
More ideas? I'm willing to test.
Matt
More information about the libertas-dev
mailing list