18 Mar, 2020

4 commits

  • This adds support for the Trace Hub in Elkhart Lake CPU.

    Signed-off-by: Alexander Shishkin
    Reviewed-by: Andy Shevchenko
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20200317062215.15598-7-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin
     
  • There are a few places in the driver that end up returning ENOTSUPP to
    the user, replace those with EINVAL.

    Signed-off-by: Alexander Shishkin
    Reviewed-by: Andy Shevchenko
    Fixes: ba82664c134ef ("intel_th: Add Memory Storage Unit driver")
    Cc: stable@vger.kernel.org # v4.4+
    Link: https://lore.kernel.org/r/20200317062215.15598-6-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin
     
  • The unexpected state warning should only warn on illegal state
    transitions. Fix that.

    Signed-off-by: Alexander Shishkin
    Reviewed-by: Andy Shevchenko
    Fixes: 615c164da0eb4 ("intel_th: msu: Introduce buffer interface")
    Cc: stable@vger.kernel.org # v5.4+
    Link: https://lore.kernel.org/r/20200317062215.15598-5-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin
     
  • The operands of time_after() are in a wrong order in both instances in
    the sys-t driver. Fix that.

    Signed-off-by: Alexander Shishkin
    Reviewed-by: Andy Shevchenko
    Fixes: 39f10239df75 ("stm class: p_sys-t: Add support for CLOCKSYNC packets")
    Fixes: d69d5e83110f ("stm class: Add MIPI SyS-T protocol support")
    Cc: stable@vger.kernel.org # v4.20+
    Link: https://lore.kernel.org/r/20200317062215.15598-3-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin
     

14 Jan, 2020

1 commit

  • Some of the newly added code in the etm4x driver is inside of an #ifdef,
    and some other code is outside of it, leading to a harmless warning when
    CONFIG_CPU_PM is disabled:

    drivers/hwtracing/coresight/coresight-etm4x.c:68:13: error: 'etm4_os_lock' defined but not used [-Werror=unused-function]
    static void etm4_os_lock(struct etmv4_drvdata *drvdata)
    ^~~~~~~~~~~~

    To avoid the warning and simplify the the #ifdef checks, use
    IS_ENABLED() instead, so the compiler can drop the unused functions
    without complaining.

    Fixes: f188b5e76aae ("coresight: etm4x: Save/restore state across CPU low power states")
    Signed-off-by: Arnd Bergmann
    [Fixed capital 'f' in title]
    Signed-off-by: Mathieu Poirier
    Link: https://lore.kernel.org/r/20191213223107.1484-2-mathieu.poirier@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     

17 Dec, 2019

