1. 07 Nov, 2019 8 commits
    • Chris Wilson's avatar
      drm/i915: Leave the aliasing-ppgtt size alone · 2b0a4fc2
      Chris Wilson authored
      The hidden aliasing-ppgtt's size is never revealed, as we only inspect
      the front GTT when engaged. However, we were "fixing" the hidden ppgtt
      to match, with the net result that we ended up leaking the unused
      portion on Braswell were we preallocated the entire set of top level
      PDP, see gen8_preallocate_top_level_pdp().
      
      [   26.025364] DMA-API: pci 0000:00:02.0: device driver has pending DMA allocations while released from device [count=2]
      [   26.025364] One of leaked entries details: [device address=0x0000000230778000] [size=4096 bytes] [mapped with DMA_BIDIRECTIONAL] [mapped as single]
      [   26.025683] WARNING: CPU: 0 PID: 415 at kernel/dma/debug.c:894 dma_debug_device_change+0x1a4/0x1f0
      [   26.025905] Modules linked in: i915(E-) intel_powerclamp(E) nls_ascii(E) nls_cp437(E) crct10dif_pclmul(E) crc32_pclmul(E) vfat(E) crc32c_intel(E) fat(E) ghash_clmulni_intel(E) prime_numbers(E) intel_gtt(E) i2c_algo_bit(E) efi_pstore(E) drm_kms_helper(E) syscopyarea(E) sysfillrect(E) sysimgblt(E) fb_sys_fops(E) evdev(E) drm(E) aesni_intel(E) glue_helper(E) crypto_simd(E) cryptd(E) intel_cstate(E) sg(E) efivars(E) pcspkr(E) video(E) button(E) efivarfs(E) ip_tables(E) x_tables(E) autofs4(E) sd_mod(E) lpc_ich(E) ahci(E) mfd_core(E) i2c_i801(E) libahci(E) i2c_designware_pci(E) i2c_designware_core(E)
      [   26.026613] CPU: 0 PID: 415 Comm: rmmod Tainted: G            E     5.4.0-rc6+ #25
      [   26.026837] Hardware name:  /, BIOS PYBSWCEL.86A.0027.2015.0507.1758 05/07/2015
      [   26.027080] RIP: 0010:dma_debug_device_change+0x1a4/0x1f0
      [   26.027319] Code: 89 54 24 08 e8 ad 60 62 00 48 8b 54 24 08 48 89 c6 41 57 4d 89 e9 49 89 d8 44 89 f1 41 54 48 c7 c7 e0 61 06 82 e8 c1 aa f5 ff <0f> 0b 5a 59 48 83 3c 24 00 0f 85 97 26 00 00 8b 05 77 47 92 01 85
      [   26.027600] RSP: 0018:ffff888228d2fcc8 EFLAGS: 00010282
      [   26.027831] RAX: 0000000000000000 RBX: 0000000230778000 RCX: 0000000000000000
      [   26.028053] RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffffed10451a5f8f
      [   26.028279] RBP: ffff88823480c0b0 R08: 0000000000000001 R09: ffffed1046e83eb1
      [   26.028500] R10: ffffed1046e83eb0 R11: ffff88823741f587 R12: ffffffff82067340
      [   26.028725] R13: 0000000000001000 R14: 0000000000000002 R15: ffffffff82067480
      [   26.028952] FS:  00007fdf3ed174c0(0000) GS:ffff888237400000(0000) knlGS:0000000000000000
      [   26.029185] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   26.029405] CR2: 000055e211109030 CR3: 0000000230139000 CR4: 00000000001006f0
      [   26.029622] Call Trace:
      [   26.029846]  notifier_call_chain+0x67/0xa0
      [   26.030076]  blocking_notifier_call_chain+0x5a/0x80
      [   26.030305]  device_release_driver_internal+0x20d/0x260
      [   26.030535]  driver_detach+0x7b/0xe1
      [   26.030761]  bus_remove_driver+0x8c/0x153
      [   26.030993]  pci_unregister_driver+0x2d/0xf0
      [   26.032603]  i915_exit+0x16/0x1c [i915]
      Reported-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Fixes: 1eda701e ("drm/i915/gtt: Recursive cleanup for gen8")
      References: c082afac ("drm/i915: Move aliasing_ppgtt underneath its i915_ggtt")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191106221223.7437-1-chris@chris-wilson.co.uk
      2b0a4fc2
    • Jani Nikula's avatar
      drm/i915/display: only include intel_dp_link_training.h where needed · 3c954c41
      Jani Nikula authored
      The intel_dp_link_training.h include has no need or place in
      intel_display.h. Include it in intel_display.c instead.
      
      Cc: Manasi Navare <manasi.d.navare@intel.com>
      Fixes: eadf6f91 ("drm/i915/display/icl: Enable master-slaves in trans port sync")
      Reviewed-by: default avatarManasi Navare <manasi.d.navare@intel.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191029103947.7535-1-jani.nikula@intel.com
      3c954c41
    • Daniel Vetter's avatar
      drm/i915: use might_lock_nested in get_pages annotation · 74ceefd1
      Daniel Vetter authored
      So strictly speaking the existing annotation is also ok, because we
      have a chain of
      
      obj->mm.lock#I915_MM_GET_PAGES -> fs_reclaim -> obj->mm.lock
      
      (the shrinker cannot get at an object while we're in get_pages, hence
      this is safe). But it's confusing, so try to take the right subclass
      of the lock.
      
      This does a bit reduce our lockdep based checking, but then it's also
      less fragile, in case we ever change the nesting around.
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191104173720.2696-3-daniel.vetter@ffwll.ch
      74ceefd1
    • Daniel Vetter's avatar
      lockdep: add might_lock_nested() · e692b402
      Daniel Vetter authored
      Necessary to annotate functions where we might acquire a
      mutex_lock_nested() or similar. Needed by i915.
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191104173720.2696-2-daniel.vetter@ffwll.ch
      e692b402
    • Daniel Vetter's avatar
      drm/i915: Switch obj->mm.lock lockdep annotations on its head · f86dbacb
      Daniel Vetter authored
      The trouble with having a plain nesting flag for locks which do not
      naturally nest (unlike block devices and their partitions, which is
      the original motivation for nesting levels) is that lockdep will
      never spot a true deadlock if you screw up.
      
      This patch is an attempt at trying better, by highlighting a bit more
      of the actual nature of the nesting that's going on. Essentially we
      have two kinds of objects:
      
      - objects without pages allocated, which cannot be on any lru and are
        hence inaccessible to the shrinker.
      
      - objects which have pages allocated, which are on an lru, and which
        the shrinker can decide to throw out.
      
      For the former type of object, memory allocations while holding
      obj->mm.lock are permissible. For the latter they are not. And
      get/put_pages transitions between the two types of objects.
      
      This is still not entirely fool-proof since the rules might change.
      But as long as we run such a code ever at runtime lockdep should be
      able to observe the inconsistency and complain (like with any other
      lockdep class that we've split up in multiple classes). But there are
      a few clear benefits:
      
      - We can drop the nesting flag parameter from
        __i915_gem_object_put_pages, because that function by definition is
        never going allocate memory, and calling it on an object which
        doesn't have its pages allocated would be a bug.
      
      - We strictly catch more bugs, since there's not only one place in the
        entire tree which is annotated with the special class. All the
        other places that had explicit lockdep nesting annotations we're now
        going to leave up to lockdep again.
      
      - Specifically this catches stuff like calling get_pages from
        put_pages (which isn't really a good idea, if we can call get_pages
        so could the shrinker). I've seen patches do exactly that.
      
      Of course I fully expect CI will show me for the fool I am with this
      one here :-)
      
      v2: There can only be one (lockdep only has a cache for the first
      subclass, not for deeper ones, and we don't want to make these locks
      even slower). Still separate enums for better documentation.
      
      Real fix: don't forget about phys objs and pin_map(), and fix the
      shrinker to have the right annotations ... silly me.
      
      v3: Forgot usertptr too ...
      
      v4: Improve comment for pages_pin_count, drop the IMPORTANT comment
      and instead prime lockdep (Chris).
      
      v5: Appease checkpatch, no double empty lines (Chris)
      
      v6: More rebasing over selftest changes. Also somehow I forgot to
      push this patch :-/
      
      Also format comments consistently while at it.
      
      v7: Fix typo in commit message (Joonas)
      
      Also drop the priming, with the lmem merge we now have allocations
      while holding the lmem lock, which wreaks the generic priming I've
      done in earlier patches. Should probably be resurrected when lmem is
      fixed. See
      
      commit 232a6eba
      Author: Matthew Auld <matthew.auld@intel.com>
      Date:   Tue Oct 8 17:01:14 2019 +0100
      
          drm/i915: introduce intel_memory_region
      
      I'm keeping the priming patch locally so it wont get lost.
      
      Cc: Matthew Auld <matthew.auld@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: "Tang, CQ" <cq.tang@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v5)
      Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> (v6)
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191105090148.30269-1-daniel.vetter@ffwll.ch
      [mlankhorst: Fix commit typos pointed out by Michael Ruhl]
      f86dbacb
    • Chris Wilson's avatar
      drm/i915/gt: Cleanup heartbeat systole first · 3466a3de
      Chris Wilson authored
      Before we grab the engine wakeref, tidy up the previous heartbeat
      request. If we then abort because the engine powerwell is off, we ensure
      the request is freed as we know we will not have freed it when
      cancelling the work (as the work is running!).
      
      Fixes: 841e8672 ("drm/i915/gt: Only drop heartbeat.systole if the sole owner")
      References: 058179e7 ("drm/i915/gt: Replace hangcheck by heartbeats")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191106223410.30334-1-chris@chris-wilson.co.uk
      3466a3de
    • Lucas De Marchi's avatar
      drm/i915: switch intel_ddi_init() to intel types · 70dfbc29
      Lucas De Marchi authored
      Prefer using intel_encoder and pass the base where needed rather than
      keeping both encoder and intel_encoder variables around.
      
      v2: actually add all changes to the patch
      Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191106071715.10613-1-lucas.demarchi@intel.com
      70dfbc29
    • James Ausmus's avatar
      drm/i915/tgl: Add second TGL PCH ID · 6cf6e590
      James Ausmus authored
      Another TGP ID has shown up, so let's add it to avoid South Display
      breakage on systems that have this ID.
      
      Cc: Lucas De Marchi <lucas.demarchi@intel.com>
      Cc: José Roberto de Souza <jose.souza@intel.com>
      Signed-off-by: default avatarJames Ausmus <james.ausmus@intel.com>
      Reviewed-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
      Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191106005526.1500-1-james.ausmus@intel.com
      6cf6e590
  2. 06 Nov, 2019 7 commits
  3. 05 Nov, 2019 5 commits
  4. 04 Nov, 2019 15 commits
  5. 02 Nov, 2019 3 commits
  6. 01 Nov, 2019 2 commits