27 Sep, 2016

1 commit

  • When using mmc_io_rw_extended, it's intent to avoid null
    pointer of card and invalid func number. But actually it
    didn't prevent that as the seg_size already use the card.
    Currently the wrapper function sdio_io_rw_ext_helper already
    use card before calling mmc_io_rw_extended, so we should move
    this check to there. As to the func number, it was token from
    '(ocr & 0x70000000) >> 28' which should be enough to guarantee
    that it won't be larger than 7. But we should prevent the
    caller like wifi drivers modify this value. So let's move this
    check into sdio_io_rw_ext_helper either.

    Also we remove the BUG_ON for mmc_send_io_op_cond since all
    possible paths calling this function are protected by checking
    the arguments in advance. After deploying these changes, we
    could not see any panic within SDIO API even if func drivers
    abuse the SDIO func APIs.

    Signed-off-by: Shawn Lin
    Signed-off-by: Ulf Hansson

    Shawn Lin
     

29 Feb, 2016

1 commit


07 Dec, 2012

1 commit

  • 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
    Signed-off-by: Chris Ball

    Kyoungil Kim
     

12 Jan, 2012

1 commit

  • 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
    Signed-off-by: Ulf Hansson
    Acked-by: Linus Walleij
    Signed-off-by: Chris Ball

    Stefan Nilsson XK
     

27 Oct, 2011

2 commits


25 May, 2011

3 commits


13 Mar, 2010

1 commit

  • 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
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Albert Herranz
     

25 Mar, 2009

1 commit


19 Apr, 2008

1 commit


02 Nov, 2007

1 commit


24 Sep, 2007

5 commits

  • 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
    Signed-off-by: Pierre Ossman

    David Brownell
     
  • 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 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
    Signed-off-by: Pierre Ossman

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

    Signed-off-by: Pierre Ossman

    Pierre Ossman
     
  • Signed-off-by: Pierre Ossman

    Pierre Ossman
     
  • Really basic init sequence for SDIO cards.

    Signed-off-by: Pierre Ossman

    Pierre Ossman