08 Oct, 2020

1 commit

  • * tag 'v5.4.70': (3051 commits)
    Linux 5.4.70
    netfilter: ctnetlink: add a range check for l3/l4 protonum
    ep_create_wakeup_source(): dentry name can change under you...
    ...

    Conflicts:
    arch/arm/mach-imx/pm-imx6.c
    arch/arm64/boot/dts/freescale/imx8mm-evk.dts
    arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts
    drivers/crypto/caam/caamalg.c
    drivers/gpu/drm/imx/dw_hdmi-imx.c
    drivers/gpu/drm/imx/imx-ldb.c
    drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c
    drivers/mmc/host/sdhci-esdhc-imx.c
    drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
    drivers/net/ethernet/freescale/enetc/enetc.c
    drivers/net/ethernet/freescale/enetc/enetc_pf.c
    drivers/thermal/imx_thermal.c
    drivers/usb/cdns3/ep0.c
    drivers/xen/swiotlb-xen.c
    sound/soc/fsl/fsl_esai.c
    sound/soc/fsl/fsl_sai.c

    Signed-off-by: Jason Liu

    Jason Liu
     

22 Jul, 2020

2 commits

  • commit bf12fdf0ab728ca8e5933aac46dd972c0dd0421e upstream.

    While e3a3c3a20555 ("UIO: fix uio_pdrv_genirq with device tree but no
    interrupt") added support for using uio_pdrv_genirq for devices without
    interrupt for device tree platforms, the removal of uio_pdrv in
    26dac3c49d56 ("uio: Remove uio_pdrv and use uio_pdrv_genirq instead")
    broke the support for non device tree platforms.

    This change fixes this, so that uio_pdrv_genirq can be used without
    interrupt on all platforms.

    This still leaves the support that uio_pdrv had for custom interrupt
    handler lacking, as uio_pdrv_genirq does not handle it (yet).

    Fixes: 26dac3c49d56 ("uio: Remove uio_pdrv and use uio_pdrv_genirq instead")
    Signed-off-by: Esben Haabendal
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20200701145659.3978-3-esben@geanix.com
    Signed-off-by: Greg Kroah-Hartman

    Esben Haabendal
     
  • commit 324ac45f25e634eca6346953ae531e8da3e0c73d upstream.

    Since e3a3c3a20555 ("UIO: fix uio_pdrv_genirq with device tree but no
    interrupt"), the uio_pdrv_genirq has supported use without interrupt,
    so the change in 7723f4c5ecdb ("driver core: platform: Add an error
    message to") added false warnings for those cases.

    Fixes: 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()")
    Signed-off-by: Esben Haabendal
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20200701145659.3978-2-esben@geanix.com
    Signed-off-by: Greg Kroah-Hartman

    Esben Haabendal
     

29 Apr, 2020

2 commits

  • This adds a UIO driver the ivshmem device, found in QEMU and the
    Jailhouse hypervisor. It exposes the MMIO register region and all shared
    memory section to userspace. Interrupts are configured in one-shot mode
    so that userspace needs to re-enable them after each event via the
    Interrupt Control register. The driver registers all possible MSI-X
    vectors, coalescing them into the single notifier UIO provides.

    Note: Specification work for the interface is ongoing, so details may
    still change.

    Acked-by: Ye Li
    Signed-off-by: Jan Kiszka

    Jan Kiszka
     
  • This allows to tag memory regions read-only, denying userspace to map
    them writable. Default remains read/write.

    Acked-by: Ye Li
    Signed-off-by: Jan Kiszka

    Jan Kiszka
     

24 Feb, 2020

1 commit

  • [ Upstream commit b74351287d4bd90636c3f48bc188c2f53824c2d4 ]

    The driver may sleep while holding a spinlock.
    The function call path (from bottom to top) in Linux 4.19 is:

    kernel/irq/manage.c, 523:
    synchronize_irq in disable_irq
    drivers/uio/uio_dmem_genirq.c, 140:
    disable_irq in uio_dmem_genirq_irqcontrol
    drivers/uio/uio_dmem_genirq.c, 134:
    _raw_spin_lock_irqsave in uio_dmem_genirq_irqcontrol

    synchronize_irq() can sleep at runtime.

    To fix this bug, disable_irq() is called without holding the spinlock.

    This bug is found by a static analysis tool STCheck written by myself.

    Signed-off-by: Jia-Ju Bai
    Link: https://lore.kernel.org/r/20191218094405.6009-1-baijiaju1990@gmail.com
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Jia-Ju Bai
     

19 Sep, 2019

1 commit

  • Pull char/misc driver updates from Greg KH:
    "Here is the big char/misc driver pull request for 5.4-rc1.

    As has been happening in previous releases, more and more individual
    driver subsystem trees are ending up in here. Now if that is good or
    bad I can't tell, but hopefully it makes your life easier as it's more
    of an aggregation of trees together to one merge point for you.

    Anyway, lots of stuff in here:
    - habanalabs driver updates
    - thunderbolt driver updates
    - misc driver updates
    - coresight and intel_th hwtracing driver updates
    - fpga driver updates
    - extcon driver updates
    - some dma driver updates
    - char driver updates
    - android binder driver updates
    - nvmem driver updates
    - phy driver updates
    - parport driver fixes
    - pcmcia driver fix
    - uio driver updates
    - w1 driver updates
    - configfs fixes
    - other assorted driver updates

    All of these have been in linux-next for a long time with no reported
    issues"

    * tag 'char-misc-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (200 commits)
    misc: mic: Use PTR_ERR_OR_ZERO rather than its implementation
    habanalabs: correctly cast variable to __le32
    habanalabs: show correct id in error print
    habanalabs: stop using the acronym KMD
    habanalabs: display card name as sensors header
    habanalabs: add uapi to retrieve aggregate H/W events
    habanalabs: add uapi to retrieve device utilization
    habanalabs: Make the Coresight timestamp perpetual
    habanalabs: explicitly set the queue-id enumerated numbers
    habanalabs: print to kernel log when reset is finished
    habanalabs: replace __le32_to_cpu with le32_to_cpu
    habanalabs: replace __cpu_to_le32/64 with cpu_to_le32/64
    habanalabs: Handle HW_IP_INFO if device disabled or in reset
    habanalabs: Expose devices after initialization is done
    habanalabs: improve security in Debug IOCTL
    habanalabs: use default structure for user input in Debug IOCTL
    habanalabs: Add descriptive name to PSOC app status register
    habanalabs: Add descriptive names to PSOC scratch-pad registers
    habanalabs: create two char devices per ASIC
    habanalabs: change device_setup_cdev() to be more generic
    ...

    Linus Torvalds
     

04 Sep, 2019

1 commit

  • When probed via DT, the uio_pdrv_genirq driver currently uses the name
    of the node and exposes that as name of the UIO device to userspace.

    This doesn't work for systems where multiple nodes with the same name
    (but different unit addresses) are present, or for systems where the
    node names are auto-generated by a third-party tool.

    This patch adds the possibility to read the UIO name from the optional
    "linux,uio-name" property.

    Signed-off-by: Daniel Mack
    Link: https://lore.kernel.org/r/20190815212807.25058-1-daniel@zonque.org
    Signed-off-by: Greg Kroah-Hartman

    Daniel Mack
     

02 Aug, 2019

1 commit


31 Jul, 2019

1 commit

  • We don't need dev_err() messages when platform_get_irq() fails now that
    platform_get_irq() prints an error message itself when something goes
    wrong. Let's remove these prints with a simple semantic patch.

    //
    @@
    expression ret;
    struct platform_device *E;
    @@

    ret =
    (
    platform_get_irq(E, ...)
    |
    platform_get_irq_byname(E, ...)
    );

    if ( \( ret < 0 \| ret

    While we're here, remove braces on if statements that only have one
    statement (manually).

    Cc: Greg Kroah-Hartman
    Cc: Greg Kroah-Hartman
    Signed-off-by: Stephen Boyd
    Link: https://lore.kernel.org/r/20190730181557.90391-46-swboyd@chromium.org
    Signed-off-by: Greg Kroah-Hartman

    Stephen Boyd
     

19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

05 Jun, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not write to the free
    software foundation inc 59 temple place suite 330 boston ma 02111
    1307 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 136 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190530000436.384967451@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

24 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details you
    should have received a copy of the gnu general public license along
    with this program if not write to the free software foundation inc
    675 mass ave cambridge ma 02139 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 441 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Michael Ellerman (powerpc)
    Reviewed-by: Richard Fontana
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190520071858.739733335@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

1 commit


28 Mar, 2019

1 commit


31 Jan, 2019

3 commits

  • In uio_dev_add_attributes() error handing case, idev is used after
    device_unregister(), in which 'idev' has been released, touch idev cause
    use-after-free.

    Fixes: a93e7b331568 ("uio: Prevent device destruction while fds are open")
    Signed-off-by: Liu Jian
    Reviewed-by: Hamish Martin
    Signed-off-by: Greg Kroah-Hartman

    Liu Jian
     
  • 'idev' is malloced in __uio_register_device() and leak free it before
    leaving from the uio_get_minor() error handing case, it will cause
    memory leak.

    Fixes: a93e7b331568 ("uio: Prevent device destruction while fds are open")
    Signed-off-by: Liu Jian
    Reviewed-by: Hamish Martin
    Signed-off-by: Greg Kroah-Hartman

    Liu Jian
     
  • Userspace code using uio_pci_generic may enable bus-mastering by
    directly manipulating a PCI device's command register. If a userspace
    program enables bus-mastering but exits/crashes uncleanly, bus-
    mastering will still be enabled and stale DMA addresses may be
    programmed and live in the device.

    Disable bus-mastering unconditionally on last close of a UIO PCI fd
    to avoid this. If the device did not have bus-mastering enabled,
    pci_clear_master() is a no-op.

    Signed-off-by: Venkatesh Srinivas
    Reviewed-by: Bjorn Helgaas
    Reviewed-by: Catherine Sullivan
    Acked-by: Michael S. Tsirkin
    Signed-off-by: Greg Kroah-Hartman

    Venkatesh Srinivas
     

22 Jan, 2019

2 commits


29 Dec, 2018

1 commit

  • Pull char/misc driver updates from Greg KH:
    "Here is the big set of char and misc driver patches for 4.21-rc1.

    Lots of different types of driver things in here, as this tree seems
    to be the "collection of various driver subsystems not big enough to
    have their own git tree" lately.

    Anyway, some highlights of the changes in here:

    - binderfs: is it a rule that all driver subsystems will eventually
    grow to have their own filesystem? Binder now has one to handle the
    use of it in containerized systems.

    This was discussed at the Plumbers conference a few months ago and
    knocked into mergable shape very fast by Christian Brauner. Who
    also has signed up to be another binder maintainer, showing a
    distinct lack of good judgement :)

    - binder updates and fixes

    - mei driver updates

    - fpga driver updates and additions

    - thunderbolt driver updates

    - soundwire driver updates

    - extcon driver updates

    - nvmem driver updates

    - hyper-v driver updates

    - coresight driver updates

    - pvpanic driver additions and reworking for more device support

    - lp driver updates. Yes really, it's _finally_ moved to the proper
    parallal port driver model, something I never thought I would see
    happen. Good stuff.

    - other tiny driver updates and fixes.

    All of these have been in linux-next for a while with no reported
    issues"

    * tag 'char-misc-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (116 commits)
    MAINTAINERS: add another Android binder maintainer
    intel_th: msu: Fix an off-by-one in attribute store
    stm class: Add a reference to the SyS-T document
    stm class: Fix a module refcount leak in policy creation error path
    char: lp: use new parport device model
    char: lp: properly count the lp devices
    char: lp: use first unused lp number while registering
    char: lp: detach the device when parallel port is removed
    char: lp: introduce list to save port number
    bus: qcom: remove duplicated include from qcom-ebi2.c
    VMCI: Use memdup_user() rather than duplicating its implementation
    char/rtc: Use of_node_name_eq for node name comparisons
    misc: mic: fix a DMA pool free failure
    ptp: fix an IS_ERR() vs NULL check
    genwqe: Fix size check
    binder: implement binderfs
    binder: fix use-after-free due to ksys_close() during fdget()
    bus: fsl-mc: remove duplicated include files
    bus: fsl-mc: explicitly define the fsl_mc_command endianness
    misc: ti-st: make array read_ver_cmd static, shrinks object size
    ...

    Linus Torvalds
     

11 Dec, 2018

1 commit

  • This fixes the problem where uio application was unable to
    use multple queues on restart. The root cause is that the callbacks
    are cleared on disconnect. Change to setting up callbacks
    everytime in open.

    Fixes: cdfa835c6e5e ("uio_hv_generic: defer opening vmbus until first use")
    Reported-by: Mohammed Gamal
    Signed-off-by: Stephen Hemminger
    Signed-off-by: Greg Kroah-Hartman

    Stephen Hemminger
     

27 Nov, 2018

1 commit


26 Nov, 2018

1 commit


12 Nov, 2018

2 commits

  • We should get 'driver_data' from 'struct device' directly. Going via
    platform_device is an unneeded step back and forth.

    Signed-off-by: Wolfram Sang
    Signed-off-by: Greg Kroah-Hartman

    Wolfram Sang
     
  • I was trying to solve a double free but I introduced a more serious
    NULL dereference bug. The problem is that if there is an IRQ which
    triggers immediately, then we need "info->uio_dev" but it's not set yet.

    This patch puts the original initialization back to how it was and just
    sets info->uio_dev to NULL on the error path so it should solve both
    the Oops and the double free.

    Fixes: f019f07ecf6a ("uio: potential double frees if __uio_register_device() fails")
    Reported-by: Mathias Thore
    Signed-off-by: Dan Carpenter
    Cc: stable
    Tested-by: Mathias Thore
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     

03 Oct, 2018

2 commits


26 Sep, 2018

4 commits

  • This fixes two design flaws in hv_uio_generic.

    Since hv_uio_probe is called from vmbus_probe with lock held
    it potentially can cause sleep in an atomic section because
    vmbus_open will wait for response from host.

    The hv_uio_generic driver could not handle applications
    exiting and restarting because the vmbus channel was
    persistent. Change the semantics so that the buffers are
    allocated on probe, but not attached to host until
    device is opened.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: Greg Kroah-Hartman

    Stephen Hemminger
     
  • The ring buffer is contiguous IOVA and is mapped via phys addr
    for sysfs file. Use same method for the UIO mapping.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: Greg Kroah-Hartman

    Stephen Hemminger
     
  • Introduce the concept of mapping physical memory locations that
    are normal memory. The new type UIO_MEM_IOVA are similar to
    existing UIO_MEM_PHYS but the backing memory is not marked as uncached.

    Also, indent related switch to the currently used style.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: Greg Kroah-Hartman

    Stephen Hemminger
     
  • Avoid going from struct page to virt address (and back) by just
    keeping pointer to the allocated pages instead of virt address.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: Greg Kroah-Hartman

    Stephen Hemminger
     

12 Sep, 2018

5 commits

  • As part of commit 9b85e95a3080 ("uio: Change return
    type to vm_fault_t") in 4.19-rc1, this conversion
    was missed. Now converted 'ret' to vm_fault_t type.

    Signed-off-by: Souptick Joarder
    Signed-off-by: Greg Kroah-Hartman

    Souptick Joarder
     
  • In preparation to remove the node name pointer from struct device_node,
    convert printf users to use the %pOFn format specifier.

    Cc: Greg Kroah-Hartman
    Signed-off-by: Rob Herring
    Signed-off-by: Greg Kroah-Hartman

    Rob Herring
     
  • When both uio and the uio drivers are built in the kernel, it is possible
    for a driver to register devices before the uio class is registered.

    This may result in a NULL pointer dereference later on in
    get_device_parent() when accessing the class glue_dirs spinlock.

    The trace looks like that:

    Unable to handle kernel NULL pointer dereference at virtual address 00000140
    [...]
    [] _raw_spin_lock+0x14/0x48
    [] device_add+0x154/0x6a0
    [] device_create_groups_vargs+0x120/0x128
    [] device_create+0x54/0x60
    [] __uio_register_device+0x120/0x4a8
    [] jaguar2_pci_probe+0x2d4/0x558
    [] local_pci_probe+0x3c/0xb8
    [] pci_device_probe+0x11c/0x180
    [] driver_probe_device+0x22c/0x2d8
    [] __driver_attach+0xbc/0xc0
    [] bus_for_each_dev+0x4c/0x98
    [] driver_attach+0x20/0x28
    [] bus_add_driver+0x1b8/0x228
    [] driver_register+0x60/0xf8
    [] __pci_register_driver+0x40/0x48

    Return EPROBE_DEFER in that case so the driver can register the device
    later.

    Signed-off-by: Alexandre Belloni
    Signed-off-by: Greg Kroah-Hartman

    Alexandre Belloni
     
  • DEBUG is leftover from the development phase, remove it.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Stephen Hemminger
     
  • When using DPDK there is significant performance boost by using
    the largest possible send and receive buffer area.

    Unfortunately, with UIO model there is not a good way to configure
    this at run time. But it is okay to have a bigger buffer available
    even if application only decides to use a smaller piece of it.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: K. Y. Srinivasan
    Signed-off-by: Greg Kroah-Hartman

    Stephen Hemminger
     

20 Aug, 2018

1 commit

  • Pull UIO fix from Greg KH:
    "Here is a single UIO fix that I forgot to send before 4.18-final came
    out. It reverts a UIO patch that went in the 4.18 development window
    that was causing problems.

    This patch has been in linux-next for a while with no problems, I just
    forgot to send it earlier, or as part of the larger char/misc patch
    series from yesterday, my fault"

    * tag 'char-misc-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
    Revert "uio: use request_threaded_irq instead"

    Linus Torvalds
     

12 Aug, 2018

1 commit

  • Since mutex lock in irq hanler is useless currently, here will
    remove it together with it.

    This reverts commit 9421e45f5ff3d558cf8b75a8cc0824530caf3453.

    Reported-by: james.r.harris@intel.com
    CC: Ahsan Atta
    Signed-off-by: Xiubo Li
    Signed-off-by: Greg Kroah-Hartman

    Xiubo Li
     

02 Aug, 2018

1 commit

  • The uio_unregister_device() function assumes that if "info->uio_dev" is
    non-NULL that means "info" is fully allocated. Setting info->uio_de
    has to be the last thing in the function.

    In the current code, if request_threaded_irq() fails then we return with
    info->uio_dev set to non-NULL but info is not fully allocated and it can
    lead to double frees.

    Fixes: beafc54c4e2f ("UIO: Add the User IO core code")
    Signed-off-by: Dan Carpenter
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter