07 Jan, 2009

8 commits

  • Now that clients no longer need to be notified of channel arrival
    dma_async_client_register can simply increment the dmaengine_ref_count.

    Reviewed-by: Andrew Morton
    Signed-off-by: Dan Williams

    Dan Williams
     
  • dma_request_channel provides an exclusive channel, so we no longer need to
    pass slave data through dmaengine.

    Cc: Haavard Skinnemoen
    Reviewed-by: Andrew Morton
    Signed-off-by: Dan Williams

    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
    Reviewed-by: Andrew Morton
    Signed-off-by: Dan Williams

    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: Andrew Morton
    Acked-by: Maciej Sosnowski
    Signed-off-by: Dan Williams

    Dan Williams
     
  • Use the general-purpose channel allocation provided by dmaengine.

    Reviewed-by: Andrew Morton
    Signed-off-by: Dan Williams

    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: Andrew Morton
    Signed-off-by: Dan Williams

    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: Andrew Morton
    Signed-off-by: Dan Williams

    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: Andrew Morton
    Acked-by: Maciej Sosnowski
    Signed-off-by: Dan Williams

    Dan Williams
     

06 Jan, 2009

2 commits

  • 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: Andrew Morton
    Signed-off-by: Dan Williams

    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 ',
    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
    Cc: Neil Brown
    Cc: Jeff Garzik
    Reviewed-by: Andrew Morton
    Signed-off-by: Dan Williams

    Dan Williams
     

05 Jan, 2009

