11 May, 2012

8 commits

  • sg->length may or may not contain the length of the dma region to transfer,
    depending on the architecture - dma_sg_len(sg) always will though. For the
    architectures which use the drivers modified by this patch it probably is the
    case that sg->length contains the dma transfer length. But to be consistent and
    future proof change them to use dma_sg_len.

    To quote Russel King:
    sg->length is meaningless to something performing DMA.

    In cases where sg_dma_len(sg) and sg->length are the same storage, then
    there's no problem. But scatterlists _can_ (and one some architectures) do
    split them - especially when you have an IOMMU which can allow you to
    combine a scatterlist into fewer entries.

    So, anything using sg->length for the size of a scatterlist's DMA transfer
    _after_ a call to dma_map_sg() is almost certainly buggy.

    The patch has been generated using the following coccinelle patch:

    @@
    struct scatterlist *sg;
    expression X;
    @@
    -sg[X].length
    +sg_dma_len(&sg[X])
    @@
    struct scatterlist *sg;
    @@
    -sg->length
    +sg_dma_len(sg)

    Signed-off-by: Lars-Peter Clausen
    Acked-by: Linus Walleij
    Signed-off-by: Vinod Koul

    Lars-Peter Clausen
     
  • dmaengine drivers should always use sg_dma_address instead of sg_phys to get the
    addresses for the transfer from a sg element.

    To quote Russel King:
    sg_phys(sg) of course has nothing to do with DMA addresses. It's the
    physical address _to the CPU_ of the memory associated with the scatterlist
    entry. That may, or may not have the same value for the DMA engine,
    particularly if IOMMUs are involved.

    And if these drivers are used on ARM, they must be fixed, sooner rather
    than later. There's patches in the works which will mean we will end up
    with IOMMU support in the DMA mapping later, which means everything I've
    said above will become reality.

    The patch has been generated using the following coccinelle patch:

    @@
    struct scatterlist *sg;
    @@
    -sg_phys(sg)
    +sg_dma_address(sg)

    Signed-off-by: Lars-Peter Clausen
    Acked-by: Linus Walleij
    Signed-off-by: Vinod Koul

    Lars-Peter Clausen
     
  • Removes file which was included twice.

    Signed-off-by: Sachin Kamat
    Acked-by: Jassi Brar
    Signed-off-by: Vinod Koul

    Sachin Kamat
     
  • Vinod Koul
     
  • the cookie updates completed the cyclic dma descriptor wrongly. This caused the
    BUG_ON to be hit as submit is called for completed descriptor

    Fix this by not marking the cyclic descriptor as complete

    Signed-off-by: Vinod Koul
    Tested-by: Thomas Abraham

    Vinod Koul
     
  • The current code keeps the callbacks invoked from interrupt context, this
    does not conform to the Documentation/dmaengine.txt.

    So add tasklet support to fix this issue.

    Signed-off-by: Huang Shijie
    Signed-off-by: Vinod Koul

    Huang Shijie
     
  • SPEAr platforms now support DT and so must convert all drivers to support DT.
    This patch adds DT probing support for Synopsys DMA controller and updates its
    documentation too.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Vinod Koul

    Viresh Kumar
     
  • clk_{un}prepare is mandatory for platforms using common clock framework. Since
    this driver is used by SPEAr platform, which supports common clock framework,
    add clk_{un}prepare() support for it.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Vinod Koul

    Viresh Kumar
     

25 Apr, 2012

4 commits

  • Vinod Koul
     
  • The Nomadik PL080 variant has some extra protection bits that
    may be set, so we need to check these bits to see if the
    channels are actually available for the DMAengine to use.

    Cc: Russell King
    Cc: Alim Akhtar
    Cc: Alessandro Rubini
    Reviewed-by: Viresh Kumar
    Signed-off-by: Linus Walleij
    Signed-off-by: Vinod Koul

    Linus Walleij
     
  • When a client calls pl08x_control with DMA_TERMINATE_ALL, it is correct
    to terminate and release the phy channel currently in use (if one is in use),
    but the phychan_hold counter must also be reset (otherwise it could get
    trapped in an unbalanced state).

    Signed-off-by: Davide Ciminaghi
    Reviewed-by: Viresh Kumar
    Acked-by: Linus Walleij
    Signed-off-by: Vinod Koul

    Davide Ciminaghi
     
  • Move a couple of tests and do a minor refactor to avoid:

    drivers/dma/pl330.c: In function 'pl330_probe':
    drivers/dma/pl330.c:2929:215: warning: comparison of distinct pointer types lacks a cast [enabled by default]
    drivers/dma/pl330.c: In function 'pl330_tasklet':
    drivers/dma/pl330.c:2250:8: warning: 'pch' may be used uninitialized in this function [-Wuninitialized]
    drivers/dma/pl330.c:2228:25: note: 'pch' was declared here
    drivers/dma/pl330.c:2277:130: warning: 'pch' may be used uninitialized in this function [-Wuninitialized]
    drivers/dma/pl330.c:2260:25: note: 'pch' was declared here

    Signed-off-by: Olof Johansson
    Signed-off-by: Vinod Koul

    Olof Johansson
     