4 commits

  • Commit 6cac7866c2741 ("intel_th: msu: Add a sysfs attribute to trigger
    window switch") adds a NULL pointer dereference in the case when there are
    no windows allocated:

    > BUG: kernel NULL pointer dereference, address: 0000000000000000
    > #PF: supervisor read access in kernel mode
    > #PF: error_code(0x0000) - not-present page
    > PGD 0 P4D 0
    > Oops: 0000 1 SMP
    > CPU: 5 PID: 1110 Comm: bash Not tainted 5.5.0-rc1+ #1
    > RIP: 0010:msc_win_switch+0xa/0x80 [intel_th_msu]
    > Call Trace:
    > ? win_switch_store+0x9b/0xc0 [intel_th_msu]
    > dev_attr_store+0x17/0x30
    > sysfs_kf_write+0x3e/0x50
    > kernfs_fop_write+0xda/0x1b0
    > __vfs_write+0x1b/0x40
    > vfs_write+0xb9/0x1a0
    > ksys_write+0x67/0xe0
    > __x64_sys_write+0x1a/0x20
    > do_syscall_64+0x57/0x1d0
    > entry_SYSCALL_64_after_hwframe+0x44/0xa9

    Fix that by disallowing window switching with multiwindow buffers without
    windows.

    Signed-off-by: Alexander Shishkin
    Fixes: 6cac7866c274 ("intel_th: msu: Add a sysfs attribute to trigger window switch")
    Reviewed-by: Andy Shevchenko
    Reported-by: Ammy Yi
    Tested-by: Ammy Yi
    Cc: stable@vger.kernel.org # v5.2+
    Link: https://lore.kernel.org/r/20191217115527.74383-5-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin
     
  • Commit aac8da65174a ("intel_th: msu: Start handling IRQs") implicitly
    relies on the use of devm_request_irq() to subsequently free the irqs on
    device removal, but in case of the pci_free_irq_vectors() API, the
    handlers need to be freed before it is called. Therefore, at the moment
    the driver's remove path trips a BUG_ON(irq_has_action()):

    > kernel BUG at drivers/pci/msi.c:375!
    > invalid opcode: 0000 1 SMP
    > CPU: 2 PID: 818 Comm: rmmod Not tainted 5.5.0-rc1+ #1
    > RIP: 0010:free_msi_irqs+0x67/0x1c0
    > pci_disable_msi+0x116/0x150
    > pci_free_irq_vectors+0x1b/0x20
    > intel_th_pci_remove+0x22/0x30 [intel_th_pci]
    > pci_device_remove+0x3e/0xb0
    > device_release_driver_internal+0xf0/0x1c0
    > driver_detach+0x4c/0x8f
    > bus_remove_driver+0x5c/0xd0
    > driver_unregister+0x31/0x50
    > pci_unregister_driver+0x40/0x90
    > intel_th_pci_driver_exit+0x10/0xad6 [intel_th_pci]
    > __x64_sys_delete_module+0x147/0x290
    > ? exit_to_usermode_loop+0xd7/0x120
    > do_syscall_64+0x57/0x1b0
    > entry_SYSCALL_64_after_hwframe+0x44/0xa9

    Fix this by explicitly freeing irqs before freeing the vectors. We keep
    using the devm_* variants because they are still useful in early error
    paths.

    Signed-off-by: Alexander Shishkin
    Reviewed-by: Andy Shevchenko
    Fixes: aac8da65174a ("intel_th: msu: Start handling IRQs")
    Reported-by: Ammy Yi
    Tested-by: Ammy Yi
    Cc: stable@vger.kernel.org # v5.2+
    Link: https://lore.kernel.org/r/20191217115527.74383-4-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin
     
  • This adds support for Intel Trace Hub in Elkhart Lake.

    Signed-off-by: Alexander Shishkin
    Reviewed-by: Andy Shevchenko
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20191217115527.74383-3-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin
     
  • This adds Intel(R) Trace Hub PCI ID for Comet Lake PCH-V.

    Signed-off-by: Alexander Shishkin
    Reviewed-by: Andy Shevchenko
    Cc:
    Link: https://lore.kernel.org/r/20191217115527.74383-2-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin
     

02 Dec, 2019

1 commit

  • Pull removal of most of fs/compat_ioctl.c from Arnd Bergmann:
    "As part of the cleanup of some remaining y2038 issues, I came to
    fs/compat_ioctl.c, which still has a couple of commands that need
    support for time64_t.

    In completely unrelated work, I spent time on cleaning up parts of
    this file in the past, moving things out into drivers instead.

    After Al Viro reviewed an earlier version of this series and did a lot
    more of that cleanup, I decided to try to completely eliminate the
    rest of it and move it all into drivers.

    This series incorporates some of Al's work and many patches of my own,
    but in the end stops short of actually removing the last part, which
    is the scsi ioctl handlers. I have patches for those as well, but they
    need more testing or possibly a rewrite"

    * tag 'compat-ioctl-5.5' of git://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground: (42 commits)
    scsi: sd: enable compat ioctls for sed-opal
    pktcdvd: add compat_ioctl handler
    compat_ioctl: move SG_GET_REQUEST_TABLE handling
    compat_ioctl: ppp: move simple commands into ppp_generic.c
    compat_ioctl: handle PPPIOCGIDLE for 64-bit time_t
    compat_ioctl: move PPPIOCSCOMPRESS to ppp_generic
    compat_ioctl: unify copy-in of ppp filters
    tty: handle compat PPP ioctls
    compat_ioctl: move SIOCOUTQ out of compat_ioctl.c
    compat_ioctl: handle SIOCOUTQNSD
    af_unix: add compat_ioctl support
    compat_ioctl: reimplement SG_IO handling
    compat_ioctl: move WDIOC handling into wdt drivers
    fs: compat_ioctl: move FITRIM emulation into file systems
    gfs2: add compat_ioctl support
    compat_ioctl: remove unused convert_in_user macro
    compat_ioctl: remove last RAID handling code
    compat_ioctl: remove /dev/raw ioctl translation
    compat_ioctl: remove PCI ioctl translation
    compat_ioctl: remove joystick ioctl translation
    ...

    Linus Torvalds
     

20 Nov, 2019

5 commits

  • This adds support for the Trace Hub in Tiger Lake CPU.

    Signed-off-by: Alexander Shishkin
    Reviewed-by: Andy Shevchenko
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20191120130806.44028-4-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin
     
  • This adds support for the Trace Hub in Ice Lake CPU.

    Signed-off-by: Alexander Shishkin
    Reviewed-by: Andy Shevchenko
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20191120130806.44028-3-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin
     
  • Commit a753bfcfdb1f ("intel_th: Make the switch allocate its subdevices")
    factored out intel_th_subdevice_alloc() from intel_th_populate(), but got
    the error path wrong, resulting in two instances of a double put_device()
    on a freshly initialized, but not 'added' device.

    Fix this by only doing one put_device() in the error path.

    Signed-off-by: Alexander Shishkin
    Fixes: a753bfcfdb1f ("intel_th: Make the switch allocate its subdevices")
    Reported-by: Wen Yang
    Reviewed-by: Andy Shevchenko
    Cc: stable@vger.kernel.org # v4.14+
    Link: https://lore.kernel.org/r/20191120130806.44028-2-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin
     
  • The driver allocates the spinlock but not initialize it.
    Use spin_lock_init() on it to initialize it correctly.

    This is detected by Coccinelle semantic patch.

    Signed-off-by: Wei Yongjun
    Tested-by: Yabin Cui
    Signed-off-by: Mathieu Poirier
    Link: https://lore.kernel.org/r/20191118185207.30441-3-mathieu.poirier@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Wei Yongjun
     
  • The driver allocates the spinlock but not initialize it.
    Use spin_lock_init() on it to initialize it correctly.

    This is detected by Coccinelle semantic patch.

    Signed-off-by: Wei Yongjun
    Tested-by: Yabin Cui
    Signed-off-by: Mathieu Poirier
    Link: https://lore.kernel.org/r/20191118185207.30441-2-mathieu.poirier@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Wei Yongjun
     

14 Nov, 2019

1 commit

  • Commit c7fd62bc69d02 ("stm class: Introduce framing protocol drivers")
    forgot to tear down the link between an stm device and its protocol
    driver when policy is removed. This leads to an invalid pointer reference
    if one tries to write to an stm device after the policy has been removed
    and the protocol driver module unloaded, leading to the below splat:

    > BUG: unable to handle page fault for address: ffffffffc0737068
    > #PF: supervisor read access in kernel mode
    > #PF: error_code(0x0000) - not-present page
    > PGD 3d780f067 P4D 3d780f067 PUD 3d7811067 PMD 492781067 PTE 0
    > Oops: 0000 [#1] SMP NOPTI
    > CPU: 1 PID: 26122 Comm: cat Not tainted 5.4.0-rc5+ #1
    > RIP: 0010:stm_output_free+0x40/0xc0 [stm_core]
    > Call Trace:
    > stm_char_release+0x3e/0x70 [stm_core]
    > __fput+0xc6/0x260
    > ____fput+0xe/0x10
    > task_work_run+0x9d/0xc0
    > exit_to_usermode_loop+0x103/0x110
    > do_syscall_64+0x19d/0x1e0
    > entry_SYSCALL_64_after_hwframe+0x44/0xa9

    Fix this by tearing down the link from an stm device to its protocol
    driver when the policy involving that driver is removed.

    Signed-off-by: Alexander Shishkin
    Fixes: c7fd62bc69d02 ("stm class: Introduce framing protocol drivers")
    Reported-by: Ammy Yi
    Tested-by: Ammy Yi
    CC: stable@vger.kernel.org # v4.20+
    Link: https://lore.kernel.org/r/20191114064201.43089-2-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin
     

11 Nov, 2019

1 commit


05 Nov, 2019

13 commits

  • The second argument should be the lsb and the third argument should be
    the msb.

    Signed-off-by: Rikard Falkeborn
    Signed-off-by: Mathieu Poirier
    Link: https://lore.kernel.org/r/20191104181251.26732-15-mathieu.poirier@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Rikard Falkeborn
     
  • When tracing etm data of multiple threads on multiple cpus through perf
    interface, some link devices are shared between paths of different cpus.
    It creates race conditions when different cpus wants to enable/disable
    the same link device at the same time.

    Example 1:
    Two cpus want to enable different ports of a coresight funnel, thus
    calling the funnel enable operation at the same time. But the funnel
    enable operation isn't reentrantable.

    Example 2:
    For an enabled coresight dynamic replicator with refcnt=1, one cpu wants
    to disable it, while another cpu wants to enable it. Ideally we still have
    an enabled replicator with refcnt=1 at the end. But in reality the result
    is uncertain.

    Since coresight devices claim themselves when enabled for self-hosted
    usage, the race conditions above usually make the link devices not usable
    after many cycles.

    To fix the race conditions, this patch uses spinlocks to serialize
    enabling/disabling link devices.

    Fixes: a06ae8609b3d ("coresight: add CoreSight core layer framework")
    Signed-off-by: Yabin Cui
    Signed-off-by: Mathieu Poirier
    Cc: stable # 5.3
    Link: https://lore.kernel.org/r/20191104181251.26732-14-mathieu.poirier@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Yabin Cui
     
  • Coresight hardware is only likely to appear on Arm systems and currently
    the core code has Arm-specific barrier operations in it so can't be
    built anywhere else so add an explicit dependency saying so. This will
    make no practical difference currently due to the way subsystems are
    referenced, the subsystem is only pulled in on arm and arm64, so mainly
    serves as documentation in case someone wants to increase build
    coverage.

    Signed-off-by: Mark Brown
    Signed-off-by: Mathieu Poirier
    Link: https://lore.kernel.org/r/20191104181251.26732-13-mathieu.poirier@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Mark Brown
     
  • An API to control single-shot comparator operation was missing from sysfs.
    This adds the parameters to sysfs to allow programming of this feature.

    Signed-off-by: Mike Leach
    Signed-off-by: Mathieu Poirier
    Link: https://lore.kernel.org/r/20191104181251.26732-12-mathieu.poirier@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Mike Leach
     
  • Currently it is not possible to view the current settings of a given
    address comparator without knowing what type it is set to. For example, if
    a comparator is set as an addr_start comparator, attempting to read
    addr_stop for the same index will result in an error.

    addr_cmp_view is added to allow the user to see the current settings of
    the indexed address comparator without resorting to trial and error when
    the set type is not known.

    Signed-off-by: Mike Leach
    Reviewed-by: Leo Yan
    Signed-off-by: Mathieu Poirier
    Link: https://lore.kernel.org/r/20191104181251.26732-11-mathieu.poirier@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Mike Leach
     
  • Context ID and VM ID masks required 2 value inputs, even when the
    second value is ignored as insufficient CID / VMID comparators are
    implemented.

    Permit a single value to be used if that is sufficient to cover all
    implemented comparators.

    Signed-off-by: Mike Leach
    Signed-off-by: Mathieu Poirier
    Link: https://lore.kernel.org/r/20191104181251.26732-10-mathieu.poirier@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Mike Leach
     
  • Setting include / exclude on a range had to be done by setting
    the bit in 'mode' before setting the range. However, setting this
    bit also had the effect of altering the current range as well.

    Changed to only set include / exclude setting of a range at the point of
    setting that range. Either use a 3rd input parameter as the include exclude
    value, or if not present use the current value of 'mode'. Do not change
    current range when 'mode' changes.

    Signed-off-by: Mike Leach
    Signed-off-by: Mathieu Poirier
    Link: https://lore.kernel.org/r/20191104181251.26732-9-mathieu.poirier@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Mike Leach
     
  • Fixes the following issues when using the ETMv4 start-stop logic.

    1) Setting a start or a stop address should not automatically set the
    start-stop status to 'on'. The value set by the user in 'mode' must
    be respected or start instances could be missed.
    2) Missing API for controlling TRCVIPCSSCTLR - start stop control by
    PE comparators.
    3) Default ETM configuration sets a trace all range, and correctly sets
    the start-stop status bit. This was not being correctly reflected in
    the 'mode' parameter.

    Signed-off-by: Mike Leach
    Signed-off-by: Mathieu Poirier
    Link: https://lore.kernel.org/r/20191104181251.26732-8-mathieu.poirier@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Mike Leach
     
  • TRCACATRn registers have match bits for secure and non-secure exception
    levels which are not accessible by the sysfs API.
    This adds a new sysfs parameter to enable this - addr_exlevel_s_ns.

    Signed-off-by: Mike Leach
    Reviewed-by: Suzuki K Poulose
    Signed-off-by: Mathieu Poirier
    Link: https://lore.kernel.org/r/20191104181251.26732-7-mathieu.poirier@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Mike Leach
     
  • A number of issues are fixed relating to sysfs input validation:-

    1) bb_ctrl_store() - incorrect compare of bit select field to absolute
    value. Reworked per ETMv4 specification.
    2) seq_event_store() - incorrect mask value - register has two
    event values.
    3) cyc_threshold_store() - must mask with max before checking min
    otherwise wrapped values can set illegal value below min.
    4) res_ctrl_store() - update to mask off all res0 bits.

    Reviewed-by: Leo Yan
    Reviewed-by: Mathieu Poirier
    Signed-off-by: Mike Leach
    Fixes: a77de2637c9eb ("coresight: etm4x: moving sysFS entries to a dedicated file")
    Cc: stable # 4.9+
    Signed-off-by: Mathieu Poirier
    Link: https://lore.kernel.org/r/20191104181251.26732-6-mathieu.poirier@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Mike Leach
     
  • ETMv4.4 adds in support for tracing secure EL2 (per arch 8.x updates).
    Patch accounts for this new capability.

    Signed-off-by: Mike Leach
    Reviewed-by: Leo Yan
    Signed-off-by: Mathieu Poirier
    Link: https://lore.kernel.org/r/20191104181251.26732-5-mathieu.poirier@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Mike Leach
     
  • Add ETMv4 periperhal ID for Marvell's ThunderX2 chip.
    This chip contains ETMv4.1 version.

    Signed-off-by: Tanmay Vilas Kumar Jagdale
    Signed-off-by: Mathieu Poirier
    Link: https://lore.kernel.org/r/20191104181251.26732-4-mathieu.poirier@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Tanmay Vilas Kumar Jagdale
     
  • Some hardware will ignore bit TRCPDCR.PU which is used to signal
    to hardware that power should not be removed from the trace unit.
    Let's mitigate against this by conditionally saving and restoring
    the trace unit state when the CPU enters low power states.

    This patchset introduces a firmware property named
    'arm,coresight-loses-context-with-cpu' - when this is present the
    hardware state will be conditionally saved and restored.

    A module parameter 'pm_save_enable' is also introduced which can
    be configured to override the firmware property. This can be set
    to never allow save/restore or to conditionally allow it (only for
    self-hosted). The default value is determined by firmware.

    We avoid saving the hardware state when self-hosted coresight isn't
    in use to reduce PM latency - we can't determine this by reading the
    claim tags (TRCCLAIMCLR) as these are 'trace' registers which need
    power and clocking, something we can't easily provide in the PM
    context. Therefore we rely on the existing drvdata->mode internal
    state that is set when self-hosted coresight is used (and powered).

    Signed-off-by: Andrew Murray
    Reviewed-by: Suzuki K Poulose
    Signed-off-by: Mathieu Poirier
    Link: https://lore.kernel.org/r/20191104181251.26732-2-mathieu.poirier@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    Andrew Murray
     

04 Nov, 2019

7 commits

  • This adds support for Intel TH on Jasper Lake PCH.

    Signed-off-by: Alexander Shishkin
    Reviewed-by: Andy Shevchenko
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20191028070651.9770-8-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin
     
  • This adds support for Intel TH on Comet Lake PCH.

    Signed-off-by: Alexander Shishkin
    Reviewed-by: Andy Shevchenko
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20191028070651.9770-7-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin
     
  • 'mode' is malloced in mode_store() and should be freed before leaving
    from the error handling cases, otherwise it will cause memory leak.

    Fixes: 615c164da0eb ("intel_th: msu: Introduce buffer interface")
    Signed-off-by: Wei Yongjun
    Signed-off-by: Alexander Shishkin
    Reviewed-by: Andy Shevchenko
    Link: https://lore.kernel.org/lkml/20190801013825.182543-1-weiyongjun1@huawei.com/
    Link: https://lore.kernel.org/r/20191028070651.9770-6-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Wei Yongjun
     
  • The shift of the unsigned int win->nr_blocks by PAGE_SHIFT may
    potentially overflow. Note that the intended return of this shift
    is expected to be a size_t however the shift is being performed as
    an unsigned int. Fix this by casting win->nr_blocks to a size_t
    before performing the shift.

    Addresses-Coverity: ("Unintentional integer overflow")
    Fixes: 615c164da0eb ("intel_th: msu: Introduce buffer interface")
    Signed-off-by: Colin Ian King
    Signed-off-by: Alexander Shishkin
    Reviewed-by: Andy Shevchenko
    Link: https://lore.kernel.org/lkml/20190726113151.8967-1-colin.king@canonical.com/
    Link: https://lore.kernel.org/r/20191028070651.9770-5-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Colin Ian King
     
  • Commit 615c164da0eb ("intel_th: msu: Introduce buffer interface") forgot
    to add a NULL pointer check for the value returned from kstrdup(), which
    will be troublesome if the allocation fails.

    Fix that by adding the check.

    Addresses-Coverity: ("Dereference null return")
    Fixes: 615c164da0eb ("intel_th: msu: Introduce buffer interface")
    Signed-off-by: Colin Ian King
    [alexander.shishkin: amended the commit message]
    Signed-off-by: Alexander Shishkin
    Reviewed-by: Andy Shevchenko
    Link: https://lore.kernel.org/lkml/20190726120421.9650-1-colin.king@canonical.com/
    Link: https://lore.kernel.org/r/20191028070651.9770-4-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Colin Ian King
     
  • Commit 615c164da0eb ("intel_th: msu: Introduce buffer interface") added a
    mutex that it forgot to initialize, resulting in a lockdep splat.

    Fix that by initializing the mutex statically.

    Signed-off-by: Alexander Shishkin
    Reviewed-by: Andy Shevchenko
    Fixes: 615c164da0eb ("intel_th: msu: Introduce buffer interface")
    Link: https://lore.kernel.org/r/20191028070651.9770-3-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin
     
  • Commit 8116db57cf16 ("intel_th: Add switch triggering support") added
    a trigger assertion of the CTS, but forgot to de-assert it at the end
    of the sequence. This results in window switches randomly not happening.

    Fix that by de-asserting the trigger at the end of the window switch
    sequence.

    Signed-off-by: Alexander Shishkin
    Reviewed-by: Andy Shevchenko
    Fixes: 8116db57cf16 ("intel_th: Add switch triggering support")
    Cc: stable
    Link: https://lore.kernel.org/r/20191028070651.9770-2-alexander.shishkin@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin
     