24 commits

  • * 'audit.b61' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current:
    audit: validate comparison operations, store them in sane form
    clean up audit_rule_{add,del} a bit
    make sure that filterkey of task,always rules is reported
    audit rules ordering, part 2
    fixing audit rule ordering mess, part 1
    audit_update_lsm_rules() misses the audit_inode_hash[] ones
    sanitize audit_log_capset()
    sanitize audit_fd_pair()
    sanitize audit_mq_open()
    sanitize AUDIT_MQ_SENDRECV
    sanitize audit_mq_notify()
    sanitize audit_mq_getsetattr()
    sanitize audit_ipc_set_perm()
    sanitize audit_ipc_obj()
    sanitize audit_socketcall
    don't reallocate buffer in every audit_sockaddr()

    Linus Torvalds
     
  • Add standard interfaces for alarm/update irqs enabling. Drivers are no
    more required to implement equivalent ioctl code as rtc-dev will provide
    it.

    UIE emulation should now be handled correctly and will work even for those
    RTC drivers who cannot be configured to do both UIE and AIE.

    Signed-off-by: Alessandro Zummo
    Cc: David Brownell
    Cc: Atsushi Nemoto
    Cc: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alessandro Zummo
     
  • With the write_begin/write_end aops, page_symlink was broken because it
    could no longer pass a GFP_NOFS type mask into the point where the
    allocations happened. They are done in write_begin, which would always
    assume that the filesystem can be entered from reclaim. This bug could
    cause filesystem deadlocks.

    The funny thing with having a gfp_t mask there is that it doesn't really
    allow the caller to arbitrarily tinker with the context in which it can be
    called. It couldn't ever be GFP_ATOMIC, for example, because it needs to
    take the page lock. The only thing any callers care about is __GFP_FS
    anyway, so turn that into a single flag.

    Add a new flag for write_begin, AOP_FLAG_NOFS. Filesystems can now act on
    this flag in their write_begin function. Change __grab_cache_page to
    accept a nofs argument as well, to honour that flag (while we're there,
    change the name to grab_cache_page_write_begin which is more instructive
    and does away with random leading underscores).

    This is really a more flexible way to go in the end anyway -- if a
    filesystem happens to want any extra allocations aside from the pagecache
    ones in ints write_begin function, it may now use GFP_KERNEL (rather than
    GFP_NOFS) for common case allocations (eg. ocfs2_alloc_write_ctxt, for a
    random example).

    [kosaki.motohiro@jp.fujitsu.com: fix ubifs]
    [kosaki.motohiro@jp.fujitsu.com: fix fuse]
    Signed-off-by: Nick Piggin
    Reviewed-by: KOSAKI Motohiro
    Cc: [2.6.28.x]
    Signed-off-by: KOSAKI Motohiro
    Signed-off-by: Andrew Morton
    [ Cleaned up the calling convention: just pass in the AOP flags
    untouched to the grab_cache_page_write_begin() function. That
    just simplifies everybody, and may even allow future expansion of the
    logic. - Linus ]
    Signed-off-by: Linus Torvalds

    Nick Piggin
     
  • The function viafb_cursor() uses 2 stack-variables of CURSOR_SIZE bits;
    CURSOR_SIZE is defined as (8 * 1024). Using up twice 1k on stack is too
    much for 4k-stack (though it works with 8k-stacks). Make those two
    variables kzalloc'ed to preserve stack space.

    Also merge the whole lot of local struct's in viafb_ioctl into a union so
    the stack usage gets minimized here as well. (struct's are only accessed
    in their indicidual IOCTL case) This second part is only compile-tested as
    I know of no userspace app using the IOCTLs.

    Signed-off-by: Bruno Prémont
    Cc:
    Cc: Krzysztof Helt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bruno Prémont
     
  • As suggested by Andreas Dilger, introduce a bgl_lock_ptr() helper in
    and add separate sb_bgl_lock() helpers to
    filesystem specific header files to break the hidden dependency to
    struct ext[234]_sb_info.

    Also, while at it, convert the macros to static inlines to try make up
    for all the times I broke Andrew Morton's tree.

    Acked-by: Andreas Dilger
    Signed-off-by: Pekka Enberg
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pekka Enberg
     
  • Include header files as used/needed:

    In file included from drivers/leds/leds-dac124s085.c:16:
    include/linux/spi/spi.h:66: error: field 'dev' has incomplete type
    include/linux/spi/spi.h: In function 'to_spi_device':
    include/linux/spi/spi.h:100: warning: type defaults to 'int' in declaration of '__mptr'
    ...

    Signed-off-by: Randy Dunlap
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • The flush_cache_vmap in vmap_page_range() is called with the end of the
    range twice. The following patch fixes this for me.

    Signed-off-by: Adam Lackorzynski
    Cc: Nick Piggin
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adam Lackorzynski
     
  • The race is calling cgroup_clone() while umounting the ns cgroup subsys,
    and thus cgroup_clone() might access invalid cgroup_fs, or kill_sb() is
    called after cgroup_clone() created a new dir in it.

    The BUG I triggered is BUG_ON(root->number_of_cgroups != 1);

    ------------[ cut here ]------------
    kernel BUG at kernel/cgroup.c:1093!
    invalid opcode: 0000 [#1] SMP
    ...
    Process umount (pid: 5177, ti=e411e000 task=e40c4670 task.ti=e411e000)
    ...
    Call Trace:
    [] ? deactivate_super+0x3f/0x51
    [] ? mntput_no_expire+0xb3/0xdd
    [] ? sys_umount+0x265/0x2ac
    [] ? sys_oldumount+0xd/0xf
    [] ? sysenter_do_call+0x12/0x31
    ...
    EIP: [] cgroup_kill_sb+0x23/0xe0 SS:ESP 0068:e411ef2c
    ---[ end trace c766c1be3bf944ac ]---

    Cc: Serge E. Hallyn
    Signed-off-by: Li Zefan
    Cc: Paul Menage
    Cc: "Serge E. Hallyn"
    Cc: Balbir Singh
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Li Zefan
     
  • Don't store the field->op in the messy (and very inconvenient for e.g.
    audit_comparator()) form; translate to dense set of values and do full
    validation of userland-submitted value while we are at it.

    ->audit_init_rule() and ->audit_match_rule() get new values now; in-tree
    instances updated.

    Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Fix the actual rule listing; add per-type lists _not_ used for matching,
    with all exit,... sitting on one such list. Simplifies "do something
    for all rules" logics, while we are at it...

    Signed-off-by: Al Viro

    Al Viro
     
  • Problem: ordering between the rules on exit chain is currently lost;
    all watch and inode rules are listed after everything else _and_
    exit,never on one kind doesn't stop exit,always on another from
    being matched.

    Solution: assign priorities to rules, keep track of the current
    highest-priority matching rule and its result (always/never).

    Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • * no allocations
    * return void
    * don't duplicate checked for dummy context

    Signed-off-by: Al Viro

    Al Viro
     
  • * no allocations
    * return void

    Signed-off-by: Al Viro

    Al Viro
     
  • * don't bother with allocations
    * don't do double copy_from_user()
    * don't duplicate parts of check for audit_dummy_context()

    Signed-off-by: Al Viro

    Al Viro
     
  • * logging the original value of *msg_prio in mq_timedreceive(2)
    is insane - the argument is write-only (i.e. syscall always
    ignores the original value and only overwrites it).
    * merge __audit_mq_timed{send,receive}
    * don't do copy_from_user() twice
    * don't mess with allocations in auditsc part
    * ... and don't bother checking !audit_enabled and !context in there -
    we'd already checked for audit_dummy_context().

    Signed-off-by: Al Viro

    Al Viro
     
  • * don't copy_from_user() twice
    * don't bother with allocations
    * don't duplicate parts of audit_dummy_context()
    * make it return void

    Signed-off-by: Al Viro

    Al Viro
     
  • * get rid of allocations
    * make it return void
    * don't duplicate parts of audit_dummy_context()

    Signed-off-by: Al Viro

    Al Viro
     
  • * get rid of allocations
    * make it return void
    * simplify callers

    Signed-off-by: Al Viro

    Al Viro
     
  • * get rid of allocations
    * make it return void
    * simplify callers

    Signed-off-by: Al Viro

    Al Viro
     
  • * don't bother with allocations
    * now that it can't fail, make it return void

    Signed-off-by: Al Viro

    Al Viro
     
  • No need to do that more than once per process lifetime; allocating/freeing
    on each sendto/accept/etc. is bloody pointless.

    Signed-off-by: Al Viro

    Al Viro
     

04 Jan, 2009

6 commits

  • …/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/
    ...

    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
    ...

    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
    ...

    Linus Torvalds
     
  • those two functions only used in that C file

    Signed-off-by: Yinghai Lu
    Signed-off-by: Linus Torvalds

    Yinghai Lu
     
  • * '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

    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

    Linus Torvalds