1. 12 5月, 2010 1 次提交
  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. 16 12月, 2009 2 次提交
  4. 23 9月, 2009 1 次提交
  5. 09 9月, 2009 1 次提交
  6. 09 4月, 2009 1 次提交
  7. 25 3月, 2009 3 次提交
  8. 19 2月, 2009 1 次提交
  9. 07 1月, 2009 4 次提交
  10. 05 1月, 2009 1 次提交
  11. 07 10月, 2008 1 次提交
  12. 06 10月, 2008 8 次提交
    • H
    • H
      atmel-mci: Don't overwrite error bits when NOTBUSY is set · ca55f46e
      Haavard Skinnemoen 提交于
      After a data error, we wait for the NOTBUSY bit to be set so that we can
      be sure the data transfer is completely finished. However, when NOTBUSY
      is set, the interrupt handler copies the contents of SR into
      data_status, overwriting any error bits we may have detected earlier.
      
      To avoid this, initialize data_status to 0 before starting a request, and
      don't overwrite it unless it still contains 0.
      Signed-off-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      ca55f46e
    • H
      atmel-mci: Add experimental DMA support · 65e8b083
      Haavard Skinnemoen 提交于
      This adds support for DMA transfers through the generic DMA engine
      framework with the DMA slave extensions.
      
      The driver has been tested using mmc-block and ext3fs on several SD,
      SDHC and MMC+ cards. Reads and writes work fine, with read transfer
      rates up to 7.5 MiB/s on fast cards with debugging disabled.
      
      Unfortunately, the driver has been known to lock up from time to time
      with DMA enabled, so DMA support is currently optional and marked
      EXPERIMENTAL. However, I didn't see any problems while testing 13
      different cards (MMC, SD and SDHC of different brands and sizes), so I
      suspect the "Initialize BLKR before sending data transfer command" fix
      that was posted earlier fixed this as well.
      Signed-off-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      65e8b083
    • H
      atmel-mci: support multiple mmc slots · 965ebf33
      Haavard Skinnemoen 提交于
      The Atmel MCI controller can drive multiple cards through separate sets
      of pins, but only one at a time. This patch adds support for
      multiplexing access to the controller so that multiple card slots can be
      used as if they were hooked up to separate mmc controllers.
      
      The atmel-mci driver registers each slot as a separate mmc_host. Both
      access the same common controller state, but they also have some state
      on their own for card detection/write protect handling, and separate
      shadows of the MR and SDCR registers.
      
      When one of the slots receives a request from the mmc core, the common
      controller state is checked. If it's idle, the request is submitted
      immediately. If not, the request is added to a queue. When a request is
      done, the queue is checked and if there is a queued request, it is
      submitted before the completion callback is called.
      
      This patch also includes a few cleanups and fixes, including a locking
      overhaul. I had to change the locking extensively in any case, so I
      might as well try to get it right. The driver no longer takes any
      irq-safe locks, which may or may not improve the overall system
      performance.
      
      This patch also adds a bit of documentation of the internal data
      structures.
      Signed-off-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      965ebf33
    • H
      atmel-mci: Platform code for supporting multiple mmc slots · 6b918657
      Haavard Skinnemoen 提交于
      Add the necessary platform infrastructure to support multiple mmc/sdcard
      slots all at once through a single controller. Currently, the driver
      will use the first valid slot it finds and stick with that, but later
      patches will add support for switching between several slots on the fly.
      
      Extend the platform data structure with per-slot information: MMC/SDcard
      bus width and card detect/write protect pins. This will affect the pin
      muxing as well as the capabilities announced to the mmc core.
      
      Note that board code is now required to supply a mci_platform_data
      struct to at32_add_device_mci().
      Signed-off-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      6b918657
    • H
      atmel-mci: Don't stop the clock between transfers · 945533b5
      Haavard Skinnemoen 提交于
      Some cards might get upset if we turn off the clock for extended periods
      of time. So keep the clock running until the mmc core tells us to turn
      it off.
      
      Also, don't reset the controller between each transfer. That was an
      attempt to work around earlier bugs, and it never really worked very
      well.
      Signed-off-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      945533b5
    • H
      atmel-mci: Implement tasklet as a state machine · c06ad258
      Haavard Skinnemoen 提交于
      With the current system of completed/pending events, things may get
      handled in different order depending on which event triggers first. For
      example, if the data transfer is complete before the command, the stop
      command must be sent after the command is complete, not the data. This
      creates a bit of complexity around the stop command.
      
      By having the tasklet go through a sequence of clearly defined states,
      things always happen in a certain order even if the events come at
      different times, so the stop command can simply be sent when we exit the
      "sending data" state because we will never enter that state before the
      command has been sent successfully.
      Signed-off-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      c06ad258
    • H
      atmel-mci: Initialize BLKR before sending data transfer command · a252e3e3
      Haavard Skinnemoen 提交于
      The atmel-mci driver sometimes fails data transfers like this:
      
         mmcblk0: error -5 transferring data
         end_request: I/O error, dev mmcblk0, sector 2749769
         end_request: I/O error, dev mmcblk0, sector 2749777
      
      It turns out that this might be caused by the BLKR register (which
      contains the block size and the number of blocks being transfered) being
      initialized too late. This patch moves the initialization of BLKR so
      that it contains the correct value before the block transfer command is
      sent.
      
      This error is difficult to reproduce, but if you insert a long delay
      (mdelay(10) or thereabouts) between the calls to atmci_start_command()
      and atmci_submit_data(), all transfers seem to fail without this patch,
      while I haven't seen any failures with this patch.
      Reported-by: NHein_Tibosch <hein_tibosch@yahoo.es>
      Signed-off-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      a252e3e3
  13. 20 9月, 2008 4 次提交
  14. 05 8月, 2008 1 次提交
  15. 27 7月, 2008 2 次提交
  16. 18 7月, 2008 1 次提交
    • B
      avr32: clean up mci platform code · fbfca4b8
      Ben Nizette 提交于
      This patch does a few small cleanups around the atmel mci platform code
      and in the atmel-mci driver.  The platform changes simply removes an
      unused variable, uses the fact that by the end we always have some form
      of platform data and notes that GPIO_PIN_NONE != 0.  This last point
      could cause the incorrect attempt to twice reserve pin PA0.
      
      While we've got the hood up, add linux/err.h to the atmel-mci.c include
      list.  It needs it and generally pulls it by voodoo but I did once
      stumble across a config which don't build.
      
      This is against Linus' latest git.
      Signed-off-by: NBen Nizette <bn@niasdigital.com>
      Signed-off-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      fbfca4b8
  17. 15 7月, 2008 2 次提交
    • 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
    • H
      atmel-mci: Driver for Atmel on-chip MMC controllers · 7d2be074
      Haavard Skinnemoen 提交于
      This is a driver for the MMC controller on the AP7000 chips from
      Atmel. It should in theory work on AT91 systems too with some
      tweaking, but since the DMA interface is quite different, it's not
      entirely clear if it's worth merging this with the at91_mci driver.
      
      This driver has been around for a while in BSPs and kernel sources
      provided by Atmel, but this particular version uses the generic DMA
      Engine framework (with the slave extensions) instead of an
      avr32-only DMA controller framework.
      
      This driver can also use PIO transfers when no DMA channels are
      available, and for transfers where using DMA may be difficult or
      impractical for some reason (e.g. the DMA setup overhead is usually
      not worth it for very short transfers, and badly aligned buffers or
      lengths are difficult to handle.)
      
      Currently, the driver only support PIO transfers. DMA support has been
      split out to a separate patch to hopefully make it easier to review.
      
      The driver has been tested using mmc-block and ext3fs on several SD,
      SDHC and MMC+ cards. Reads and writes work fine, with read transfer
      rates up to 3.5 MiB/s on fast cards with debugging disabled.
      
      The driver has also been tested using the mmc_test module on the same
      cards. All tests except 7, 9, 15 and 17 succeed. The first two are
      unsupported by all the cards I have, so I don't know if the driver
      handles this correctly. The last two fail because the hardware flags a
      Data CRC Error instead of a Data Timeout error. I'm not sure how to deal
      with that.
      
      Documentation for this controller can be found in many data sheets from
      Atmel, including the AT32AP7000 data sheet which can be found here:
      
      http://www.atmel.com/dyn/products/datasheets.asp?family_id=682Signed-off-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      7d2be074