1. 09 1月, 2011 2 次提交
    • A
      mmc: Fix sd/sdio/mmc initialization frequency retries · 807e8e40
      Andy Ross 提交于
      Rewrite and clean up mmc_rescan() to properly retry frequencies lower
      than 400kHz.  Failures can happen both in sd_send_* calls and
      mmc_attach_*.  Break out "mmc_rescan_try_freq" from the frequency
      selection loop.  Symmetrize claim/release logic in mmc_attach_* API,
      and move the sd_send_* calls there to make mmc_rescan easier to read.
      Signed-off-by: NAndy Ross <andy.ross@windriver.com>
      Reviewed-and-Tested-by: NHein Tibosch <hein_tibosch@yahoo.es>
      Reviewed-by: NChris Ball <cjb@laptop.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      807e8e40
    • L
      mmc: Aggressive clock gating framework · 04566831
      Linus Walleij 提交于
      This patch modifies the MMC core code to optionally call the set_ios()
      operation on the driver with the clock frequency set to 0 (gate) after
      a grace period of at least 8 MCLK cycles, then restore it (ungate)
      before any new request. This gives the driver the option to shut down
      the MCI clock to the MMC/SD card when the clock frequency is 0, i.e.
      the core has stated that the MCI clock does not need to be generated.
      
      It is inspired by existing clock gating code found in the OMAP and
      Atmel drivers and brings this up to the host abstraction.  Gating is
      performed before and after any MMC request.
      
      This patchset implements this for the MMCI/PL180 MMC/SD host controller,
      but it should be simple to switch OMAP/Atmel over to using this instead.
      
      mmc_set_{gated,ungated}() add variable protection to the state holders
      for the clock gating code.  This is particularly important when ordinary
      .set_ios() calls would race with the .set_ios() call resulting from a
      delayed gate operation.
      Signed-off-by: NLinus Walleij <linus.walleij@stericsson.com>
      Reviewed-by: NChris Ball <cjb@laptop.org>
      Tested-by: NChris Ball <cjb@laptop.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      04566831
  2. 23 10月, 2010 4 次提交
  3. 12 8月, 2010 1 次提交
    • A
      mmc: add erase, secure erase, trim and secure trim operations · dfe86cba
      Adrian Hunter 提交于
      SD/MMC cards tend to support an erase operation.  In addition, eMMC v4.4
      cards can support secure erase, trim and secure trim operations that are
      all variants of the basic erase command.
      
      SD/MMC device attributes "erase_size" and "preferred_erase_size" have been
      added.
      
      "erase_size" is the minimum size, in bytes, of an erase operation.  For
      MMC, "erase_size" is the erase group size reported by the card.  Note that
      "erase_size" does not apply to trim or secure trim operations where the
      minimum size is always one 512 byte sector.  For SD, "erase_size" is 512
      if the card is block-addressed, 0 otherwise.
      
      SD/MMC cards can erase an arbitrarily large area up to and
      including the whole card.  When erasing a large area it may
      be desirable to do it in smaller chunks for three reasons:
      
          1. A single erase command will make all other I/O on the card
             wait.  This is not a problem if the whole card is being erased, but
             erasing one partition will make I/O for another partition on the
             same card wait for the duration of the erase - which could be a
             several minutes.
      
          2. To be able to inform the user of erase progress.
      
          3. The erase timeout becomes too large to be very useful.
             Because the erase timeout contains a margin which is multiplied by
             the size of the erase area, the value can end up being several
             minutes for large areas.
      
      "erase_size" is not the most efficient unit to erase (especially for SD
      where it is just one sector), hence "preferred_erase_size" provides a good
      chunk size for erasing large areas.
      
      For MMC, "preferred_erase_size" is the high-capacity erase size if a card
      specifies one, otherwise it is based on the capacity of the card.
      
      For SD, "preferred_erase_size" is the allocation unit size specified by
      the card.
      
      "preferred_erase_size" is in bytes.
      Signed-off-by: NAdrian Hunter <adrian.hunter@nokia.com>
      Acked-by: NJens Axboe <axboe@kernel.dk>
      Cc: Kyungmin Park <kmpark@infradead.org>
      Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Ben Gardiner <bengardiner@nanometrics.ca>
      Cc: <linux-mmc@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      dfe86cba
  4. 16 12月, 2009 1 次提交
    • B
      mmc: add module parameter to set whether cards are assumed removable · bd68e083
      Ben Hutchings 提交于
      Some people run general-purpose distribution kernels on netbooks with
      a card that is physically non-removable or logically non-removable
      (e.g. used for /home) and cannot be cleanly unmounted during suspend.
      Add a module parameter to set whether cards are assumed removable or
      non-removable, with the default set by CONFIG_MMC_UNSAFE_RESUME.
      
      In general, it is not possible to tell whether a card present in an MMC
      slot after resume is the same that was there before suspend.  So there are
      two possible behaviours, each of which will cause data loss in some cases:
      
      CONFIG_MMC_UNSAFE_RESUME=n (default): Cards are assumed to be removed
      during suspend.  Any filesystem on them must be unmounted before suspend;
      otherwise, buffered writes will be lost.
      
      CONFIG_MMC_UNSAFE_RESUME=y: Cards are assumed to remain present during
      suspend.  They must not be swapped during suspend; otherwise, buffered
      writes will be flushed to the wrong card.
      
      Currently the choice is made at compile time and this allows that to be
      overridden at module load time.
      Signed-off-by: NBen Hutchings <ben@decadent.org.uk>
      Cc: Wouter van Heyst <larstiq@larstiq.dyndns.org>
      Cc: <linux-mmc@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bd68e083
  5. 23 9月, 2009 3 次提交
  6. 27 7月, 2008 2 次提交
    • H
      mmc: Add per-card debugfs support · f4b7f927
      Haavard Skinnemoen 提交于
      For each card successfully added to the bus, create a subdirectory under
      the host's debugfs root with information about the card.
      
      At the moment, only a single file is added to the card directory for
      all cards: "state". It reflects the "state" field in struct mmc_card,
      indicating whether the card is present, readonly, etc.
      
      For MMC and SD cards (not SDIO), another file is added: "status".
      Reading this file will ask the card about its current status and
      return it. This can be useful if the card just refuses to respond to
      any commands, which might indicate that the card state is not what the
      MMC core thinks it is (due to a missing stop command, for example.)
      Signed-off-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      f4b7f927
    • H
      mmc: Export internal host state through debugfs · 6edd8ee6
      Haavard Skinnemoen 提交于
      When CONFIG_DEBUG_FS is set, create a few files under /sys/kernel/debug
      containing information about an mmc host's internal state. Currently,
      just a single file is created, "ios", which contains information about
      the current operating parameters for the bus (clock speed, bus width,
      etc.)
      
      Host drivers can add additional files and directories under the host's
      root directory by passing the debugfs_root field in struct mmc_host as
      the 'parent' parameter to debugfs_create_*.
      Signed-off-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      6edd8ee6
  7. 19 4月, 2008 1 次提交
  8. 23 3月, 2008 1 次提交
  9. 24 9月, 2007 1 次提交
    • D
      MMC core learns about SPI · af517150
      David Brownell 提交于
      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: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      af517150
  10. 26 7月, 2007 1 次提交
  11. 10 7月, 2007 2 次提交
  12. 01 5月, 2007 4 次提交
    • P
      mmc: support unsafe resume of cards · 6abaa0c9
      Pierre Ossman 提交于
      Since many have the system root on MMC/SD we must allow some foot
      shooting when it comes to resume.
      
      We cannot detect if a card is removed and reinserted during suspend,
      so the safe approach would be to assume it was, avoiding potential
      filesystem corruption. This will of course not work if you cannot
      release the card before suspend.
      
      This commit adds a compile time option that makes the MMC layer
      assume the card wasn't touched if it is redetected upon resume.
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      6abaa0c9
    • P
      mmc: add bus handler · 7ea239d9
      Pierre Ossman 提交于
      Delegate protocol handling to "bus handlers". This allows the core to
      just handle the task of arbitrating the bus. Initialisation and
      pampering of cards is now done by the different bus handlers.
      
      This design also allows MMC and SD (and later SDIO) to be more cleanly
      separated, allowing easier maintenance.
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      7ea239d9
    • P
      mmc: Separate out protocol ops · da7fbe58
      Pierre Ossman 提交于
      Move protocol operations and definitions into their own files
      in an effort to separate protocol handling and bus
      arbitration more clearly.
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      da7fbe58
    • P
      mmc: Move core functions to subdir · aaac1b47
      Pierre Ossman 提交于
      Create a "core" subdirectory to house the central bus handling
      functions.
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      aaac1b47
  13. 22 11月, 2006 1 次提交
  14. 04 10月, 2006 1 次提交
    • P
      [PATCH] mmc: use own work queue · 7104e2d5
      Pierre Ossman 提交于
      The MMC layer uses the standard work queue for doing card detection.  As this
      queue is shared with other crucial subsystems, the effects of a long (and
      perhaps buggy) detection can cause the system to be unusable.  E.g.  the
      keyboard stops working while the detection routine is running.
      
      The solution is to add a specific mmc work queue to run the detection code in.
      This is similar to how other subsystems handle detection (a full kernel
      thread is the most common theme).
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      7104e2d5
  15. 19 8月, 2005 1 次提交
  16. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4