History log of /drivers/mmc/core/sdio_io.c
Revision Date Author Comments
59d1a8e7c39bfd324060e1f14c5aa0133c847cb8 11-Nov-2008 Dmitry Shmidt <dimitrysh@google.com> trout: Add functions for WiFi
968a64ea638bbd48839b41981ff50197f3412676 22-Oct-2012 Kyoungil Kim <ki0351.kim@samsung.com> mmc: sdio: Use multiple scatter/gather list

Before this patch, we always used only single sg entry for SDIO transfer.
This patch switches to using multiple sg entries. In the case of dwmci,
it supports only up to 4KB size per single sg entry. So if we want to
transfer more than 4KB, we should send more than 1 command.

When we tested before applying this patch, it took around 335 us for
5K(5120) bytes transfer with dwmci controller. After applying this patch,
it takes 242 us for 5K bytes. So this patch makes around 38% performance
improvement for 5K bytes transfer. If the transfer size is bigger, then
the performance improvement ratio will be increased.

Signed-off-by: Kyoungil Kim <ki0351.kim@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
052d81da6e6f0f8839ef6d5a46f215fc8cd99d5a 26-Oct-2011 Stefan Nilsson XK <stefan.xk.nilsson@stericsson.com> mmc: sdio: Fix to support any block size optimally

This patch allows any block size to be set on the SDIO link,
and still have an arbitrary sized packet (adjusted in size by
using sdio_align_size) transferred in an optimal way
(preferably one transfer).

Previously if the block size was larger than the default of
512 bytes and the transfer size was exactly one block size
(possibly thanks to using sdio_align_size to get an optimal
transfer size), it was sent as a number of byte transfers instead
of one block transfer. Also if the number of blocks was
(max_blocks * N) + 1, the tranfer would be conducted with a number
of blocks and finished off with a number of byte transfers.

When doing this change it was also possible to break out the quirk
for broken byte mode in a much cleaner way, and collect the logic of
when to do byte or block transfer in one function instead of two.

Signed-off-by: Stefan Nilsson XK <stefan.xk.nilsson@stericsson.com>
Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
3ef77af154b03776c6c662c68c6332719e9eecac 10-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com> mmc: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required

These two basic defines were everywhere, simply because module.h
was also everywhere. But we are cleaning up the latter. So make
the exporters actually call out their need for the include.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
6c1f716e8154ee9315534782b9b1eedea0559a24 26-May-2010 Grazvydas Ignotas <notasas@gmail.com> sdio: add new function for RAW (Read after Write) operation

SDIO specification allows RAW (Read after Write) operation using
IO_RW_DIRECT command (CMD52) by setting the RAW bit. This operation is
similar to ordinary read/write commands, except that both write and read
are performed using single command/response pair. The Linux SDIO layer
already supports this internaly, only external function is missing for
drivers to make use, which is added by this patch.

This type of command is required to implement proper power save mode
support in wl1251 wifi driver.

Android has similar patch for G1 in it's tree for the same reason:

http://android.git.kernel.org/?p=kernel/common.git;a=commitdiff;h=74a47786f6ecbe6c1cf9fb15efe6a968451deb52

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Acked-by: Kalle Valo <kalle.valo@iki.fi>
Cc: Dmitry Shmidt <dimitrysh@google.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
da68c4eb258cd9f3f0b8aeb7e46b8118bb6358b6 05-Mar-2010 Nicolas Pitre <nico@fluxnic.net> sdio: introduce API for special power management features

This patch series provides the core changes needed to allow SDIO cards to
remain powered and active while the host system is suspended, and let them
wake up the host system when needed. This is used to implement
wake-on-lan with SDIO wireless cards at the moment. Patches to add that
support to the libertas driver will be posted separately.

This patch:

Some SDIO cards have the ability to keep on running autonomously when the
host system is suspended, and wake it up when needed. This however
requires that the host controller preserve power to the card, and
configure itself appropriately for wake-up.

There is however 4 layers of abstractions involved: the host controller
driver, the MMC core code, the SDIO card management code, and the actual
SDIO function driver. To make things simple and manageable, host drivers
must advertise their PM capabilities with a feature bitmask, then function
drivers can query and set those features from their suspend method. Then
each layer in the suspend call chain is expected to act upon those bits
accordingly.

[akpm@linux-foundation.org: fix typo in comment]
Signed-off-by: Nicolas Pitre <nico@marvell.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3fb7fb4a01d09f81d1daaf65e52d929734bd691f 05-Mar-2010 Bing Zhao <bzhao@marvell.com> sdio: add quirk to clamp byte mode transfer

Some SDIO cards expect byte transfers not to exceed the configured block
transfer size. Add a quirk to that effect.

Patches to make use of this quirk will be sent separately.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Nicolas Pitre <nico@marvell.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
7c979ec7135d96bbff34790bf4b85a8508ede7fc 23-Sep-2009 Ohad Ben-Cohen <ohad@wizery.com> sdio: add MMC_QUIRK_LENIENT_FN0

Normally writes to SDIO function 0 outside the vendor specific CCCR
registers are prohibited.