23 Apr, 2012

4 commits

  • For some reason I can't figure out we're reading the PL080_INT_STATUS
    register instead of PL080_TC_STATUS when checking for the terminal
    count. The PL080_INT_STATUS is a logical OR between the error and
    terminal count status register and may not report what we want it
    to, especially if there is an error and a terminal count at the same
    time and the former is not lowered in time for the check in the TC
    register. Make sure we read what we're actually interested in.

    Cc: Russell King
    Cc: Viresh Kumar
    Cc: Alim Akhtar
    Signed-off-by: Linus Walleij
    Acked-by: Viresh Kumar
    Signed-off-by: Vinod Koul

    Linus Walleij
     
  • A small fallout from Vinod's conversions to dma_transfer_direction,
    this small comparison was done with a dma_data_direction instead.
    Fix it by comparing against the correct enum.

    Signed-off-by: Linus Walleij
    Signed-off-by: Vinod Koul

    Linus Walleij
     
  • The patch "ARM: amba: Remove AMBA level regulator support" breaks
    the DMA40 driver since the header implicitly
    included the regulator consumer header. So include it explicitly
    and fix the build error.

    Cc: Mark Brown
    Signed-off-by: Linus Walleij
    Signed-off-by: Vinod Koul

    Linus Walleij
     
  • can be directly stopped by issuing a SUSPEND_REQ on the EE
    bits. There is no need to suspend the physical channel and
    restart it.

    Also, the support for pre-V2 hw is discontinued.

    EE bits for writing:

    00: disable only if AS=11 or AS=00
    01: enable
    10: suspend_req only if AS=01 & EE=01 or EE=11
    11: round / no change for writing

    Signed-off-by: Narayanan G
    Acked-by: Linus Walleij
    Signed-off-by: Vinod Koul

    Narayanan G
     

20 Apr, 2012

3 commits

  • This loop on EBCISR register was designed to clear IRQ sources before enabling
    a DMA channel. This register is clear-on-read so a race condition can appear if
    another channel is already active and has just finished its transfer.
    Removing this read on EBCISR is fixing the issue as there is no case where an IRQ
    could be pending: we already make sure that this register is drained at probe()
    time and during resume.

    Signed-off-by: Nicolas Ferre
    Cc: stable
    Signed-off-by: Vinod Koul

    Nicolas Ferre
     
  • Enable channel in device_issue_pending call, so that the order between
    cookie assignment and channel enabling can be ensured naturally.

    It fixes the mxs gpmi-nand breakage which is caused by the incorrect
    order of cookie assigning and channel enabling.

    Suggested-by: Russell King
    Signed-off-by: Shawn Guo
    Tested-by: Huang Shijie
    Tested-by
    Signed-off-by: Vinod Koul

    Shawn Guo
     
  • the cookie updates completed the cyclic dma descriptor wrongly. This caused the
    BUG_ON to be hit as submit is called for completed descriptor

    Fix this by not marking the cyclic descriptor as complete

    Tested-by: Javier Martin
    Signed-off-by: Vinod Koul

    Vinod Koul
     

01 Apr, 2012

