1. 30 6月, 2021 1 次提交
  2. 24 6月, 2021 1 次提交
  3. 23 6月, 2021 1 次提交
  4. 22 6月, 2021 7 次提交
  5. 21 6月, 2021 1 次提交
  6. 20 6月, 2021 3 次提交
  7. 17 6月, 2021 2 次提交
  8. 16 6月, 2021 2 次提交
  9. 10 6月, 2021 2 次提交
    • S
      drm/msm/dsi: Stash away calculated vco frequency on recalc · 170b7635
      Stephen Boyd 提交于
      A problem was reported on CoachZ devices where the display wouldn't come
      up, or it would be distorted. It turns out that the PLL code here wasn't
      getting called once dsi_pll_10nm_vco_recalc_rate() started returning the
      same exact frequency, down to the Hz, that the bootloader was setting
      instead of 0 when the clk was registered with the clk framework.
      
      After commit 001d8dc3 ("drm/msm/dsi: remove temp data from global
      pll structure") we use a hardcoded value for the parent clk frequency,
      i.e.  VCO_REF_CLK_RATE, and we also hardcode the value for FRAC_BITS,
      instead of getting it from the config structure. This combination of
      changes to the recalc function allows us to properly calculate the
      frequency of the PLL regardless of whether or not the PLL has been
      clk_prepare()d or clk_set_rate()d. That's a good improvement.
      
      Unfortunately, this means that now we won't call down into the PLL clk
      driver when we call clk_set_rate() because the frequency calculated in
      the framework matches the frequency that is set in hardware. If the rate
      is the same as what we want it should be OK to not call the set_rate PLL
      op. The real problem is that the prepare op in this driver uses a
      private struct member to stash away the vco frequency so that it can
      call the set_rate op directly during prepare. Once the set_rate op is
      never called because recalc_rate told us the rate is the same, we don't
      set this private struct member before the prepare op runs, so we try to
      call the set_rate function directly with a frequency of 0. This
      effectively kills the PLL and configures it for a rate that won't work.
      Calling set_rate from prepare is really quite bad and will confuse any
      downstream clks about what the rate actually is of their parent. Fixing
      that will be a rather large change though so we leave that to later.
      
      For now, let's stash away the rate we calculate during recalc so that
      the prepare op knows what frequency to set, instead of 0. This way
      things keep working and the display can enable the PLL properly. In the
      future, we should remove that code from the prepare op so that it
      doesn't even try to call the set rate function.
      
      Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Cc: Abhinav Kumar <abhinavk@codeaurora.org>
      Fixes: 001d8dc3 ("drm/msm/dsi: remove temp data from global pll structure")
      Signed-off-by: NStephen Boyd <swboyd@chromium.org>
      Link: https://lore.kernel.org/r/20210608195519.125561-1-swboyd@chromium.orgSigned-off-by: NRob Clark <robdclark@chromium.org>
      170b7635
    • D
      drm: Lock pointer access in drm_master_release() · c336a5ee
      Desmond Cheong Zhi Xi 提交于
      This patch eliminates the following smatch warning:
      drivers/gpu/drm/drm_auth.c:320 drm_master_release() warn: unlocked access 'master' (line 318) expected lock '&dev->master_mutex'
      
      The 'file_priv->master' field should be protected by the mutex lock to
      '&dev->master_mutex'. This is because other processes can concurrently
      modify this field and free the current 'file_priv->master'
      pointer. This could result in a use-after-free error when 'master' is
      dereferenced in subsequent function calls to
      'drm_legacy_lock_master_cleanup()' or to 'drm_lease_revoke()'.
      
      An example of a scenario that would produce this error can be seen
      from a similar bug in 'drm_getunique()' that was reported by Syzbot:
      https://syzkaller.appspot.com/bug?id=148d2f1dfac64af52ffd27b661981a540724f803
      
      In the Syzbot report, another process concurrently acquired the
      device's master mutex in 'drm_setmaster_ioctl()', then overwrote
      'fpriv->master' in 'drm_new_set_master()'. The old value of
      'fpriv->master' was subsequently freed before the mutex was unlocked.
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NDesmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210609092119.173590-1-desmondcheongzx@gmail.com
      c336a5ee
  10. 09 6月, 2021 11 次提交
  11. 08 6月, 2021 2 次提交
    • M
      drm/vc4: fix vc4_atomic_commit_tail() logic · 8a11e84b
      Mark Rutland 提交于
      In vc4_atomic_commit_tail() we iterate of the set of old CRTCs, and
      attempt to wait on any channels which are still in use. When we iterate
      over the CRTCs, we have:
      
      * `i` - the index of the CRTC
      * `channel` - the channel a CRTC is using
      
      When we check the channel state, we consult:
      
        old_hvs_state->fifo_state[channel].in_use
      
      ... but when we wait for the channel, we erroneously wait on:
      
        old_hvs_state->fifo_state[i].pending_commit
      
      ... rather than:
      
         old_hvs_state->fifo_state[channel].pending_commit
      
      ... and this bogus access has been observed to result in boot-time hangs
      on some arm64 configurations, and can be detected using KASAN. FIx this
      by using the correct index.
      
      I've tested this on a Raspberry Pi 3 model B v1.2 with KASAN.
      
      Trimmed KASAN splat:
      
      | ==================================================================
      | BUG: KASAN: slab-out-of-bounds in vc4_atomic_commit_tail+0x1cc/0x910
      | Read of size 8 at addr ffff000007360440 by task kworker/u8:0/7
      | CPU: 2 PID: 7 Comm: kworker/u8:0 Not tainted 5.13.0-rc3-00009-g694c523e7267 #3
      |
      | Hardware name: Raspberry Pi 3 Model B (DT)
      | Workqueue: events_unbound deferred_probe_work_func
      | Call trace:
      |  dump_backtrace+0x0/0x2b4
      |  show_stack+0x1c/0x30
      |  dump_stack+0xfc/0x168
      |  print_address_description.constprop.0+0x2c/0x2c0
      |  kasan_report+0x1dc/0x240
      |  __asan_load8+0x98/0xd4
      |  vc4_atomic_commit_tail+0x1cc/0x910
      |  commit_tail+0x100/0x210
      | ...
      |
      | Allocated by task 7:
      |  kasan_save_stack+0x2c/0x60
      |  __kasan_kmalloc+0x90/0xb4
      |  vc4_hvs_channels_duplicate_state+0x60/0x1a0
      |  drm_atomic_get_private_obj_state+0x144/0x230
      |  vc4_atomic_check+0x40/0x73c
      |  drm_atomic_check_only+0x998/0xe60
      |  drm_atomic_commit+0x34/0x94
      |  drm_client_modeset_commit_atomic+0x2f4/0x3a0
      |  drm_client_modeset_commit_locked+0x8c/0x230
      |  drm_client_modeset_commit+0x38/0x60
      |  drm_fb_helper_set_par+0x104/0x17c
      |  fbcon_init+0x43c/0x970
      |  visual_init+0x14c/0x1e4
      | ...
      |
      | The buggy address belongs to the object at ffff000007360400
      |  which belongs to the cache kmalloc-128 of size 128
      | The buggy address is located 64 bytes inside of
      |  128-byte region [ffff000007360400, ffff000007360480)
      | The buggy address belongs to the page:
      | page:(____ptrval____) refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7360
      | flags: 0x3fffc0000000200(slab|node=0|zone=0|lastcpupid=0xffff)
      | raw: 03fffc0000000200 dead000000000100 dead000000000122 ffff000004c02300
      | raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
      | page dumped because: kasan: bad access detected
      |
      | Memory state around the buggy address:
      |  ffff000007360300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      |  ffff000007360380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      | >ffff000007360400: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc
      |                                            ^
      |  ffff000007360480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      |  ffff000007360500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      | ==================================================================
      
      Link: https://lore.kernel.org/r/4d0c8318-bad8-2be7-e292-fc8f70c198de@samsung.com
      Link: https://lore.kernel.org/linux-arm-kernel/20210607151740.moncryl5zv3ahq4s@gilmourSigned-off-by: NMark Rutland <mark.rutland@arm.com>
      Reported-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Emma Anholt <emma@anholt.net>
      Cc: Maxime Ripard <maxime@cerno.tech>
      Cc: Will Deacon <will@kernel.org>
      Cc: dri-devel@lists.freedesktop.org
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Tested-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NMaxime Ripard <maxime@cerno.tech>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210608085513.2069-1-mark.rutland@arm.com
      8a11e84b
    • C
      drm/ttm: fix deref of bo->ttm without holding the lock v2 · 2d2ddb58
      Christian König 提交于
      We need to grab the resv lock first before doing that check.
      
      v2 (chk): simplify the change for -fixes
      Signed-off-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: NHuang Rui <ray.huang@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210528130041.1683-1-christian.koenig@amd.com
      2d2ddb58
  12. 07 6月, 2021 1 次提交
  13. 03 6月, 2021 6 次提交