To support embedded devices that require writes to SDIO function 0 outside
this range (e.g. TI WL127x embedded sdio wifi device),
MMC_QUIRK_LENIENT_FN0 is introduced.

A card quirks field is added to `struct mmc_card' to support non-standard
devices (e.g. embedded sdio devices).

[akpm@linux-foundation.org: code in C, not cpp!]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ea901300cd8b809285fa5cbced18124f127e0ac6 10-Jul-2008 Tomas Winkler <tomas.winkler@intel.com> sdio: sdio_io.c Fix sparse warnings

Unfold nested macros it creates not readable code and
sparse warnings
sdio_io.c:190:9: warning: symbol '_min1' shadows an earlier one

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
62a7573ee9f31d4fdb330b3e68ebf6efaba1d57c 10-Jul-2008 Benzi Zbit <benzi.zbit@intel.com> sdio: fix the use of hard coded timeout value.

This adds reading and using of enable_timeout from the CIS

Signed-off-by: Benzi Zbit <benzi.zbit@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
6d37333163025b46afbcad434ec9a5f2e88e7254 30-Jun-2008 Tomas Winkler <tomas.winkler@intel.com> mmc: fix sdio_io sparse errors

This patch fixes sdio_io sparse errors.
This fix changes signature of API functions,
changing
unsigned char -> u8
unsigned short -> u16
unsigned long -> u32 - this was probably a bug in 64 bit platforms

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
eea0f581c4e596e02250df230f8d385827977964 28-Jun-2008 Pierre Ossman <drzeus@drzeus.cx> sdio: clean up handling of byte mode transfer size

Make sure that the maximum size for a byte mode transfer is identical
in all places. Also tweak the transfer helper so that a single byte
mode transfer is preferred over (possibly multiple) block mode
request(s).

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
ad3868b2ec96ec14a1549c9e33f5f9a2a3c6ab15 28-Jun-2008 Pierre Ossman <drzeus@drzeus.cx> mmc,sdio: helper function for transfer padding

There are a lot of crappy controllers out there that cannot handle
all the request sizes that the MMC/SD/SDIO specifications require.
In case the card driver can pad the data to overcome the problems,
this commit adds a helper that calculates how much that padding
should be.

A corresponding helper is also added for SDIO, but it can also deal
with all the complexities of splitting up a large transfer efficiently.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
7806cdb40fd562e5dcc07321579b62a5dc7cd95c 10-Aug-2007 David Vrabel <david.vrabel@csr.com> sdio: add sdio_f0_readb() and sdio_f0_writeb()

Add sdio_f0_readb() and sdio_f0_writeb() functions to reading and
writing function 0 registers. Writes outside the vendor specific CCCR
registers (0xF0 - 0xFF) are not permitted.

Signed-off-by: David Vrabel <david.vrabel@csr.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
eb6594689226663968ef0a9fd71ec5e1e4e04f9c 08-Aug-2007 David Vrabel <david.vrabel@csr.com> sdio: extend sdio_readsb() and friends to handle any length of buffer

Extend sdio_readsb(), sdio_writesb(), sdio_memcpy_fromio(), and
sdio_memcpy_toio() to handle any length of buffer by splitting the transfer
into several IO_RW_EXTENDED commands. Typically, a transfer would be split
into a single block mode transfer followed by a byte mode transfer for the
remainder but we also handle lack of block mode support and the block size
being greater than 512 (the maximum byte mode transfer size).

host->max_seg_size <= host->max_req_size so there's no need to check both
when determining the maximum data size for a single command.

Signed-off-by: David Vrabel <david.vrabel@csr.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
9a08f82b3cc522f727ace580a2aaee5402435bc8 08-Aug-2007 David Vrabel <david.vrabel@csr.com> sdio: set the functions' block size

Before a driver is probed, set the function's block size to the default so the
driver is sure the block size is something sensible and it needn't explicitly
set it.

The default block size is the largest that's supported by both the card and
the host, with a maximum of 512 to ensure aribitrarily sized transfer use the
optimal (least) number of commands.

See http://lkml.org/lkml/2007/8/7/150 for reasons for the block size choice.

Signed-off-by: David Vrabel <david.vrabel@csr.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
112c9db91ee6bf19eca7cbb6854be3127381c229 06-Jul-2007 Pierre Ossman <drzeus@drzeus.cx> sdio: support IO_RW_EXTENDED

Support the multi-byte transfer operation, including handlers for
common operations like writel()/readl().

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
fa64efa1f2a0672767ad0753a6e4bfa4bcc77b87 27-May-2007 Pierre Ossman <drzeus@drzeus.cx> mmc: enable/disable functions for SDIO

Like many other buses, the devices (functions) on the SDIO bus
must be enabled before they can be used. Add functions that allow
drivers to do so.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
46f555f2731a14545a09ec06d27bd18e8e07069f 27-May-2007 Pierre Ossman <drzeus@drzeus.cx> mmc: add basic SDIO I/O operations

Add command wrappers that simplify register access from SDIO
function drivers.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>