[lkml]   [2007]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: sdio: enhance IO_RW_EXTENDED support
On Mon, 06 Aug 2007 16:32:40 +0100
David Vrabel <> wrote:

> Drivers may care about the block size though so you can't have it
> changing behind their backs. e.g., they may need to pad data to a
> multiple of the block size.

Well, we have to assume that they aren't just padding to pass the time.

I can see a couple of reasons:

1. They are padding because it made their code easier by allowing just
one transfer.

This is what I believe is the common case, and one that will go away if
we allow the core free access to the block size. All the complexity is
in the core and the drivers don't even have to bother with setting a
block size.

2. They must write an exact number of bytes to the card before it

As far as the core is concerned, padding and "real" data are the same
thing, so this poses no restriction on how the core can fiddle with
block sizes and transfers.

3. The entire transfer must be in one transaction.

Now this is a problem as the core might prefer to do two transfers
(probably one block and one byte).

As I believe this will be a rare case, we should try to make sure we
can handle this in a way that can keep less fussy transactions simple.
So I propose changing your sdio_set_block_size() API to

That way the driver can lock the block size when it has particular
needs, yet keep it under the (assumingly more optimal) control of the
core at other times.

One could have a calling convention such as specifying a block size of
zero to turn off the forced block size.

One could also use this as a less complex way of informing the drivers
of host restrictions. If the block size specified isn't possible, we
can return an error code stating such. Without that, every driver that
needs this would need to duplicate code that computes possible block
size and would make our life a pain when we want to add new host

> >
> > I have a counter example. I have here a Marvell wifi card which
> > needs a firmware upload. And it seems to be rather picky about
> > parameters during that upload.
> >
> sdio_set_block_size(func, 64); /* ew, this card is fussy */
> download_firmware();
> sdio_set_block_size(func, func->max_blksize); /* Ahhh, back to the
> card's default */
> If a card is fussy about the block size I don't think there's anything
> cleaner than specifying directly in the driver.

Well, the driver has to specify the information somehow. As to how,
there are a number of options. My proposed sdio_force_block_size() will
work here as well.

-- Pierre Ossman

Linux kernel, MMC maintainer
PulseAudio, core developer
rdesktop, core developer
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-08-06 20:09    [W:0.087 / U:0.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site