23 Oct, 2019

1 commit

  • Each of these drivers has a copy of the same trivial helper function to
    convert the pointer argument and then call the native ioctl handler.

    We now have a generic implementation of that, so use it.

    Acked-by: Greg Kroah-Hartman
    Acked-by: Michael S. Tsirkin
    Acked-by: David S. Miller
    Acked-by: Jarkko Sakkinen
    Reviewed-by: Jarkko Sakkinen
    Reviewed-by: Jason Gunthorpe
    Reviewed-by: Jiri Kosina
    Reviewed-by: Stefan Hajnoczi
    Reviewed-by: Cornelia Huck
    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     

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
     

18 Sep, 2019

1 commit

  • …anaszewski/linux-leds

    Pull LED updates from Jacek Anaszewski:
    "In this cycle we've finally managed to contribute the patch set
    sorting out LED naming issues. Besides that there are many changes
    scattered among various LED class drivers and triggers.

    LED naming related improvements:

    - add new 'function' and 'color' fwnode properties and deprecate
    'label' property which has been frequently abused for conveying
    vendor specific names that have been available in sysfs anyway

    - introduce a set of standard LED_FUNCTION* definitions

    - introduce a set of standard LED_COLOR_ID* definitions

    - add a new {devm_}led_classdev_register_ext() API with the
    capability of automatic LED name composition basing on the
    properties available in the passed fwnode; the function is
    backwards compatible in a sense that it uses 'label' data, if
    present in the fwnode, for creating LED name

    - add tools/leds/get_led_device_info.sh script for retrieving LED
    vendor, product and bus names, if applicable; it also performs
    basic validation of an LED name

    - update following drivers and their DT bindings to use the new LED
    registration API:

    - leds-an30259a, leds-gpio, leds-as3645a, leds-aat1290, leds-cr0014114,
    leds-lm3601x, leds-lm3692x, leds-lp8860, leds-lt3593, leds-sc27xx-blt

    Other LED class improvements:

    - replace {devm_}led_classdev_register() macros with inlines

    - allow to call led_classdev_unregister() unconditionally

    - switch to use fwnode instead of be stuck with OF one

    LED triggers improvements:

    - led-triggers:
    - fix dereferencing of null pointer
    - fix a memory leak bug

    - ledtrig-gpio:
    - GPIO 0 is valid

    Drop superseeded apu2/3 support from leds-apu since for apu2+ a newer,
    more complete driver exists, based on a generic driver for the AMD
    SOCs gpio-controller, supporting LEDs as well other devices:

    - drop profile field from priv data

    - drop iosize field from priv data

    - drop enum_apu_led_platform_types

    - drop superseeded apu2/3 led support

    - add pr_fmt prefix for better log output

    - fix error message on probing failure

    Other misc fixes and improvements to existing LED class drivers:

    - leds-ns2, leds-max77650:
    - add of_node_put() before return

    - leds-pwm, leds-is31fl32xx:
    - use struct_size() helper

    - leds-lm3697, leds-lm36274, leds-lm3532:
    - switch to use fwnode_property_count_uXX()

    - leds-lm3532:
    - fix brightness control for i2c mode
    - change the define for the fs current register
    - fixes for the driver for stability
    - add full scale current configuration
    - dt: Add property for full scale current.
    - avoid potentially unpaired regulator calls
    - move static keyword to the front of declarations
    - fix optional led-max-microamp prop error handling

    - leds-max77650:
    - add of_node_put() before return
    - add MODULE_ALIAS()
    - Switch to fwnode property API

    - leds-as3645a:
    - fix misuse of strlcpy

    - leds-netxbig:
    - add of_node_put() in netxbig_leds_get_of_pdata()
    - remove legacy board-file support

    - leds-is31fl319x:
    - simplify getting the adapter of a client

    - leds-ti-lmu-common:
    - fix coccinelle issue
    - move static keyword to the front of declaration

    - leds-syscon:
    - use resource managed variant of device register

    - leds-ktd2692:
    - fix a typo in the name of a constant

    - leds-lp5562:
    - allow firmware files up to the maximum length

    - leds-an30259a:
    - fix typo

    - leds-pca953x:
    - include the right header"

    * tag 'leds-for-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds: (72 commits)
    leds: lm3532: Fix optional led-max-microamp prop error handling
    led: triggers: Fix dereferencing of null pointer
    leds: ti-lmu-common: Move static keyword to the front of declaration
    leds: lm3532: Move static keyword to the front of declarations
    leds: trigger: gpio: GPIO 0 is valid
    leds: pwm: Use struct_size() helper
    leds: is31fl32xx: Use struct_size() helper
    leds: ti-lmu-common: Fix coccinelle issue in TI LMU
    leds: lm3532: Avoid potentially unpaired regulator calls
    leds: syscon: Use resource managed variant of device register
    leds: Replace {devm_}led_classdev_register() macros with inlines
    leds: Allow to call led_classdev_unregister() unconditionally
    leds: lm3532: Add full scale current configuration
    dt: lm3532: Add property for full scale current.
    leds: lm3532: Fixes for the driver for stability
    leds: lm3532: Change the define for the fs current register
    leds: lm3532: Fix brightness control for i2c mode
    leds: Switch to use fwnode instead of be stuck with OF one
    leds: max77650: Switch to fwnode property API
    led: triggers: Fix a memory leak bug
    ...

    Linus Torvalds