21 commits

  • Linus Torvalds
     
  • Pull virtio S3 support patches from Amit Shah:
    "Turns out S3 is not different from S4 for virtio devices: the device
    is assumed to be reset, so the host and guest state are to be assumed
    to be out of sync upon resume. We handle the S4 case with exactly the
    same scenario, so just point the suspend/resume routines to the
    freeze/restore ones.

    Once that is done, we also use the PM API's macro to initialise the
    sleep functions.

    A couple of cleanups are included: there's no need for special thaw
    processing in the balloon driver, so that's addressed in patches 1 and
    2.

    Testing: both S3 and S4 support have been tested using these patches
    using a similar method used earlier during S4 patch development: a
    guest is started with virtio-blk as the only disk, a virtio network
    card, a virtio-serial port and a virtio balloon device. Ping from
    guest to host, dd /dev/zero to a file on the disk, and IO from the
    host on the virtio-serial port, all at once, while exercising S4 and
    S3 (separately) were tested. They all continue to work fine after
    resume. virtio balloon values too were tested by inflating and
    deflating the balloon."

    Pulling from Amit, since Rusty is off getting married (and presumably
    shaving people).

    * 's3-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/amit/virtio-console:
    virtio-pci: switch to PM ops macro to initialise PM functions
    virtio-pci: S3 support
    virtio-pci: drop restore_common()
    virtio: drop thaw PM operation
    virtio: balloon: Allow stats update after restore from S4

    Linus Torvalds
     
  • Pull second try at vfs part d#2 from Al Viro:
    "Miklos' first series (with do_lookup() rewrite split into edible
    chunks) + assorted bits and pieces.

    The 'untangling of do_lookup()' series is is a splitup of what used to
    be a monolithic patch from Miklos, so this series is basically "how do
    I convince myself that his patch is correct (or find a hole in it)".
    No holes found and I like the resulting cleanup, so in it went..."

    Changes from try 1: Fix a boot problem with selinux, and commit messages
    prettied up a bit.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (24 commits)
    vfs: fix out-of-date dentry_unhash() comment
    vfs: split __lookup_hash
    untangling do_lookup() - take __lookup_hash()-calling case out of line.
    untangling do_lookup() - switch to calling __lookup_hash()
    untangling do_lookup() - merge d_alloc_and_lookup() callers
    untangling do_lookup() - merge failure exits in !dentry case
    untangling do_lookup() - massage !dentry case towards __lookup_hash()
    untangling do_lookup() - get rid of need_reval in !dentry case
    untangling do_lookup() - eliminate a loop.
    untangling do_lookup() - expand the area under ->i_mutex
    untangling do_lookup() - isolate !dentry stuff from the rest of it.
    vfs: move MAY_EXEC check from __lookup_hash()
    vfs: don't revalidate just looked up dentry
    vfs: fix d_need_lookup/d_revalidate order in do_lookup
    ext3: move headers to fs/ext3/
    migrate ext2_fs.h guts to fs/ext2/ext2.h
    new helper: ext2_image_size()
    get rid of pointless includes of ext2_fs.h
    ext2: No longer export ext2_fs.h to user space
    mtdchar: kill persistently held vfsmount
    ...

    Linus Torvalds
     
  • Pull scheduler fixes from Ingo Molnar.

    * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    sched: Fix incorrect usage of for_each_cpu_mask() in select_fallback_rq()
    sched: Fix __schedule_bug() output when called from an interrupt
    sched/arch: Introduce the finish_arch_post_lock_switch() scheduler callback

    Linus Torvalds
     
  • Pull perf updates and fixes from Ingo Molnar:
    "It's mostly fixes, but there's also two late items:

    - preliminary GTK GUI support for perf report
    - PMU raw event format descriptors in sysfs, to be parsed by tooling

    The raw event format in sysfs is a new ABI. For example for the 'CPU'
    PMU we have:

    aldebaran:~> ll /sys/bus/event_source/devices/cpu/format/*
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/any
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/cmask
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/edge
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/event
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/inv
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/offcore_rsp
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/pc
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/umask

    those lists of fields contain a specific format:

    aldebaran:~> cat /sys/bus/event_source/devices/cpu/format/offcore_rsp
    config1:0-63

    So, those who wish to specify raw events can now use the following
    event format:

    -e cpu/cmask=1,event=2,umask=3

    Most people will not want to specify any events (let alone raw
    events), they'll just use whatever default event the tools use.

    But for more obscure PMU events that have no cross-architecture
    generic events the above syntax is more usable and a bit more
    structured than specifying hex numbers."

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (41 commits)
    perf tools: Remove auto-generated bison/flex files
    perf annotate: Fix off by one symbol hist size allocation and hit accounting
    perf tools: Add missing ref-cycles event back to event parser
    perf annotate: addr2line wants addresses in same format as objdump
    perf probe: Finder fails to resolve function name to address
    tracing: Fix ent_size in trace output
    perf symbols: Handle NULL dso in dso__name_len
    perf symbols: Do not include libgen.h
    perf tools: Fix bug in raw sample parsing
    perf tools: Fix display of first level of callchains
    perf tools: Switch module.h into export.h
    perf: Move mmap page data_head offset assertion out of header
    perf: Fix mmap_page capabilities and docs
    perf diff: Fix to work with new hists design
    perf tools: Fix modifier to be applied on correct events
    perf tools: Fix various casting issues for 32 bits
    perf tools: Simplify event_read_id exit path
    tracing: Fix ftrace stack trace entries
    tracing: Move the tracing_on/off() declarations into CONFIG_TRACING
    perf report: Add a simple GTK2-based 'perf report' browser
    ...

    Linus Torvalds
     
  • Pull PARISC misc updates from James Bottomley:
    "This is a couple of minor updates (fixing lws futex locking and
    removing some obsolete cpu_*_map calls)."

    * tag 'parisc-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6:
    [PARISC] remove references to cpu_*_map.
    [PARISC] futex: Use same lock set as lws calls

    Linus Torvalds
     
  • Pull SCSI updates from James Bottomley:
    "This is primarily another round of driver updates (lpfc, bfa, fcoe,
    ipr) plus a new ufshcd driver. There shouldn't be anything
    controversial in here (The final deletion of scsi proc_ops which
    caused some build breakage has been held over until the next merge
    window to give us more time to stabilise it).

    I'm afraid, with me moving continents at exactly the wrong time,
    anything submitted after the merge window opened has been held over to
    the next merge window."

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (63 commits)
    [SCSI] ipr: Driver version 2.5.3
    [SCSI] ipr: Increase alignment boundary of command blocks
    [SCSI] ipr: Increase max concurrent oustanding commands
    [SCSI] ipr: Remove unnecessary memory barriers
    [SCSI] ipr: Remove unnecessary interrupt clearing on new adapters
    [SCSI] ipr: Fix target id allocation re-use problem
    [SCSI] atp870u, mpt2sas, qla4xxx use pci_dev->revision
    [SCSI] fcoe: Drop the rtnl_mutex before calling fcoe_ctlr_link_up
    [SCSI] bfa: Update the driver version to 3.0.23.0
    [SCSI] bfa: BSG and User interface fixes.
    [SCSI] bfa: Fix to avoid vport delete hang on request queue full scenario.
    [SCSI] bfa: Move service parameter programming logic into firmware.
    [SCSI] bfa: Revised Fabric Assigned Address(FAA) feature implementation.
    [SCSI] bfa: Flash controller IOC pll init fixes.
    [SCSI] bfa: Serialize the IOC hw semaphore unlock logic.
    [SCSI] bfa: Modify ISR to process pending completions
    [SCSI] bfa: Add fc host issue lip support
    [SCSI] mpt2sas: remove extraneous sas_log_info messages
    [SCSI] libfc: fcoe_transport_create fails in single-CPU environment
    [SCSI] fcoe: reduce contention for fcoe_rx_list lock [v2]
    ...

    Linus Torvalds
     
  • 64252c75a2196a0cf1e0d3777143ecfe0e3ae650 "vfs: remove dget() from
    dentry_unhash()" changed the implementation but not the comment.

    Cc: Sage Weil
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Al Viro

    J. Bruce Fields
     
  • Split __lookup_hash into two component functions:

    lookup_dcache - tries cached lookup, returns whether real lookup is needed
    lookup_real - calls i_op->lookup

    This eliminates code duplication between d_alloc_and_lookup() and
    d_inode_lookup().

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Al Viro

    Miklos Szeredi
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • now we have __lookup_hash() open-coded if !dentry case;
    just call the damn thing instead...

    Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Reorder if-else cases for starters...

    Signed-off-by: Al Viro

    Al Viro
     
  • Everything arriving into if (!dentry) will have need_reval = 1.
    Indeed, the only way to get there with need_reval reset to 0 would
    be via
    if (unlikely(d_need_lookup(dentry)))
    goto unlazy;
    if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) {
    status = d_revalidate(dentry, nd);
    if (unlikely(status

    Al Viro
     
  • d_lookup() *will* fail after successful d_invalidate(), if we are
    holding i_mutex all along. IOW, we don't need to jump back to
    l: - we know what path will be taken there and can do that (i.e.
    d_alloc_and_lookup()) directly.

    Signed-off-by: Al Viro

    Al Viro
     
  • keep holding ->i_mutex over revalidation parts

    Signed-off-by: Al Viro

    Al Viro
     
  • Duplicate the revalidation-related parts into if (!dentry) branch.
    Next step will be to pull them under i_mutex.

    This and the next 8 commits are more or less a splitup of patch
    by Miklos; folks, when you are working with something that convoluted,
    carve your patches up into easily reviewed steps, especially when
    a lot of codepaths involved are rarely hit...

    Signed-off-by: Al Viro

    Al Viro
     
  • The only caller of __lookup_hash() that needs the exec permission check on
    parent is lookup_one_len().

    All lookup_hash() callers already checked permission in LOOKUP_PARENT walk.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Al Viro

    Miklos Szeredi
     
  • __lookup_hash() calls ->lookup() if the dentry needs lookup and on success
    revalidates the dentry (all under dir->i_mutex).

    While this is harmless it doesn't make a lot of sense.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Al Viro

    Miklos Szeredi
     
  • Doing revalidate on a dentry which has not yet been looked up makes no sense.

    Move the d_need_lookup() check before d_revalidate().

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Al Viro

    Miklos Szeredi