03 Apr, 2016

1 commit

  • Commit d4edcf0d5695 ("mm/gup: Switch all callers of get_user_pages() to
    not pass tsk/mm") switched get_user_pages() callers to the simpler model
    where they no longer pass in the thread and mm pointer. But since then
    we've merged changes to a few drivers that re-introduce use of the old
    interface. Let's fix them up.

    They continued to work fine (thanks to the truly disgusting macros
    introduced in commit cde70140fed8: "mm/gup: Overload get_user_pages()
    functions"), but cause unnecessary build noise.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

23 Mar, 2016

24 commits

  • Add mport character device driver to provide user space interface to
    basic RapidIO subsystem operations.

    See included Documentation/rapidio/mport_cdev.txt for more details.

    [akpm@linux-foundation.org: fix printk warning on i386]
    [dan.carpenter@oracle.com: mport_cdev: fix some error codes]
    Signed-off-by: Alexandre Bounine
    Signed-off-by: Dan Carpenter
    Tested-by: Barry Wood
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Cc: Barry Wood
    Cc: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add DMA channel re-initialization after an error to avoid termination of
    all pending transfer requests.

    Signed-off-by: Alexandre Bounine
    Reported-by: Barry Wood
    Tested-by: Barry Wood
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Cc: Barry Wood
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Fix synchronization issues found during testing using multiple DMA
    transfer requests to the same channel:

    - lost MSI-X interrupt notifications
    - non-synchronized attempts to start DMA channel HW resulting in error
    message from the driver
    - cookie tracking/update race conditions resulting in incorrect DMA
    transfer status report

    Signed-off-by: Alexandre Bounine
    Reported-by: Barry Wood
    Tested-by: Barry Wood
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Cc: Barry Wood
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Switch to returning error-valued pointer instead of simple NULL pointer.
    This allows to properly identify situation when request queue is full
    and therefore gives to upper layer an option to retry operation later.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Replace "all-or-nothing" debug output with controlled debug output using
    functional block masks. This allows run time control of debug messages
    through 'dbg_level' module parameter.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add device-specific callback functions to support outbound windows
    mapping and release.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add RapidIO controller (mport) outbound window configuration operations.

    This patch is a part of the original patch submitted by Li Yang:

    https://lists.ozlabs.org/pipermail/linuxppc-dev/2009-April/071210.html

    For some reason the original part was not applied to mainline code
    tree. The inbound window mapping part has been applied later during
    tsi721 mport driver submission. Now goes the second part with
    corresponding HW support.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Li Yang
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • - Add spinlock protection into outbound message queuing routine.

    - Change outbound message interrupt handler to avoid deadlock when
    calling registered callback routine.

    - Allow infinite retries for outbound messages to avoid retry threshold
    error signaling in systems with nodes that have slow message receive
    queue processing.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add new Port Write handler registration interfaces that attach PW
    handlers to local mport device objects. This is different from old
    interface that attaches PW callback to individual RapidIO device. The
    new interfaces are intended for use for common event handling (e.g.
    hot-plug notifications) while the old interface is available for
    individual device drivers.

    This patch is based on patch proposed by Andre van Herk but preserves
    existing per-device interface and adds lock protection for list
    handling.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Cc: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Make rio_pw_enable() routine available to other RapidIO drivers.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Make function rio_local_set_device_id() common for all components of
    RapidIO subsystem.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add lock protection around doorbell list handling to prevent list
    corruption on SMP platforms.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add hardware-specific device removal support for Tsi721 PCIe-to-RapidIO
    bridge. To avoid excessive data type conversions, parameters passed to
    some internal functions have been revised. Dynamic memory allocations
    of rio_mport and rio_ops have been replaced to reduce references between
    data structures.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add common mport removal support functions into the RapidIO subsystem
    core.

    Changes to the existing mport registration process have been made to
    avoid race conditions with active subsystem interfaces immediately after
    mport device registration: part of initialization code from
    rio_register_mport() have been moved into separate function
    rio_mport_initialize() to allow to perform mport registration as the
    final step of setup process.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Make net allocation/release routines available to all components of
    RapidIO subsystem by moving code from rio-scan enumerator.

    Make destination ID allocation method private to existing enumerator
    because other enumeration methods can use their own algorithm.

    Setup net device object as a parent of all RapidIO devices residing in
    it and register net as a child of active mport device.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • This patch moves per-net device list handling from rio-scan to common
    RapidIO core and adds a matching device deletion routine. This makes
    device object creation/removal available to other implementations of
    enumeration/discovery process.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add device driver specific shutdown notification callback.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add bus-specific callback to stop RapidIO devices during a system
    shutdown.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add device-specific implementation of query_mport callback function.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add mport query operation to report master port RapidIO capabilities and
    run time configuration to upper level drivers.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Fix pending DMA request queue handling to avoid broken ordering during
    concurrent request submissions.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add an option to configure mapping of Inbound Window without RIO-to-PCIe
    address translation.

    If a local memory buffer is not properly aligned to meet HW requirements
    for RapidIO address mapping with address translation, caller can request
    an inbound window with matching RapidIO address assigned to it. This
    implementation selects RapidIO base address and size for inbound window
    that are capable to accommodate the local memory buffer.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add check for attempts to request mapping of inbound RapidIO address
    space that overlaps with existing active mapping windows.

    Tsi721 device does not support overlapped inbound windows and SRIO
    address decoding behavior is not defined in such cases.

    This patch is applicable to kernel versions starting from v3.7.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Remove use of hardcoded setting for Maximum Read Request Size (MRRS)
    value and use one set by PCIe bus driver.

    Using hardcoded value can cause PCIe bus errors on platforms that have
    tsi721 device on PCIe path that allows only smaller read request sizes.

    This fix is applicable to kernel versions starting from v3.2.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Aurelien Jacquiot
    Cc: Andre van Herk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     

30 Jan, 2016

1 commit

  • I/O resource descriptor, 'desc' in struct resource, needs to be
    initialized to zero by default. Some drivers call kmalloc() to
    allocate a resource entry, but do not initialize it to zero by
    memset(). Change these drivers to call kzalloc(), instead.

    Signed-off-by: Toshi Kani
    Signed-off-by: Borislav Petkov
    Acked-by: Alexandre Bounine
    Acked-by: Helge Deller
    Acked-by: Rafael J. Wysocki
    Acked-by: Simon Horman
    Cc: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Luis R. Rodriguez
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Toshi Kani
    Cc: linux-acpi@vger.kernel.org
    Cc: linux-arch@vger.kernel.org
    Cc: linux-mm
    Cc: linux-parisc@vger.kernel.org
    Cc: linux-renesas-soc@vger.kernel.org
    Cc: linux-sh@vger.kernel.org
    Link: http://lkml.kernel.org/r/1453841853-11383-10-git-send-email-bp@alien8.de
    Signed-off-by: Ingo Molnar

    Toshi Kani
     

21 Jan, 2016

1 commit


24 Jun, 2015

1 commit

  • Pull trivial tree updates from Jiri Kosina:
    "As usual, mostly comment, kerneldoc and printk() fixes"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial:
    lpfc: Grammar s/an negative/a negative/
    ARM: lib/lib1funcs.S: fix typo s/substractions/subtractions/
    cx25821: cx25821-medusa-reg.h: fix 0x0x prefix
    lib: crc-itu-t.[ch] fix 0x0x prefix in integer constants
    rapidio: Fix kerneldoc and comment
    qla4xxx: Fix printk() in qla4_83xx_read_reset_template() and qla4_83xx_pre_loopback_config()
    treewide: Kconfig: fix wording / spelling
    usb/serial: fix grammar in Kconfig help text for FTDI_SIO
    megaraid_sas: fix kerneldoc
    netfilter: ebtables: fix comment grammar
    drm/radeon: fix comment
    isdn: fix grammar in comment
    ARM: KVM: fix comment

    Linus Torvalds
     

26 May, 2015

1 commit


19 Feb, 2015

1 commit

  • Pull dmaengine updates from Vinod Koul:
    "This update brings:

    - the big cleanup up by Maxime for device control and slave
    capabilities. This makes the API much cleaner.

    - new IMG MDC driver by Andrew

    - new Renesas R-Car Gen2 DMA Controller driver by Laurent along with
    bunch of fixes on rcar drivers

    - odd fixes and updates spread over driver"

    * 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (130 commits)
    dmaengine: pl330: add DMA_PAUSE feature
    dmaengine: pl330: improve pl330_tx_status() function
    dmaengine: rcar-dmac: Disable channel 0 when using IOMMU
    dmaengine: rcar-dmac: Work around descriptor mode IOMMU errata
    dmaengine: rcar-dmac: Allocate hardware descriptors with DMAC device
    dmaengine: rcar-dmac: Fix oops due to unintialized list in error ISR
    dmaengine: rcar-dmac: Fix spinlock issues in interrupt
    dmaenegine: edma: fix sparse warnings
    dmaengine: rcar-dmac: Fix uninitialized variable usage
    dmaengine: shdmac: extend PM methods
    dmaengine: shdmac: use SET_RUNTIME_PM_OPS()
    dmaengine: pl330: fix bug that cause start the same descs in cyclic
    dmaengine: at_xdmac: allow muliple dwidths when doing slave transfers
    dmaengine: at_xdmac: simplify channel configuration stuff
    dmaengine: at_xdmac: introduce save_cc field
    dmaengine: at_xdmac: wait for in-progress transaction to complete after pausing a channel
    ioat: fail self-test if wait_for_completion times out
    dmaengine: dw: define DW_DMA_MAX_NR_MASTERS
    dmaengine: dw: amend description of dma_dev field
    dmatest: move src_off, dst_off, len inside loop
    ...

    Linus Torvalds
     

27 Jan, 2015

1 commit


22 Dec, 2014

1 commit


13 Aug, 2014

1 commit

  • We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to
    meet kernel coding style guidelines. This issue was reported by checkpatch.

    A simplified version of the semantic patch that makes this change is as
    follows (http://coccinelle.lip6.fr/):

    //

    @@
    identifier i;
    declarer name DEFINE_PCI_DEVICE_TABLE;
    initializer z;
    @@

    - DEFINE_PCI_DEVICE_TABLE(i)
    + const struct pci_device_id i[]
    = z;

    //

    [bhelgaas: add semantic patch]
    Signed-off-by: Benoit Taine
    Signed-off-by: Bjorn Helgaas

    Benoit Taine
     

09 Aug, 2014

2 commits

  • Rework Tsi721 RapidIO DMA engine support to allow handling data
    scatter/gather lists longer than number of hardware buffer descriptors in
    the DMA channel's descriptor list.

    The current implementation of Tsi721 DMA transfers requires that number of
    entries in a scatter/gather list provided by a caller of
    dmaengine_prep_rio_sg() should not exceed number of allocated hardware
    buffer descriptors.

    This patch removes the limitation by processing long scatter/gather lists
    by sections that can be transferred using hardware descriptor ring of
    configured size. It also introduces a module parameter
    "dma_desc_per_channel" to allow run-time configuration of Tsi721 hardware
    buffer descriptor rings.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Andre van Herk
    Cc: Stef van Os
    Cc: Vinod Koul
    Cc: Dan Williams
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add RapidIO DMA interface routines that directly use reference to the mport
    device object and/or target device destination ID as parameters.
    This allows to perform RapidIO DMA transfer requests by modules that do not
    have an access to the RapidIO device list.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Andre van Herk
    Cc: Stef van Os
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     

31 Jul, 2014

1 commit

  • This is a bug fix for the situation when function tsi721_desc_get() fails
    to obtain a free transaction descriptor.

    The bug usually results in a memory access crash dump when data transfer
    scatter-gather list has more entries than size of hardware buffer
    descriptors ring. This fix ensures that error is properly returned to a
    caller instead of an invalid entry.

    This patch is applicable to kernel versions starting from v3.5.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Andre van Herk
    Cc: Stef van Os
    Cc: Vinod Koul
    Cc: Dan Williams
    Cc: [3.5+]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     

07 Jun, 2014

1 commit

  • As result of deprecation of MSI-X/MSI enablement functions
    pci_enable_msix() and pci_enable_msi_block() all drivers using these two
    interfaces need to be updated to use the new pci_enable_msi_range() or
    pci_enable_msi_exact() and pci_enable_msix_range() or
    pci_enable_msix_exact() interfaces.

    The patch has no runtime effect.

    Signed-off-by: Alexander Gordeev
    Cc: Matt Porter
    Acked-by: Alexandre Bounine
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     

08 Apr, 2014

2 commits

  • This patch removes an artificial RapidIO bus root device and establishes
    actual device hierarchy by providing reference to real parent devices.
    It also introduces device class for RapidIO controller devices (on-chip
    or an eternal bridge, known as "mport").

    Existing implementation was sufficient for SoC-based platforms that have
    a single RapidIO controller. With introduction of devices using
    multiple RapidIO controllers and PCIe-to-RapidIO bridges the old scheme
    is very limiting or does not work at all. The implemented changes allow
    to properly reference platform's local RapidIO mport devices and provide
    device details needed for upper layers.

    This change to RapidIO device hierarchy does not break any known
    existing kernel or user space interfaces.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Li Yang
    Cc: Kumar Gala
    Cc: Andre van Herk
    Cc: Stef van Os
    Cc: Jerry Jacobs
    Cc: Arno Tiemersma
    Cc: Rob Landley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Combine SG entries describing single contiguous memory block into one
    Tsi721 BDMA descriptor. This reduces number of hardware descriptors
    required for large data transfers and improves performance on the PCIe
    side by reducing number of descriptor fetch requests.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     

04 Mar, 2014

1 commit

  • This patch is a modification of the patch originally proposed by
    Xiaotian Feng : https://lkml.org/lkml/2012/11/5/413
    This new version disables DMA channel interrupts and ensures that the
    tasklet wil not be scheduled again before calling tasklet_kill().

    Unfortunately the updated patch was not released at that time due to
    planned rework of Tsi721 mport driver to use threaded interrupts (which
    has yet to happen). Recently the issue was reported again:
    https://lkml.org/lkml/2014/2/19/762.

    Description from the original Xiaotian's patch:

    "Some drivers use tasklet_disable in device remove/release process,
    tasklet_disable will inc tasklet->count and return. If the tasklet is
    not handled yet under some softirq pressure, the tasklet will be
    placed on the tasklet_vec, never have a chance to be excuted. This
    might lead to a heavy loaded ksoftirqd, wakeup with pending_softirq,
    but tasklet is disabled. tasklet_kill should be used in this case."

    This patch is applicable to kernel versions starting from v3.5.

    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Xiaotian Feng
    Reviewed-by: Thomas Gleixner
    Cc: Mike Galbraith
    Cc: [3.5+]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine