History log of /drivers/mmc/core/sdio_ops.c
Revision Date Author Comments
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>
9a0da648ff3a5020406ac7784eb3b519014f66f6 15-Sep-2011 Stefan Nilsson XK <stefan.xk.nilsson@stericsson.com> mmc: sdio: Workaround for dev with broken CMD53

Adds a quirk which can be turned on for SDIO devices that do not support
512 byte requests in byte mode during CMD53. These requests will always
be sent in block mode instead.

This patch also enables this quirk for ST-Ericsson CW1200 WLAN device.

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>
ad5fd97288655b5628052c1fa906419417c86100 24-Aug-2011 Venkatraman S <svenkatr@ti.com> mmc: fix integer assignments to pointer

Fix the sparse warning output "warning: Using plain integer as NULL pointer"

Signed-off-by: Venkatraman S <svenkatr@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
24f5b53ba076e983bc64fa48534ca795d7813d51 14-Apr-2011 Chris Ball <cjb@laptop.org> mmc: initialize struct mmc_request at declaration time

Converts from:
struct mmc_request mrq;
memset(&mrq, 0, sizeof(struct mmc_request));

to:
struct mmc_request mrq = {0};

because it's shorter, as performant, and easier to work out whether
initialization has happened.

Signed-off-by: Chris Ball <cjb@laptop.org>
a61ad2b49bfce94dfddce828cd9222e4b9e7825b 14-Apr-2011 Chris Ball <cjb@laptop.org> mmc: initialize struct mmc_data at declaration time

Converts from:
struct mmc_data data;
memset(&data, 0, sizeof(struct mmc_data));

to:
struct mmc_data data = {0};

because it's shorter, as performant, and easier to work out whether
initialization has happened.

Signed-off-by: Chris Ball <cjb@laptop.org>
1278dba167f01bb3c6626d16450d31129d041087 14-Apr-2011 Chris Ball <cjb@laptop.org> mmc: initialize struct mmc_command at declaration time

Converts from:
struct mmc_command cmd;
memset(&cmd, 0, sizeof(struct mmc_command));

to:
struct mmc_command cmd = {0};

because it's shorter, as performant, and easier to work out whether
initialization has happened.

Signed-off-by: Chris Ball <cjb@laptop.org>
516a82422209e078345d0ca54b16793d7bfd4782 11-Mar-2010 Albert Herranz <albert_herranz@yahoo.es> sdio: recognize io card without powercycle

SDIO Simplified Specification V2.00 states that it is strongly recommended
that the host executes either a power reset or issues a CMD52 (I/O Reset)
to re-initialize an I/O only card or the I/O portion of a combo card.
Additionally, the CMD52 must be issued first because it cannot be issued
after a CMD0.

With this patch the Nintendo Wii SDIO-based WLAN card is detected after a
system reset, without requiring a complete system powercycle.

Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
be6f19fc24c937112d251232b3dae7e05e96aad1 05-Mar-2009 Pierre Ossman <drzeus@drzeus.cx> sdio: check that addresses are within the address space

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
e70aa3fac1ac50c7a75ac676a1489dd1ea3b4be5 13-Apr-2008 Adrian Bunk <bunk@kernel.org> mmc: sdio_ops.c should #include "sdio_ops.h"

Every file should include the headers containing the externs for its
global functions.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
87ae9afdcada236d0a1b38ce2c465a65916961dc 30-Oct-2007 Adrian Bunk <bunk@kernel.org> cleanup asm/scatterlist.h includes

Not architecture specific code should not #include <asm/scatterlist.h>.

This patch therefore either replaces them with
#include <linux/scatterlist.h> or simply removes them if they were
unused.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
af51715079e7fb6b290e1881d63d815dc4de5011 08-Aug-2007 David Brownell <david-b@pacbell.net> MMC core learns about SPI

Teach the MMC/SD/SDIO core about using SPI mode.

- Use mmc_host_is_spi() so enumeration works through SPI signaling
and protocols, not just the native versions.

- Provide the SPI response type flags with each request issued,
including requests from the new lock/unlock code.

- Understand that cmd->resp[0] and mmc_get_status() results for SPI
return different values than for "native" MMC/SD protocol; this
affects resetting, checking card lock status, and some others.

- Understand that some commands act a bit differently ... notably:
* OP_COND command doesn't return the OCR
* APP_CMD status doesn't have an R1_APP_CMD analogue

Those changes required some new and updated primitives:

- Provide utilities to access two SPI-only requests, and one
request that wasn't previously needed:
* mmc_spi_read_ocr() ... SPI only
* mmc_spi_set_crc() ... SPI only (override by module parm)
* mmc_send_cid() ... for use without broadcast mode

- Updated internal routines:
* Previous mmc_send_csd() modified into mmc_send_cxd_native();
it uses native "R2" responses, which include 16 bytes of data.
* Previous mmc_send_ext_csd() becomes new mmc_send_cxd_data()
helper for command-and-data access
* Bugfix to that mmc_send_cxd_data() code: dma-to-stack is
unsafe/nonportable, so kmalloc a bounce buffer instead.

- Modified mmc_send_ext_csd() now uses mmc_send_cxd_data() helper

- Modified mmc_send_csd(), and new mmc_spi_send_cid(), routines use
those helper routines based on whether they're native or SPI

The newest categories of cards supported by the MMC stack aren't expected
to work yet with SPI: MMC or SD cards with over 4GB data, and SDIO.
All those cards support SPI mode, so eventually they should work too.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
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>
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>
b2bcc798bbb482b2909801280f3c4aff8cbbf5be 22-May-2007 Pierre Ossman <drzeus@drzeus.cx> mmc: implement SDIO IO_RW_DIRECT operation

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
5c4e6f1301649d5b29dd0f70e6da83e728ab5ca5 21-May-2007 Pierre Ossman <drzeus@drzeus.cx> mmc: detect SDIO cards

Really basic init sequence for SDIO cards.

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