1. 07 1月, 2009 6 次提交
    • D
      dmatest: convert to dma_request_channel · 33df8ca0
      Dan Williams 提交于
      Replace the client registration infrastructure with a custom loop to
      poll for channels.  Once dma_request_channel returns NULL stop asking
      for channels.  A userspace side effect of this change if that loading
      the dmatest module before loading a dma driver will result in no
      channels being found, previously dmatest would get a callback.  To
      facilitate testing in the built-in case dmatest_init is marked as a
      late_initcall.  Another side effect is that channels under test can not
      be used for any other purpose.
      
      Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
      Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      
      33df8ca0
    • D
      dmaengine: introduce dma_request_channel and private channels · 59b5ec21
      Dan Williams 提交于
      This interface is primarily for device-to-memory clients which need to
      search for dma channels with platform-specific characteristics.  The
      prototype is:
      
      struct dma_chan *dma_request_channel(dma_cap_mask_t mask,
                                           dma_filter_fn filter_fn,
                                           void *filter_param);
      
      When the optional 'filter_fn' parameter is set to NULL
      dma_request_channel simply returns the first channel that satisfies the
      capability mask.  Otherwise, when the mask parameter is insufficient for
      specifying the necessary channel, the filter_fn routine can be used to
      disposition the available channels in the system. The filter_fn routine
      is called once for each free channel in the system.  Upon seeing a
      suitable channel filter_fn returns DMA_ACK which flags that channel to
      be the return value from dma_request_channel.  A channel allocated via
      this interface is exclusive to the caller, until dma_release_channel()
      is called.
      
      To ensure that all channels are not consumed by the general-purpose
      allocator the DMA_PRIVATE capability is provided to exclude a dma_device
      from general-purpose (memory-to-memory) consideration.
      Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
      Acked-by: NMaciej Sosnowski <maciej.sosnowski@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      
      
      
      59b5ec21
    • D
      net_dma: convert to dma_find_channel · f67b4599
      Dan Williams 提交于
      Use the general-purpose channel allocation provided by dmaengine.
      Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      
      f67b4599
    • D
      dmaengine: provide a common 'issue_pending_all' implementation · 2ba05622
      Dan Williams 提交于
      async_tx and net_dma each have open-coded versions of issue_pending_all,
      so provide a common routine in dmaengine.
      
      The implementation needs to walk the global device list, so implement
      rcu to allow dma_issue_pending_all to run lockless.  Clients protect
      themselves from channel removal events by holding a dmaengine reference.
      Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      
      
      2ba05622
    • D
      dmaengine: centralize channel allocation, introduce dma_find_channel · bec08513
      Dan Williams 提交于
      Allowing multiple clients to each define their own channel allocation
      scheme quickly leads to a pathological situation.  For memory-to-memory
      offload all clients can share a central allocator.
      
      This simply moves the existing async_tx allocator to dmaengine with
      minimal fixups:
      * async_tx.c:get_chan_ref_by_cap --> dmaengine.c:nth_chan
      * async_tx.c:async_tx_rebalance --> dmaengine.c:dma_channel_rebalance
      * split out common code from async_tx.c:__async_tx_find_channel -->
        dma_find_channel
      Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      
      
      bec08513
    • D
      dmaengine: up-level reference counting to the module level · 6f49a57a
      Dan Williams 提交于
      Simply, if a client wants any dmaengine channel then prevent all dmaengine
      modules from being removed.  Once the clients are done re-enable module
      removal.
      
      Why?, beyond reducing complication:
      1/ Tracking reference counts per-transaction in an efficient manner, as
         is currently done, requires a complicated scheme to avoid cache-line
         bouncing effects.
      2/ Per-transaction ref-counting gives the false impression that a
         dma-driver can be gracefully removed ahead of its user (net, md, or
         dma-slave)
      3/ None of the in-tree dma-drivers talk to hot pluggable hardware, but
         if such an engine were built one day we still would not need to notify
         clients of remove events.  The driver can simply return NULL to a
         ->prep() request, something that is much easier for a client to handle.
      Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
      Acked-by: NMaciej Sosnowski <maciej.sosnowski@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      
      
      6f49a57a
  2. 06 1月, 2009 2 次提交
    • D
      dmaengine: remove dependency on async_tx · 07f2211e
      Dan Williams 提交于
      async_tx.ko is a consumer of dma channels.  A circular dependency arises
      if modules in drivers/dma rely on common code in async_tx.ko.  It
      prevents either module from being unloaded.
      
      Move dma_wait_for_async_tx and async_tx_run_dependencies to dmaeninge.o
      where they should have been from the beginning.
      Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      
      07f2211e
    • D
      async_tx, dmaengine: document channel allocation and api rework · 28405d8d
      Dan Williams 提交于
      "Wouldn't it be better if the dmaengine layer made sure it didn't pass
      the same channel several times to a client?
      
      I mean, you seem concerned that the memcpy() API should be transparent
      and easy to use, but the whole registration interface is just
      ridiculously complicated..."
      	- Haavard
      
      The dmaengine and async_tx registration/allocation interface is indeed
      needlessly complicated.  This redesign has the following goals:
      
      1/ Simplify reference counting: dma channels are not something one would
         expect to be hotplugged, it should be an exceptional event handled by
         drivers not something clients should be mandated to handle in a
         callback.  The common case channel removal event is 'rmmod <dma driver>',
         which for simplicity should be disallowed if the channel is in use.
      2/ Add an interface for requesting exclusive access to a channel
         suitable to device-to-memory users.
      3/ Convert all memory-to-memory users over to a common allocator, the goal
         here is to not have competing channel allocation schemes.  The only
         competition should be between device-to-memory exclusive allocations and
         the memory-to-memory usage case where channels are shared between
         multiple "clients".
      
      Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Jeff Garzik <jeff@garzik.org>
      Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      
      28405d8d
  3. 05 1月, 2009 24 次提交
  4. 04 1月, 2009 8 次提交
    • L
      Merge branch 'cpus4096-for-linus-3' of... · 7d3b56ba
      Linus Torvalds 提交于
      Merge branch 'cpus4096-for-linus-3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
      
      * 'cpus4096-for-linus-3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (77 commits)
        x86: setup_per_cpu_areas() cleanup
        cpumask: fix compile error when CONFIG_NR_CPUS is not defined
        cpumask: use alloc_cpumask_var_node where appropriate
        cpumask: convert shared_cpu_map in acpi_processor* structs to cpumask_var_t
        x86: use cpumask_var_t in acpi/boot.c
        x86: cleanup some remaining usages of NR_CPUS where s/b nr_cpu_ids
        sched: put back some stack hog changes that were undone in kernel/sched.c
        x86: enable cpus display of kernel_max and offlined cpus
        ia64: cpumask fix for is_affinity_mask_valid()
        cpumask: convert RCU implementations, fix
        xtensa: define __fls
        mn10300: define __fls
        m32r: define __fls
        h8300: define __fls
        frv: define __fls
        cris: define __fls
        cpumask: CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
        cpumask: zero extra bits in alloc_cpumask_var_node
        cpumask: replace for_each_cpu_mask_nr with for_each_cpu in kernel/time/
        cpumask: convert mm/
        ...
      7d3b56ba
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu · 269b0123
      Linus Torvalds 提交于
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu: (89 commits)
        AMD IOMMU: remove now unnecessary #ifdefs
        AMD IOMMU: prealloc_protection_domains should be static
        kvm/iommu: fix compile warning
        AMD IOMMU: add statistics about total number of map requests
        AMD IOMMU: add statistics about allocated io memory
        AMD IOMMU: add stats counter for domain tlb flushes
        AMD IOMMU: add stats counter for single iommu domain tlb flushes
        AMD IOMMU: add stats counter for cross-page request
        AMD IOMMU: add stats counter for free_coherent requests
        AMD IOMMU: add stats counter for alloc_coherent requests
        AMD IOMMU: add stats counter for unmap_sg requests
        AMD IOMMU: add stats counter for map_sg requests
        AMD IOMMU: add stats counter for unmap_single requests
        AMD IOMMU: add stats counter for map_single requests
        AMD IOMMU: add stats counter for completion wait events
        AMD IOMMU: add init code for statistic collection
        AMD IOMMU: add necessary header defines for stats counting
        AMD IOMMU: add Kconfig entry for statistic collection code
        AMD IOMMU: use dev_name in iommu_enable function
        AMD IOMMU: use calc_devid in prealloc_protection_domains
        ...
      269b0123
    • L
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 · f60a0a79
      Linus Torvalds 提交于
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (34 commits)
        V4L/DVB (10173): Missing v4l2_prio_close in radio_release
        V4L/DVB (10172): add DVB_DEVICE_TYPE= to uevent
        V4L/DVB (10171): Use usb_set_intfdata
        V4L/DVB (10170): tuner-simple: prevent possible OOPS caused by divide by zero error
        V4L/DVB (10168): sms1xxx: fix inverted gpio for lna control on tiger r2
        V4L/DVB (10167): sms1xxx: add support for inverted gpio
        V4L/DVB (10166): dvb frontend: stop using non-C99 compliant comments
        V4L/DVB (10165): Add FE_CAN_2G_MODULATION flag to frontends that support DVB-S2
        V4L/DVB (10164): Add missing S2 caps flag to S2API
        V4L/DVB (10163): em28xx: allocate adev together with struct em28xx dev
        V4L/DVB (10162): tuner-simple: Fix tuner type set message
        V4L/DVB (10161): saa7134: fix autodetection for AVer TV GO 007 FM Plus
        V4L/DVB (10160): em28xx: update chip id for em2710
        V4L/DVB (10157): Add USB ID for the Sil4701 radio from DealExtreme
        V4L/DVB (10156): saa7134: Add support for Avermedia AVer TV GO 007 FM Plus
        V4L/DVB (10155): Add TEA5764 radio driver
        V4L/DVB (10154): saa7134: fix a merge conflict on Behold H6 board
        V4L/DVB (10153): Add the Beholder H6 card to DVB-T part of sources.
        V4L/DVB (10152): Change configuration of the Beholder H6 card
        V4L/DVB (10151): Fix I2C bridge error in zl10353
        ...
      f60a0a79
    • Y
      sparseirq: move set/get_timer_rand_state back to .c · 2f983570
      Yinghai Lu 提交于
      those two functions only used in that C file
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2f983570
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc · e9e67a8b
      Linus Torvalds 提交于
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc:
        mmc: warn about voltage mismatches
        mmc_spi: Add support for OpenFirmware bindings
        pxamci: fix dma_unmap_sg length
        mmc_block: ensure all sectors that do not have errors are read
        drivers/mmc: Move a dereference below a NULL test
        sdhci: handle built-in sdhci with modular leds class
        mmc: balanc pci_iomap with pci_iounmap
        mmc_block: print better error messages
        mmc: Add mmc_vddrange_to_ocrmask() helper function
        ricoh_mmc: Handle newer models of Ricoh controllers
        mmc: Add 8-bit bus width support
        sdhci: activate led support also when module
        mmc: trivial annotation of 'blocks'
        pci: use pci_ioremap_bar() in drivers/mmc
        sdricoh_cs: Add support for Bay Controller devices
        mmc: at91_mci: reorder timer setup and mmc_add_host() call
      e9e67a8b
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog · ad6b646f
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
        [WATCHDOG] Add support for the WM8350 watchdog
        [WATCHDOG] Add SMSC SCH311x Watchdog Timer.
        [WATCHDOG] ib700wdt - add timeout parameter
      ad6b646f
    • L
      Merge branch 'cputime' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 · 61420f59
      Linus Torvalds 提交于
      * 'cputime' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
        [PATCH] fast vdso implementation for CLOCK_THREAD_CPUTIME_ID
        [PATCH] improve idle cputime accounting
        [PATCH] improve precision of idle time detection.
        [PATCH] improve precision of process accounting.
        [PATCH] idle cputime accounting
        [PATCH] fix scaled & unscaled cputime accounting
      61420f59
    • L
      Make %p print '(null)' for NULL pointers · d97106ab
      Linus Torvalds 提交于
      Before, when we only ever printed out the pointer value itself, a NULL
      pointer would never cause issues and might as well be printed out as
      just its numeric value.
      
      However, with the extended %p formats, especially %pR, we might validly
      want to print out resources for debugging.  And sometimes they don't
      even exist, and the resource pointer is just NULL.  Print it out as
      such, rather than oopsing.
      
      This is a more generic version of a patch done by Trent Piepho (catching
      all %p cases rather than just %pR, and using "(null)" instead of
      "[NULL]" to match glibc).
      Requested-by: NTrent Piepho <xyzzy@speakeasy.org>
      Acked-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d97106ab