1. 23 10月, 2010 7 次提交
  2. 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
  3. 11 8月, 2010 1 次提交
    • M
      mmc: fix all hangs related to mmc/sd card insert/removal during suspend/resume · 4c2ef25f
      Maxim Levitsky 提交于
      If you don't use CONFIG_MMC_UNSAFE_RESUME, as soon as you attempt to
      suspend, the card will be removed, therefore this patch doesn't change the
      behavior of this option.
      
      However the removal will be done by pm notifier, which runs while
      userspace is still not frozen and thus can freely use del_gendisk, without
      the risk of deadlock which would happen otherwise.
      
      Card detect workqueue is now disabled while userspace is frozen, Therefore
      if you do use CONFIG_MMC_UNSAFE_RESUME, and remove the card during
      suspend, the removal will be detected as soon as userspace is unfrozen,
      again at the moment it is safe to call del_gendisk.
      
      Tested with and without CONFIG_MMC_UNSAFE_RESUME with suspend and hibernate.
      
      [akpm@linux-foundation.org: clean up function prototype]
      [akpm@linux-foundation.org: fix CONFIG_PM-n linkage, small cleanups]
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NMaxim Levitsky <maximlevitsky@gmail.com>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: <linux-mmc@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4c2ef25f
  4. 28 5月, 2010 1 次提交
  5. 14 4月, 2010 1 次提交
    • D
      ARM: MXC: mxcmmc: work around a bug in the SDHC busy line handling · 3fcb027d
      Daniel Mack 提交于
      MX3 SoCs have a silicon bug which corrupts CRC calculation of
      multi-block transfers when connected SDIO peripheral doesn't drive the
      BUSY line as required by the specs.
      
      One way to prevent this is to only allow 1-bit transfers.
      
      Another way is playing tricks with the DMA engine, but this isn't
      mainline yet. So for now, we live with the performance drawback of 1-bit
      transfers until a nicer solution is found.
      
      This patch introduces a new host controller callback 'init_card' which
      is for now only called from mmc_sdio_init_card().
      Signed-off-by: NDaniel Mack <daniel@caiaq.de>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Volker Ernst <volker.ernst@txtr.com>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Michał Mirosław <mirqus@gmail.com>
      Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de>
      3fcb027d
  6. 07 3月, 2010 1 次提交
    • N
      sdio: introduce API for special power management features · da68c4eb
      Nicolas Pitre 提交于
      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: NNicolas Pitre <nico@marvell.com>
      Cc: <linux-mmc@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      da68c4eb
  7. 12 10月, 2009 1 次提交
  8. 23 9月, 2009 5 次提交
  9. 31 3月, 2009 1 次提交
  10. 01 1月, 2009 1 次提交
  11. 09 11月, 2008 1 次提交
  12. 12 10月, 2008 1 次提交
  13. 27 7月, 2008 1 次提交
  14. 15 7月, 2008 3 次提交
    • P
      mmc: remove multiwrite capability · 23af6039
      Pierre Ossman 提交于
      Relax requirements on host controllers and only require that they do not
      report a transfer count than is larger than the actual one (i.e. a lower
      value is okay). This is how many other parts of the kernel behaves so
      upper layers should already be prepared to handle that scenario. This
      gives us a performance boost on MMC cards.
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      23af6039
    • A
      mmc: change .get_ro() callback semantics · 08f80bb5
      Anton Vorontsov 提交于
      Now get_ro() callback must return 0/1 values for its logical states, and
      negative errno values in case of error. If particular host instance doesn't
      support RO/WP switch, it should return -ENOSYS.
      
      This patch changes some hosts in two ways:
      
      1. Now functions should be smart to not return negative values in
         "RO asserted" case (particularly gpio_ calls could return negative
         values for the outermost GPIOs).
      
         Also, board code usually passes get_ro() callbacks that directly return
         gpioreg & bit result, so at91_mci, imxmmc, pxamci and mmc_spi's get_ro()
         handlers need take special care when returning platform's values to the
         mmc core.
      
      2. In case of host instance didn't implement get_ro() callback, it should
         really return -ENOSYS and let the mmc core decide what to do about it
         (mmc core thinks the same way as the hosts, so it isn't functional
         change).
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      08f80bb5
    • A
      mmc: add support for card-detection polling · 28f52482
      Anton Vorontsov 提交于
      Some hosts (and boards that use mmc_spi) do not use interrupts on the CD
      line, so they can't trigger mmc_detect_change. We want to poll the card
      and see if there was a change. 1 second poll interval seems resonable.
      
      This patch also implements .get_cd() host operation, that could be used
      by the hosts that are able to report card-detect status without need to
      talk MMC.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      28f52482
  15. 13 12月, 2007 1 次提交
  16. 24 9月, 2007 4 次提交
  17. 23 9月, 2007 1 次提交
  18. 01 5月, 2007 7 次提交
    • P
      MMC: Fix handling of low-voltage cards · 55556da0
      Philip Langdale 提交于
      Fix handling of low voltage MMC cards.
      
      The latest MMC and SD specs both agree that support for
      low-voltage operations is indicated by bit 7 in the OCR.
      The MMC spec states that the low voltage range is
      1.65-1.95V while the SD spec leaves the actual voltage
      range undefined - meaning that there is still no such
      thing as a low voltage SD card.
      
      However, an old Sandisk spec implied that bits 7.0
      represented voltages below 2.0V in 1V or 0.5V increments,
      and the code was accordingly written with that expectation.
      
      This confusion meant that host drivers attempting to support
      the typical low voltage (1.8V) would set the wrong bits in
      the host OCR mask (usually bits 5 and/or 6) resulting in the
      the low voltage mode never being used.
      
      This change corrects the low voltage range and adds sanity
      checks on the reserved bits (0-6) and for SD cards that
      claim to support low-voltage operations.
      Signed-off-by: NPhilip Langdale <philipl@overt.org>
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      55556da0
    • P
      MMC: Consolidate voltage definitions · 4be34c99
      Philip Langdale 提交于
      Consolidate the list of available voltages.
      
      Up until now, a separate set of defines has been
      used for host->vdd than that used for the OCR
      voltage mask values. Having two sets of defines
      allows them to get out of sync and the current
      sets are already inconsistent with one claiming
      to describe ranges and the other specific voltages.
      
      Only the SDHCI driver uses the host->vdd defines and
      it is easily fixed to use the OCR defines.
      Signed-off-by: NPhilip Langdale <philipl@overt.org>
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      4be34c99
    • 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: 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
    • P
      mmc: deprecate mmc bus topology · b855885e
      Pierre Ossman 提交于
      The classic MMC bus was defined as multi card bus
      system, which is reflected in the design in the MMC
      layer.
      
      When SD showed up, the bus topology was abandoned
      and a star topology (one card per host) was mandated.
      MMC version 4 has followed this, officially deprecating
      the bus topology.
      
      As we do not have any known users of the bus
      topology we can remove support for it. This will
      simplify the code and rectify some incorrect
      assumptions in the newer additions.
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      b855885e
    • P
      mmc: Flush pending detects on host removal · 3b91e550
      Pierre Ossman 提交于
      Make sure we kill of any pending detection runs when the host
      is removed instead of when it is freed. Also add some debugging
      to make sure the driver doesn't queue up more detection after it
      has removed the host.
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      3b91e550
    • P
      mmc: Move OCR bit defines · f74d132c
      Pierre Ossman 提交于
      All host drivers were #include:ing mmc/protocol.h just to
      get access to the OCR bit defines. Move these to host.h instead.
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      f74d132c
  19. 06 3月, 2007 1 次提交