1. 11 8月, 2010 2 次提交
  2. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  3. 25 3月, 2010 1 次提交
    • A
      mmc: fix incorrect interpretation of card type bits · 7198f3c9
      Adrian Hunter 提交于
      In the extended CSD register the CARD_TYPE is an 8-bit value of which the
      upper 6 bits were reserved in JEDEC specifications prior to version 4.4.
      In version 4.4 two of the reserved bits were designated for identifying
      support for the newly added High-Speed Dual Data Rate.  Unfortunately the
      mmc_read_ext_csd() function required that the reserved bits be zero
      instead of ignoring them as it should.
      
      This patch makes mmc_read_ext_csd() ignore the CARD_TYPE bits that are
      reserved or not yet supported.  It also stops the function jumping to the
      end as though an error occurred, when it is only warns that the CARD_TYPE
      bits (that it does interpret) are invalid.
      Signed-off-by: NAdrian Hunter <adrian.hunter@nokia.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>
      7198f3c9
  4. 12 1月, 2010 1 次提交
  5. 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
  6. 23 9月, 2009 6 次提交
  7. 16 9月, 2009 1 次提交
  8. 09 4月, 2009 1 次提交
  9. 01 1月, 2009 1 次提交
  10. 15 7月, 2008 1 次提交
  11. 23 3月, 2008 1 次提交
  12. 18 10月, 2007 1 次提交
  13. 24 9月, 2007 2 次提交
    • 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
    • P
      mmc: replace BUG_ON with WARN_ON · d84075c8
      Pierre Ossman 提交于
      Replace all cases of BUG_ON with WARN_ON where there is a chance
      (with varying degrees of slim) that the kernel can continue without
      incidence.
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      d84075c8
  14. 23 9月, 2007 4 次提交
  15. 26 7月, 2007 4 次提交
  16. 10 7月, 2007 2 次提交
  17. 01 5月, 2007 5 次提交
    • P
      mmc: remove old card states · bd766312
      Pierre Ossman 提交于
      Remove card states that no longer make any sense.
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      bd766312
    • 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: separate out reading EXT_CSD · 89a73cf5
      Pierre Ossman 提交于
      Separate the reading and decoding of the EXT_CSD register with the
      actions taken on it.
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      89a73cf5
    • 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: 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