1. 21 Apr, 2020 29 commits
  2. 17 Apr, 2020 11 commits
    • Greg Kroah-Hartman's avatar
      Linux 4.19.116 · 8488c3f3
      Greg Kroah-Hartman authored
      8488c3f3
    • Gary Lin's avatar
      efi/x86: Fix the deletion of variables in mixed mode · 94fe9e44
      Gary Lin authored
      [ Upstream commit a4b81ccf ]
      
      efi_thunk_set_variable() treated the NULL "data" pointer as an invalid
      parameter, and this broke the deletion of variables in mixed mode.
      This commit fixes the check of data so that the userspace program can
      delete a variable in mixed mode.
      
      Fixes: 8319e9d5 ("efi/x86: Handle by-ref arguments covering multiple pages in mixed mode")
      Signed-off-by: default avatarGary Lin <glin@suse.com>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Link: https://lore.kernel.org/r/20200408081606.1504-1-glin@suse.com
      Link: https://lore.kernel.org/r/20200409130434.6736-9-ardb@kernel.orgSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
      94fe9e44
    • Andy Shevchenko's avatar
      mfd: dln2: Fix sanity checking for endpoints · 502d8e56
      Andy Shevchenko authored
      [ Upstream commit fb945c95 ]
      
      While the commit 2b8bd606 ("mfd: dln2: More sanity checking for endpoints")
      tries to harden the sanity checks it made at the same time a regression,
      i.e.  mixed in and out endpoints. Obviously it should have been not tested on
      real hardware at that time, but unluckily it didn't happen.
      
      So, fix above mentioned typo and make device being enumerated again.
      
      While here, introduce an enumerator for magic values to prevent similar issue
      to happen in the future.
      
      Fixes: 2b8bd606 ("mfd: dln2: More sanity checking for endpoints")
      Cc: Oliver Neukum <oneukum@suse.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      502d8e56
    • Christian Gmeiner's avatar
      etnaviv: perfmon: fix total and idle HI cyleces readout · 04fe2fbd
      Christian Gmeiner authored
      [ Upstream commit 15ff4a7b ]
      
      As seen at CodeAurora's linux-imx git repo in imx_4.19.35_1.0.0 branch.
      Signed-off-by: default avatarChristian Gmeiner <christian.gmeiner@gmail.com>
      Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      04fe2fbd
    • Nathan Chancellor's avatar
      misc: echo: Remove unnecessary parentheses and simplify check for zero · bbff44d6
      Nathan Chancellor authored
      [ Upstream commit 85dc2c65 ]
      
      Clang warns when multiple pairs of parentheses are used for a single
      conditional statement.
      
      drivers/misc/echo/echo.c:384:27: warning: equality comparison with
      extraneous parentheses [-Wparentheses-equality]
              if ((ec->nonupdate_dwell == 0)) {
                   ~~~~~~~~~~~~~~~~~~~~^~~~
      drivers/misc/echo/echo.c:384:27: note: remove extraneous parentheses
      around the comparison to silence this warning
              if ((ec->nonupdate_dwell == 0)) {
                  ~                    ^   ~
      drivers/misc/echo/echo.c:384:27: note: use '=' to turn this equality
      comparison into an assignment
              if ((ec->nonupdate_dwell == 0)) {
                                       ^~
                                       =
      1 warning generated.
      
      Remove them and while we're at it, simplify the zero check as '!var' is
      used more than 'var == 0'.
      Reported-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      bbff44d6
    • Laurentiu Tudor's avatar
      powerpc/fsl_booke: Avoid creating duplicate tlb1 entry · 87279a35
      Laurentiu Tudor authored
      [ Upstream commit aa411334 ]
      
      In the current implementation, the call to loadcam_multi() is wrapped
      between switch_to_as1() and restore_to_as0() calls so, when it tries
      to create its own temporary AS=1 TLB1 entry, it ends up duplicating
      the existing one created by switch_to_as1(). Add a check to skip
      creating the temporary entry if already running in AS=1.
      
      Fixes: d9e1831a ("powerpc/85xx: Load all early TLB entries at once")
      Cc: stable@vger.kernel.org # v4.4+
      Signed-off-by: default avatarLaurentiu Tudor <laurentiu.tudor@nxp.com>
      Acked-by: default avatarScott Wood <oss@buserror.net>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20200123111914.2565-1-laurentiu.tudor@nxp.comSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
      87279a35
    • Masami Hiramatsu's avatar
      ftrace/kprobe: Show the maxactive number on kprobe_events · 52f1c425
      Masami Hiramatsu authored
      [ Upstream commit 6a13a0d7 ]
      
      Show maxactive parameter on kprobe_events.
      This allows user to save the current configuration and
      restore it without losing maxactive parameter.
      
      Link: http://lkml.kernel.org/r/4762764a-6df7-bc93-ed60-e336146dce1f@gmail.com
      Link: http://lkml.kernel.org/r/158503528846.22706.5549974121212526020.stgit@devnote2
      
      Cc: stable@vger.kernel.org
      Fixes: 696ced4f ("tracing/kprobes: expose maxactive for kretprobe in kprobe_events")
      Reported-by: default avatarTaeung Song <treeze.taeung@gmail.com>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      52f1c425
    • Chris Wilson's avatar
      drm: Remove PageReserved manipulation from drm_pci_alloc · 49d7fa0e
      Chris Wilson authored
      [ Upstream commit ea36ec86 ]
      
      drm_pci_alloc/drm_pci_free are very thin wrappers around the core dma
      facilities, and we have no special reason within the drm layer to behave
      differently. In particular, since
      
      commit de09d31d
      Author: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Date:   Fri Jan 15 16:51:42 2016 -0800
      
          page-flags: define PG_reserved behavior on compound pages
      
          As far as I can see there's no users of PG_reserved on compound pages.
          Let's use PF_NO_COMPOUND here.
      
      it has been illegal to combine GFP_COMP with SetPageReserved, so lets
      stop doing both and leave the dma layer to its own devices.
      
      Reported-by: Taketo Kabe
      Bug: https://gitlab.freedesktop.org/drm/intel/issues/1027
      Fixes: de09d31d ("page-flags: define PG_reserved behavior on compound pages")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: <stable@vger.kernel.org> # v4.5+
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200202171635.4039044-1-chris@chris-wilson.co.ukSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
      49d7fa0e
    • Lyude Paul's avatar
      drm/dp_mst: Fix clearing payload state on topology disable · a0522bbd
      Lyude Paul authored
      [ Upstream commit 8732fe46 ]
      
      The issues caused by:
      
      commit 64e62bdf ("drm/dp_mst: Remove VCPI while disabling topology
      mgr")
      
      Prompted me to take a closer look at how we clear the payload state in
      general when disabling the topology, and it turns out there's actually
      two subtle issues here.
      
      The first is that we're not grabbing &mgr.payload_lock when clearing the
      payloads in drm_dp_mst_topology_mgr_set_mst(). Seeing as the canonical
      lock order is &mgr.payload_lock -> &mgr.lock (because we always want
      &mgr.lock to be the inner-most lock so topology validation always
      works), this makes perfect sense. It also means that -technically- there
      could be racing between someone calling
      drm_dp_mst_topology_mgr_set_mst() to disable the topology, along with a
      modeset occurring that's modifying the payload state at the same time.
      
      The second is the more obvious issue that Wayne Lin discovered, that
      we're not clearing proposed_payloads when disabling the topology.
      
      I actually can't see any obvious places where the racing caused by the
      first issue would break something, and it could be that some of our
      higher-level locks already prevent this by happenstance, but better safe
      then sorry. So, let's make it so that drm_dp_mst_topology_mgr_set_mst()
      first grabs &mgr.payload_lock followed by &mgr.lock so that we never
      race when modifying the payload state. Then, we also clear
      proposed_payloads to fix the original issue of enabling a new topology
      with a dirty payload state. This doesn't clear any of the drm_dp_vcpi
      structures, but those are getting destroyed along with the ports anyway.
      
      Changes since v1:
      * Use sizeof(mgr->payloads[0])/sizeof(mgr->proposed_vcpis[0]) instead -
        vsyrjala
      
      Cc: Sean Paul <sean@poorly.run>
      Cc: Wayne Lin <Wayne.Lin@amd.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: stable@vger.kernel.org # v4.4+
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200122194321.14953-1-lyude@redhat.comSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
      a0522bbd
    • Sasha Levin's avatar
      Revert "drm/dp_mst: Remove VCPI while disabling topology mgr" · 9a61fe23
      Sasha Levin authored
      [ Upstream commit a8667596 ]
      
      This reverts commit 64e62bdf.
      
      This commit ends up causing some lockdep splats due to trying to grab the
      payload lock while holding the mgr's lock:
      
      [   54.010099]
      [   54.011765] ======================================================
      [   54.018670] WARNING: possible circular locking dependency detected
      [   54.025577] 5.5.0-rc6-02274-g77381c23ee63 #47 Not tainted
      [   54.031610] ------------------------------------------------------
      [   54.038516] kworker/1:6/1040 is trying to acquire lock:
      [   54.044354] ffff888272af3228 (&mgr->payload_lock){+.+.}, at:
      drm_dp_mst_topology_mgr_set_mst+0x218/0x2e4
      [   54.054957]
      [   54.054957] but task is already holding lock:
      [   54.061473] ffff888272af3060 (&mgr->lock){+.+.}, at:
      drm_dp_mst_topology_mgr_set_mst+0x3c/0x2e4
      [   54.071193]
      [   54.071193] which lock already depends on the new lock.
      [   54.071193]
      [   54.080334]
      [   54.080334] the existing dependency chain (in reverse order) is:
      [   54.088697]
      [   54.088697] -> #1 (&mgr->lock){+.+.}:
      [   54.094440]        __mutex_lock+0xc3/0x498
      [   54.099015]        drm_dp_mst_topology_get_port_validated+0x25/0x80
      [   54.106018]        drm_dp_update_payload_part1+0xa2/0x2e2
      [   54.112051]        intel_mst_pre_enable_dp+0x144/0x18f
      [   54.117791]        intel_encoders_pre_enable+0x63/0x70
      [   54.123532]        hsw_crtc_enable+0xa1/0x722
      [   54.128396]        intel_update_crtc+0x50/0x194
      [   54.133455]        skl_commit_modeset_enables+0x40c/0x540
      [   54.139485]        intel_atomic_commit_tail+0x5f7/0x130d
      [   54.145418]        intel_atomic_commit+0x2c8/0x2d8
      [   54.150770]        drm_atomic_helper_set_config+0x5a/0x70
      [   54.156801]        drm_mode_setcrtc+0x2ab/0x833
      [   54.161862]        drm_ioctl+0x2e5/0x424
      [   54.166242]        vfs_ioctl+0x21/0x2f
      [   54.170426]        do_vfs_ioctl+0x5fb/0x61e
      [   54.175096]        ksys_ioctl+0x55/0x75
      [   54.179377]        __x64_sys_ioctl+0x1a/0x1e
      [   54.184146]        do_syscall_64+0x5c/0x6d
      [   54.188721]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      [   54.194946]
      [   54.194946] -> #0 (&mgr->payload_lock){+.+.}:
      [   54.201463]
      [   54.201463] other info that might help us debug this:
      [   54.201463]
      [   54.210410]  Possible unsafe locking scenario:
      [   54.210410]
      [   54.217025]        CPU0                    CPU1
      [   54.222082]        ----                    ----
      [   54.227138]   lock(&mgr->lock);
      [   54.230643]                                lock(&mgr->payload_lock);
      [   54.237742]                                lock(&mgr->lock);
      [   54.244062]   lock(&mgr->payload_lock);
      [   54.248346]
      [   54.248346]  *** DEADLOCK ***
      [   54.248346]
      [   54.254959] 7 locks held by kworker/1:6/1040:
      [   54.259822]  #0: ffff888275c4f528 ((wq_completion)events){+.+.},
      at: worker_thread+0x455/0x6e2
      [   54.269451]  #1: ffffc9000119beb0
      ((work_completion)(&(&dev_priv->hotplug.hotplug_work)->work)){+.+.},
      at: worker_thread+0x455/0x6e2
      [   54.282768]  #2: ffff888272a403f0 (&dev->mode_config.mutex){+.+.},
      at: i915_hotplug_work_func+0x4b/0x2be
      [   54.293368]  #3: ffffffff824fc6c0 (drm_connector_list_iter){.+.+},
      at: i915_hotplug_work_func+0x17e/0x2be
      [   54.304061]  #4: ffffc9000119bc58 (crtc_ww_class_acquire){+.+.},
      at: drm_helper_probe_detect_ctx+0x40/0xfd
      [   54.314855]  #5: ffff888272a40470 (crtc_ww_class_mutex){+.+.}, at:
      drm_modeset_lock+0x74/0xe2
      [   54.324385]  #6: ffff888272af3060 (&mgr->lock){+.+.}, at:
      drm_dp_mst_topology_mgr_set_mst+0x3c/0x2e4
      [   54.334597]
      [   54.334597] stack backtrace:
      [   54.339464] CPU: 1 PID: 1040 Comm: kworker/1:6 Not tainted
      5.5.0-rc6-02274-g77381c23ee63 #47
      [   54.348893] Hardware name: Google Fizz/Fizz, BIOS
      Google_Fizz.10139.39.0 01/04/2018
      [   54.357451] Workqueue: events i915_hotplug_work_func
      [   54.362995] Call Trace:
      [   54.365724]  dump_stack+0x71/0x9c
      [   54.369427]  check_noncircular+0x91/0xbc
      [   54.373809]  ? __lock_acquire+0xc9e/0xf66
      [   54.378286]  ? __lock_acquire+0xc9e/0xf66
      [   54.382763]  ? lock_acquire+0x175/0x1ac
      [   54.387048]  ? drm_dp_mst_topology_mgr_set_mst+0x218/0x2e4
      [   54.393177]  ? __mutex_lock+0xc3/0x498
      [   54.397362]  ? drm_dp_mst_topology_mgr_set_mst+0x218/0x2e4
      [   54.403492]  ? drm_dp_mst_topology_mgr_set_mst+0x218/0x2e4
      [   54.409620]  ? drm_dp_dpcd_access+0xd9/0x101
      [   54.414390]  ? drm_dp_mst_topology_mgr_set_mst+0x218/0x2e4
      [   54.420517]  ? drm_dp_mst_topology_mgr_set_mst+0x218/0x2e4
      [   54.426645]  ? intel_digital_port_connected+0x34d/0x35c
      [   54.432482]  ? intel_dp_detect+0x227/0x44e
      [   54.437056]  ? ww_mutex_lock+0x49/0x9a
      [   54.441242]  ? drm_helper_probe_detect_ctx+0x75/0xfd
      [   54.446789]  ? intel_encoder_hotplug+0x4b/0x97
      [   54.451752]  ? intel_ddi_hotplug+0x61/0x2e0
      [   54.456423]  ? mark_held_locks+0x53/0x68
      [   54.460803]  ? _raw_spin_unlock_irqrestore+0x3a/0x51
      [   54.466347]  ? lockdep_hardirqs_on+0x187/0x1a4
      [   54.471310]  ? drm_connector_list_iter_next+0x89/0x9a
      [   54.476953]  ? i915_hotplug_work_func+0x206/0x2be
      [   54.482208]  ? worker_thread+0x4d5/0x6e2
      [   54.486587]  ? worker_thread+0x455/0x6e2
      [   54.490966]  ? queue_work_on+0x64/0x64
      [   54.495151]  ? kthread+0x1e9/0x1f1
      [   54.498946]  ? queue_work_on+0x64/0x64
      [   54.503130]  ? kthread_unpark+0x5e/0x5e
      [   54.507413]  ? ret_from_fork+0x3a/0x50
      
      The proper fix for this is probably cleanup the VCPI allocations when we're
      enabling the topology, or on the first payload allocation. For now though,
      let's just revert.
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Fixes: 64e62bdf ("drm/dp_mst: Remove VCPI while disabling topology mgr")
      Cc: Sean Paul <sean@poorly.run>
      Cc: Wayne Lin <Wayne.Lin@amd.com>
      Reviewed-by: default avatarSean Paul <sean@poorly.run>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200117205149.97262-1-lyude@redhat.comSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
      9a61fe23
    • Gilad Ben-Yossef's avatar
      crypto: ccree - only try to map auth tag if needed · 1e0c3805
      Gilad Ben-Yossef authored
      [ Upstream commit 504e84ab ]
      
      Make sure to only add the size of the auth tag to the source mapping
      for encryption if it is an in-place operation. Failing to do this
      previously caused us to try and map auth size len bytes from a NULL
      mapping and crashing if both the cryptlen and assoclen are zero.
      Reported-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Tested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarGilad Ben-Yossef <gilad@benyossef.com>
      Cc: stable@vger.kernel.org # v4.19+
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      1e0c3805