19 Oct, 2016

1 commit

  • This removes the 'write' and 'force' from get_user_pages() and replaces
    them with 'gup_flags' to make the use of FOLL_FORCE explicit in callers
    as use of this flag can result in surprising behaviour (and hence bugs)
    within the mm subsystem.

    Signed-off-by: Lorenzo Stoakes
    Acked-by: Christian König
    Acked-by: Jesper Nilsson
    Acked-by: Michal Hocko
    Reviewed-by: Jan Kara
    Signed-off-by: Linus Torvalds

    Lorenzo Stoakes
     

12 Oct, 2016

1 commit

  • Fix coccinelle warning about duplicating existing memdup_user function.

    Link: http://lkml.kernel.org/r/20160811151737.20140-1-alexandre.bounine@idt.com
    Link: https://lkml.org/lkml/2016/8/11/29
    Signed-off-by: Alexandre Bounine
    Reported-by: kbuild test robot
    Cc: Matt Porter
    Cc: Andre van Herk
    Cc: Barry Wood
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     

20 Sep, 2016

1 commit

  • As reported by Alexey Khoroshilov (https://lkml.org/lkml/2016/9/9/737):
    riocm_send_close() is called from rio_cm_shutdown() under
    spin_lock_bh(idr_lock), but riocm_send_close() uses a GFP_KERNEL
    allocation.

    Fix by taking riocm_send_close() outside of spinlock protected code.

    [akpm@linux-foundation.org: remove unneeded `if (!list_empty())']
    Link: http://lkml.kernel.org/r/20160915175402.10122-1-alexandre.bounine@idt.com
    Signed-off-by: Alexandre Bounine
    Reported-by: Alexey Khoroshilov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     

02 Sep, 2016

1 commit

  • Fix incorrect condition to identify involvment of a address translation
    mechanism.

    This bug results in NULL pointer kernel crash dump in cases when mapping
    of inbound RapidIO address range is requested within existing aprture.

    Link: http://lkml.kernel.org/r/20160901173144.2983-1-alexandre.bounine@idt.com
    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Andre van Herk
    Cc: Barry Wood
    Cc: [4.6+]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     

11 Aug, 2016

1 commit

  • Original patch: https://lkml.org/lkml/2016/8/4/32

    If riocm_ch_alloc() fails then we end up dereferencing the error
    pointer.

    The problem is that we're not unwinding in the reverse order from how we
    allocate things so it gets confusing. I've changed this around so now
    "ch" is NULL when we are done with it after we call riocm_put_channel().
    That way we can check if it's NULL and avoid calling riocm_put_channel()
    on it twice.

    I renamed err_nodev to err_put_new_ch so that it better reflects what
    the goto does.

    Then because we had flipping things around, it means we don't neeed to
    initialize the pointers to NULL and we can remove an if statement and
    pull things in an indent level.

    Link: http://lkml.kernel.org/r/20160805152406.20713-1-alexandre.bounine@idt.com
    Signed-off-by: Dan Carpenter
    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Andre van Herk
    Cc: Barry Wood
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Carpenter
     

03 Aug, 2016

12 commits

  • Add RapidIO switch driver for IDT Gen3 switch devices: RXS1632 and
    RXS2448.

    [alexandre.bounine@idt.com: fixup for original driver patch]
    Link: http://lkml.kernel.org/r/1469137596-18241-1-git-send-email-alexandre.bounine@idt.com
    Link: http://lkml.kernel.org/r/1469125134-16523-14-git-send-email-alexandre.bounine@idt.com
    Signed-off-by: Alexandre Bounine
    Tested-by: Barry Wood
    Cc: Matt Porter
    Cc: Andre van Herk
    Cc: Barry Wood
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Implement changes made in RapidIO specification rev.3 to LP-Serial Physical
    Layer register definitions:

    - use per-port register offset calculations based on LP-Serial Extended
    Features Block (EFB) Register Map type (I or II) with different
    per-port offset step (0x20 vs 0x40 respectfully).

    - remove deprecated Parallel Physical layer definitions and related
    code.

    [alexandre.bounine@idt.com: fix DocBook warning for gen3 update]
    Link: http://lkml.kernel.org/r/1469191173-19338-1-git-send-email-alexandre.bounine@idt.com
    Link: http://lkml.kernel.org/r/1469125134-16523-12-git-send-email-alexandre.bounine@idt.com
    Signed-off-by: Alexandre Bounine
    Tested-by: Barry Wood
    Cc: Matt Porter
    Cc: Andre van Herk
    Cc: Barry Wood
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Current definition of map_inb() mport operations callback uses u32 type
    to specify required inbound window (IBW) size. This is limiting factor
    because existing hardware - tsi721 and fsl_rio, both support IBW size up
    to 16GB.

    Changing type of size parameter to u64 to allow IBW size configurations
    larger than 4GB.

    [alexandre.bounine@idt.com: remove compiler warning about size of constant]
    Link: http://lkml.kernel.org/r/20160802184856.2566-1-alexandre.bounine@idt.com
    Link: http://lkml.kernel.org/r/1469125134-16523-11-git-send-email-alexandre.bounine@idt.com
    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Benjamin Herrenschmidt
    Cc: Michael Ellerman
    Cc: Andre van Herk
    Cc: Barry Wood
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Fix lockdep warning during device probing: move sysfs initialization out
    of code protected by a spin lock.

    Link: http://lkml.kernel.org/r/1469125134-16523-10-git-send-email-alexandre.bounine@idt.com
    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Andre van Herk
    Cc: Barry Wood
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add checking for error code returned by HW-specific mbox open routines.
    Ensure that resources are properly release if failed.

    This patch is applicable to kernel versions starting from v2.6.15.

    Link: http://lkml.kernel.org/r/1469125134-16523-9-git-send-email-alexandre.bounine@idt.com
    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Andre van Herk
    Cc: Barry Wood
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add advancing transfer queue immediately from transfer submit call. DMA
    performance improvement: This will start transfer without waiting for
    'issue_pending' command if there is no DMA transfer in progress.

    Link: http://lkml.kernel.org/r/1469125134-16523-8-git-send-email-alexandre.bounine@idt.com
    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Andre van Herk
    Cc: Barry Wood
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add module parameter to allow load time configuration of available
    RapidIO messaging mailboxes (MBOX1 - MBOX4).

    Having a messaging MBOX selector mask allows to define which MBOXes are
    controlled by the mport device driver and reserve some of them for
    direct use by other drivers.

    Link: http://lkml.kernel.org/r/1469125134-16523-7-git-send-email-alexandre.bounine@idt.com
    Signed-off-by: Alexandre Bounine
    Tested-by: Barry Wood
    Cc: Matt Porter
    Cc: Andre van Herk
    Cc: Barry Wood
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add PCIe Maximum Read Request Size (MRRS) adjustment parameter to allow
    users to override configuration register value set during PCIe bus
    initialization.

    Performance of Tsi721 device as PCIe bus master can be improved if MRRS
    is set to its maximum value (4096 bytes). Some platforms have
    limitations for supported MRRS and therefore the default value should be
    preserved, unless it is known that given platform supports full set of
    MRRS values defined by PCI Express specification.

    Link: http://lkml.kernel.org/r/1469125134-16523-6-git-send-email-alexandre.bounine@idt.com
    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Andre van Herk
    Cc: Barry Wood
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Add module parameters to allow load time configuration of DMA channels.

    Depending on application, performance of DMA data transfers can benefit
    from adjusted sizes of buffer descriptor ring and/or transaction
    requests queue.

    Having HW DMA channel selector mask allows to define which channels
    (from seven available) are controlled by the mport device driver and
    reserve some of them for direct use by other drivers.

    Link: http://lkml.kernel.org/r/1469125134-16523-5-git-send-email-alexandre.bounine@idt.com
    Signed-off-by: Alexandre Bounine
    Tested-by: Barry Wood
    Cc: Matt Porter
    Cc: Andre van Herk
    Cc: Barry Wood
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Update return value description for rio_dma_prep_... functions to
    include error-valued pointer that can be returned by HW mport device
    drivers. Return values from these functions must be checked using
    IS_ERR_OR_NULL macro.

    This patch is applicable to kernel versions starting from v4.6-rc1.

    Link: http://lkml.kernel.org/r/1469125134-16523-4-git-send-email-alexandre.bounine@idt.com
    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Andre van Herk
    Cc: Barry Wood
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexandre Bounine
     
  • Patch series "RapidIO subsystem updates".

    This set of patches contains RapidIO subsystem fixes and updates that
    have been made since kernel v4.6. The most significant update brings
    changes related to the latest revision of RapidIO specification
    (rev.3.x) and introduction of next generation of RapidIO switches by IDT
    (RXS1632 and RXS2448).

    This patch (of 13):

    This is RapidIO part of the original patch submitted by Joe Perches.
    (see: https://lkml.org/lkml/2016/3/5/19)

    Since commit 3cab1e711297 ("lib/vsprintf: refactor duplicate code
    to special_hex_number()") %pa uses have been output with a 0x prefix.

    These 0x prefixes in the formats are unnecessary.

    Link: http://lkml.kernel.org/r/1469125134-16523-2-git-send-email-alexandre.bounine@idt.com
    Signed-off-by: Joe Perches
    Signed-off-by: Alexandre Bounine
    Cc: Matt Porter
    Cc: Andre van Herk
    Cc: Barry Wood
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Add channelized messaging driver to support native RapidIO messaging
    exchange between multiple senders/recipients on devices that use kernel
    RapidIO subsystem services.

    This device driver is the result of collaboration within the RapidIO.org
    Software Task Group (STG) between Texas Instruments, Prodrive
    Technologies, Nokia Networks, BAE and IDT. Additional input was
    received from other members of RapidIO.org.

    The objective was to create a character mode driver interface which
    exposes messaging capabilities of RapidIO endpoint devices (mports)
    directly to applications, in a manner that allows the numerous and
    varied RapidIO implementations to interoperate.

    This char mode device driver allows user-space applications to setup
    messaging communication channels using single shared RapidIO messaging
    mailbox.

    By default this driver uses RapidIO MBOX_1 (MBOX_0 is reserved for use by
    RIONET Ethernet emulation driver).

    [weiyj.lk@gmail.com: rapidio/rio_cm: fix return value check in riocm_init()]
    Link: http://lkml.kernel.org/r/1469198221-21970-1-git-send-email-alexandre.bounine@idt.com
    Link: http://lkml.kernel.org/r/1468952862-18056-1-git-send-email-alexandre.bounine@idt.com
    Signed-off-by: Alexandre Bounine
    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
     

06 May, 2016

1 commit

  • Fix problems in uapi definitions reported by Gabriel Laskar: (see
    https://lkml.org/lkml/2016/4/5/205 for details)

    - move public header file rio_mport_cdev.h to include/uapi/linux directory
    - change types in data structures passed as IOCTL parameters
    - improve parameter checking in some IOCTL service routines

    Signed-off-by: Alexandre Bounine
    Reported-by: Gabriel Laskar
    Tested-by: Barry Wood
    Cc: Gabriel Laskar
    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
     

29 Apr, 2016

1 commit

  • The change fixes improper check for a returned error value by
    class_create() function, which on error returns ERR_PTR() value, thus the
    original check always results in a dead code on error path.

    Signed-off-by: Vladimir Zapolskiy
    Signed-off-by: Alexandre Bounine
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vladimir Zapolskiy
     

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

20 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