1. 13 6月, 2022 2 次提交
    • A
      drm/i915/gt: Fix memory leaks in per-gt sysfs · 6e3f3c23
      Ashutosh Dixit 提交于
      All kmalloc'd kobjects need a kobject_put() to free memory. For example in
      previous code, kobj_gt_release() never gets called. The requirement of
      kobject_put() now results in a slightly different code organization.
      
      v2: s/gtn/gt/ (Andi)
      
      Fixes: b770bcfa ("drm/i915/gt: create per-tile sysfs interface")
      Signed-off-by: NAshutosh Dixit <ashutosh.dixit@intel.com>
      Reviewed-by: NAndi Shyti <andi.shyti@linux.intel.com>
      Acked-by: NAndrzej Hajda <andrzej.hajda@intel.com>
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/a6f6686517c85fba61a0c45097f5bb4fe7e257fb.1653484574.git.ashutosh.dixit@intel.com
      (cherry picked from commit 69d6bf5c)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      6e3f3c23
    • A
      drm/i915/reset: Fix error_state_read ptr + offset use · c9b576d0
      Alan Previn 提交于
      Fix our pointer offset usage in error_state_read
      when there is no i915_gpu_coredump but buf offset
      is non-zero.
      
      This fixes a kernel page fault can happen when
      multiple tests are running concurrently in a loop
      and one is producing engine resets and consuming
      the i915 error_state dump while the other is
      forcing full GT resets. (takes a while to trigger).
      
      The dmesg call trace:
      
      [ 5590.803000] BUG: unable to handle page fault for address:
                     ffffffffa0b0e000
      [ 5590.803009] #PF: supervisor read access in kernel mode
      [ 5590.803013] #PF: error_code(0x0000) - not-present page
      [ 5590.803016] PGD 5814067 P4D 5814067 PUD 5815063 PMD 109de4067
                     PTE 0
      [ 5590.803022] Oops: 0000 [#1] PREEMPT SMP NOPTI
      [ 5590.803026] CPU: 5 PID: 13656 Comm: i915_hangman Tainted: G U
                          5.17.0-rc5-ups69-guc-err-capt-rev6+ #136
      [ 5590.803033] Hardware name: Intel Corporation Alder Lake Client
                          Platform/AlderLake-M LP4x RVP, BIOS ADLPFWI1.R00.
                          3031.A02.2201171222	01/17/2022
      [ 5590.803039] RIP: 0010:memcpy_erms+0x6/0x10
      [ 5590.803045] Code: fe ff ff cc eb 1e 0f 1f 00 48 89 f8 48 89 d1
                           48 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 c3
                           66 0f 1f 44 00 00 48 89 f8 48 89 d1 <f3> a4
                           c3 0f 1f 80 00 00 00 00 48 89 f8 48 83 fa 20
                           72 7e 40 38 fe
      [ 5590.803054] RSP: 0018:ffffc90003a8fdf0 EFLAGS: 00010282
      [ 5590.803057] RAX: ffff888107ee9000 RBX: ffff888108cb1a00
                     RCX: 0000000000000f8f
      [ 5590.803061] RDX: 0000000000001000 RSI: ffffffffa0b0e000
                     RDI: ffff888107ee9071
      [ 5590.803065] RBP: 0000000000000000 R08: 0000000000000001
                     R09: 0000000000000001
      [ 5590.803069] R10: 0000000000000001 R11: 0000000000000002
                     R12: 0000000000000019
      [ 5590.803073] R13: 0000000000174fff R14: 0000000000001000
                     R15: ffff888107ee9000
      [ 5590.803077] FS: 00007f62a99bee80(0000) GS:ffff88849f880000(0000)
                     knlGS:0000000000000000
      [ 5590.803082] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 5590.803085] CR2: ffffffffa0b0e000 CR3: 000000010a1a8004
                     CR4: 0000000000770ee0
      [ 5590.803089] PKRU: 55555554
      [ 5590.803091] Call Trace:
      [ 5590.803093] <TASK>
      [ 5590.803096] error_state_read+0xa1/0xd0 [i915]
      [ 5590.803175] kernfs_fop_read_iter+0xb2/0x1b0
      [ 5590.803180] new_sync_read+0x116/0x1a0
      [ 5590.803185] vfs_read+0x114/0x1b0
      [ 5590.803189] ksys_read+0x63/0xe0
      [ 5590.803193] do_syscall_64+0x38/0xc0
      [ 5590.803197] entry_SYSCALL_64_after_hwframe+0x44/0xae
      [ 5590.803201] RIP: 0033:0x7f62aaea5912
      [ 5590.803204] Code: c0 e9 b2 fe ff ff 50 48 8d 3d 5a b9 0c 00 e8 05
                           19 02 00 0f 1f 44 00 00 f3 0f 1e fa 64 8b 04 25
                           18 00 00 00 85 c0 75 10 0f 05 <48> 3d 00 f0 ff
                           ff 77 56 c3 0f 1f 44 00 00 48 83 ec 28 48 89 54 24
      [ 5590.803213] RSP: 002b:00007fff5b659ae8 EFLAGS: 00000246
                     ORIG_RAX: 0000000000000000
      [ 5590.803218] RAX: ffffffffffffffda RBX: 0000000000100000
                     RCX: 00007f62aaea5912
      [ 5590.803221] RDX: 000000000008b000 RSI: 00007f62a8c4000f
                     RDI: 0000000000000006
      [ 5590.803225] RBP: 00007f62a8bcb00f R08: 0000000000200010
                     R09: 0000000000101000
      [ 5590.803229] R10: 0000000000000001 R11: 0000000000000246
                     R12: 0000000000000006
      [ 5590.803233] R13: 0000000000075000 R14: 00007f62a8acb010
                     R15: 0000000000200000
      [ 5590.803238] </TASK>
      [ 5590.803240] Modules linked in: i915 ttm drm_buddy drm_dp_helper
                              drm_kms_helper syscopyarea sysfillrect sysimgblt
                              fb_sys_fops prime_numbers nfnetlink br_netfilter
                              overlay mei_pxp mei_hdcp x86_pkg_temp_thermal
                              coretemp kvm_intel snd_hda_codec_hdmi snd_hda_intel
                              snd_intel_dspcfg snd_hda_codec snd_hwdep
                              snd_hda_core snd_pcm mei_me mei fuse ip_tables
                              x_tables crct10dif_pclmul e1000e crc32_pclmul ptp
                              i2c_i801 ghash_clmulni_intel i2c_smbus pps_core
                              [last unloa ded: ttm]
      [ 5590.803277] CR2: ffffffffa0b0e000
      [ 5590.803280] ---[ end trace 0000000000000000 ]---
      
      Fixes: 0e39037b ("drm/i915: Cache the error string")
      Signed-off-by: NAlan Previn <alan.previn.teres.alexis@intel.com>
      Reviewed-by: NJohn Harrison <John.C.Harrison@Intel.com>
      Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220311004311.514198-2-alan.previn.teres.alexis@intel.com
      (cherry picked from commit 3304033a)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      c9b576d0
  2. 10 6月, 2022 1 次提交
    • L
      drm: imx: fix compiler warning with gcc-12 · 7aefd8b5
      Linus Torvalds 提交于
      Gcc-12 correctly warned about this code using a non-NULL pointer as a
      truth value:
      
        drivers/gpu/drm/imx/ipuv3-crtc.c: In function ‘ipu_crtc_disable_planes’:
        drivers/gpu/drm/imx/ipuv3-crtc.c:72:21: error: the comparison will always evaluate as ‘true’ for the address of ‘plane’ will never be NULL [-Werror=address]
           72 |                 if (&ipu_crtc->plane[1] && plane == &ipu_crtc->plane[1]->base)
              |                     ^
      
      due to the extraneous '&' address-of operator.
      
      Philipp Zabel points out that The mistake had no adverse effect since
      the following condition doesn't actually dereference the NULL pointer,
      but the intent of the code was obviously to check for it, not to take
      the address of the member.
      
      Fixes: eb8c8880 ("drm/imx: add deferred plane disabling")
      Acked-by: NPhilipp Zabel <p.zabel@pengutronix.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7aefd8b5
  3. 09 6月, 2022 2 次提交
  4. 08 6月, 2022 7 次提交
  5. 07 6月, 2022 2 次提交
    • B
      drm/atomic: Force bridge self-refresh-exit on CRTC switch · e54a4424
      Brian Norris 提交于
      It's possible to change which CRTC is in use for a given
      connector/encoder/bridge while we're in self-refresh without fully
      disabling the connector/encoder/bridge along the way. This can confuse
      the bridge encoder/bridge, because
      (a) it needs to track the SR state (trying to perform "active"
          operations while the panel is still in SR can be Bad(TM)); and
      (b) it tracks the SR state via the CRTC state (and after the switch, the
          previous SR state is lost).
      
      Thus, we need to either somehow carry the self-refresh state over to the
      new CRTC, or else force an encoder/bridge self-refresh transition during
      such a switch.
      
      I choose the latter, so we disable the encoder (and exit PSR) before
      attaching it to the new CRTC (where we can continue to assume a clean
      (non-self-refresh) state).
      
      This fixes PSR issues seen on Rockchip RK3399 systems with
      drivers/gpu/drm/bridge/analogix/analogix_dp_core.c.
      
      Change in v2:
      
      - Drop "->enable" condition; this could possibly be "->active" to
        reflect the intended hardware state, but it also is a little
        over-specific. We want to make a transition through "disabled" any
        time we're exiting PSR at the same time as a CRTC switch.
        (Thanks Liu Ying)
      
      Cc: Liu Ying <victor.liu@oss.nxp.com>
      Cc: <stable@vger.kernel.org>
      Fixes: 1452c25b ("drm: Add helpers to kick off self refresh mode in drivers")
      Signed-off-by: NBrian Norris <briannorris@chromium.org>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220228122522.v2.2.Ic15a2ef69c540aee8732703103e2cff51fb9c399@changeid
      e54a4424
    • B
      drm/bridge: analogix_dp: Support PSR-exit to disable transition · ca871659
      Brian Norris 提交于
      Most eDP panel functions only work correctly when the panel is not in
      self-refresh. In particular, analogix_dp_bridge_disable() tends to hit
      AUX channel errors if the panel is in self-refresh.
      
      Given the above, it appears that so far, this driver assumes that we are
      never in self-refresh when it comes time to fully disable the bridge.
      Prior to commit 846c7dfc ("drm/atomic: Try to preserve the crtc
      enabled state in drm_atomic_remove_fb, v2."), this tended to be true,
      because we would automatically disable the pipe when framebuffers were
      removed, and so we'd typically disable the bridge shortly after the last
      display activity.
      
      However, that is not guaranteed: an idle (self-refresh) display pipe may
      be disabled, e.g., when switching CRTCs. We need to exit PSR first.
      
      Stable notes: this is definitely a bugfix, and the bug has likely
      existed in some form for quite a while. It may predate the "PSR helpers"
      refactor, but the code looked very different before that, and it's
      probably not worth rewriting the fix.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 6c836d96 ("drm/rockchip: Use the helpers for PSR")
      Signed-off-by: NBrian Norris <briannorris@chromium.org>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220228122522.v2.1.I161904be17ba14526f78536ccd78b85818449b51@changeid
      ca871659
  6. 04 6月, 2022 7 次提交
  7. 03 6月, 2022 3 次提交
  8. 02 6月, 2022 16 次提交