libertas_sdio on at91sam9263

Dan Williams dcbw at redhat.com
Tue Dec 18 09:57:57 EST 2007


On Tue, 2007-12-18 at 14:27 +0100, Marc Pignat wrote:
> On Tuesday 18 December 2007, Hans-Jürgen Koch wrote:
> > Am Tue, 18 Dec 2007 11:39:00 +0100
> > schrieb Marc Pignat <marc.pignat at hevs.ch>:
> ...
> > Hmm, yes, but looking at at91_mci.c, I guess it should show an
> > "Unsupported block size" error message and then fail. Can't remember I
> > ever saw that.
> Probably because the firmware loading fails :-D
> 
> > 
> > > 
> > > Please note that the at91_mci driver can be fixed for at91sam series,
> > > but not for at91rm9200... I think the better way is to always round
> > > data transfer size, this will introduce a very small overhead, but
> > > the libertas_sdio driver will work with more sd hosts.
> > 
> > Agreed, but where would you do that? Loading the firmware doesn't seem
> > to be handled by libertas_sdio itself, it just calls request_firmware().
> nack, the request_firmware functions loads the firmware from userspace to
> the system memory...
> 
> size could be rounded up in if_sdio_card_to_host and if_sdio_host_to_card
> functions.

Pierre would have to weigh in here, but we decided to keep the stack
free from this workaround.  This is a problem with SDIO controllers, and
network drivers shouldn't have to carry hacks to work around broken SDIO
controllers, because that's just really the wrong place for this sort of
thing.  There are some nice layering violations necessary to fix this,
and Pierre opted for keeping the stack hack-free but adding a note in
if_sdio.c:

 * As SDIO is still new to the kernel, it is unfortunately common with
 * bugs in the host controllers related to that. One such bug is that
 * controllers cannot do transfers that aren't a multiple of 4 bytes.
 * If you don't have time to fix the host controller driver, you can
 * work around the problem by modifying if_sdio_host_to_card() and
 * if_sdio_card_to_host() to pad the data.

So for now, if your controller sucks, you get to work around the bug in
your sources as we'd like to keep the upstream kernel bits free from
hacks until a reasonable workaround can be figured out (which probably
means fixing the host controller driver).

This bug is more common than you might expect; the OLPC CAFE SDIO
controller also has this problem.  The spec should probably be clearer
since so many chip vendors seem to screw this up.

Dan





More information about the libertas-dev mailing list