1. 02 Nov, 2017 3 commits
  2. 01 Nov, 2017 5 commits
  3. 31 Oct, 2017 3 commits
  4. 30 Oct, 2017 9 commits
  5. 27 Oct, 2017 14 commits
  6. 26 Oct, 2017 6 commits
    • Manasi Navare's avatar
      drm/i915: Cancel the modeset retry work during modeset cleanup · 886c6b86
      Manasi Navare authored
      During modeset cleanup on driver unload we may have a pending
      hotplug work. This needs to be canceled early during the teardown
      so that it does not fire after we have freed the connector.
      We do this after drm_kms_helper_poll_fini(dev) since this might
      trigger modeset retry work due to link retrain and before
      intel_fbdev_fini() since this work requires the lock from fbdev.
      
      If this is not done we may see something like:
      DEBUG_LOCKS_WARN_ON(mutex_is_locked(lock))
       ------------[ cut here ]------------
       WARNING: CPU: 4 PID: 5010 at kernel/locking/mutex-debug.c:103 mutex_destroy+0x4e/0x60
       Modules linked in: i915(-) snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_hda_codec snd_hwdep snd_hda_core snd_pcm vgem ax88179_178
      +a usbnet mii x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel e1000e ptp pps_core prime_numbers i2c_hid
      +[last unloaded: snd_hda_intel]
       CPU: 4 PID: 5010 Comm: drv_module_relo Tainted: G     U          4.14.0-rc3-CI-CI_DRM_3186+ #1
       Hardware name: Intel Corporation CoffeeLake Client Platform/CoffeeLake S UDIMM RVP, BIOS CNLSFWX1.R00.X104.A03.1709140524 09/14/2017
       task: ffff8803c827aa40 task.stack: ffffc90000520000
       RIP: 0010:mutex_destroy+0x4e/0x60
       RSP: 0018:ffffc90000523d58 EFLAGS: 00010292
       RAX: 000000000000002a RBX: ffff88044fbef648 RCX: 0000000000000000
       RDX: 0000000080000001 RSI: 0000000000000001 RDI: ffffffff810f0cf0
       RBP: ffffc90000523d60 R08: 0000000000000001 R09: 0000000000000001
       R10: 000000000f21cb81 R11: 0000000000000000 R12: ffff88044f71efc8
       R13: ffffffffa02b3d20 R14: ffffffffa02b3d90 R15: ffff880459b29308
       FS:  00007f5df4d6e8c0(0000) GS:ffff88045d300000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 000055ec51f00a18 CR3: 0000000451782006 CR4: 00000000003606e0
       DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
       DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
       Call Trace:
        drm_fb_helper_fini+0xd9/0x130
        intel_fbdev_destroy+0x12/0x60 [i915]
        intel_fbdev_fini+0x28/0x30 [i915]
        intel_modeset_cleanup+0x45/0xa0 [i915]
        i915_driver_unload+0x92/0x180 [i915]
        i915_pci_remove+0x19/0x30 [i915]
        i915_driver_unload+0x92/0x180 [i915]
        i915_pci_remove+0x19/0x30 [i915]
        pci_device_remove+0x39/0xb0
        device_release_driver_internal+0x15d/0x220
        driver_detach+0x40/0x80
        bus_remove_driver+0x58/0xd0
        driver_unregister+0x2c/0x40
        pci_unregister_driver+0x36/0xb0
        i915_exit+0x1a/0x8b [i915]
        SyS_delete_module+0x18c/0x1e0
        entry_SYSCALL_64_fastpath+0x1c/0xb1
       RIP: 0033:0x7f5df3286287
       RSP: 002b:00007fff8e107cc8 EFLAGS: 00000246 ORIG_RAX: 00000000000000b0
       RAX: ffffffffffffffda RBX: ffffffff81493a03 RCX: 00007f5df3286287
       RDX: 0000000000000001 RSI: 0000000000000800 RDI: 0000564c7be02e48
       RBP: ffffc90000523f88 R08: 0000000000000000 R09: 0000000000000080
       R10: 00007f5df4d6e8c0 R11: 0000000000000246 R12: 0000000000000000
       R13: 00007fff8e107eb0 R14: 0000000000000000 R15: 0000000000000000
      Or a GPF like:
      
       general protection fault: 0000 [#1] PREEMPT SMP
       Modules linked in: i915(-) snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_hda_codec snd_hwdep snd_hda_core snd_pcm vgem ax88179_178
      +a usbnet mii x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel e1000e ptp pps_core prime_numbers i2c_hid
      +[last unloaded: snd_hda_intel]
       CPU: 0 PID: 82 Comm: kworker/0:1 Tainted: G     U  W       4.14.0-rc3-CI-CI_DRM_3186+ #1
       Hardware name: Intel Corporation CoffeeLake Client Platform/CoffeeLake S UDIMM RVP, BIOS CNLSFWX1.R00.X104.A03.1709140524 09/14/2017
       Workqueue: events intel_dp_modeset_retry_work_fn [i915]
       task: ffff88045a5caa40 task.stack: ffffc90000378000
       RIP: 0010:drm_setup_crtcs+0x143/0xbf0
       RSP: 0018:ffffc9000037bd20 EFLAGS: 00010202
       RAX: 6b6b6b6b6b6b6b6b RBX: 0000000000000002 RCX: 0000000000000001
       RDX: 0000000000000001 RSI: 0000000000000780 RDI: 00000000ffffffff
       RBP: ffffc9000037bdb8 R08: 0000000000000001 R09: 0000000000000001
       R10: 0000000000000780 R11: 0000000000000000 R12: 0000000000000002
       R13: ffff88044fbef4e8 R14: 0000000000000780 R15: 0000000000000438
       FS:  0000000000000000(0000) GS:ffff88045d200000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 000055ec51ee5168 CR3: 000000044c89d003 CR4: 00000000003606f0
       Call Trace:
        drm_fb_helper_hotplug_event.part.18+0x7e/0xc0
        drm_fb_helper_hotplug_event+0x1a/0x20
        intel_fbdev_output_poll_changed+0x1a/0x20 [i915]
        drm_kms_helper_hotplug_event+0x27/0x30
        intel_dp_modeset_retry_work_fn+0x77/0x80 [i915]
        process_one_work+0x233/0x660
        worker_thread+0x206/0x3b0
        kthread+0x152/0x190
        ? process_one_work+0x660/0x660
        ? kthread_create_on_node+0x40/0x40
        ret_from_fork+0x27/0x40
       Code: 06 00 00 45 8b 45 20 31 db 45 31 e4 45 85 c0 0f 8e 91 06 00 00 44 8b 75 94 44 8b 7d 90 49 8b 45 28 49 63 d4 44 89 f6 41 83 c4 01 <48> 8b 04 d0 44
      +89 fa 48 8b 38 48 8b 87 a8 01 00 00 ff 50 20 01
       RIP: drm_setup_crtcs+0x143/0xbf0 RSP: ffffc9000037bd20
       ---[ end trace 08901ff1a77d30c7 ]---
      
      v2:
      * Rename it to intel_hpd_poll_fini() and call drm_kms_helper_fini() inside it
      as the first step before cancel work (Chris Wilson)
      * Add GPF trace in commit message and make the function static (Maarten Lankhorst)
      Suggested-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Suggested-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Fixes: 9301397a ("drm/i915: Implement Link Rate fallback on Link training failure")
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Tony Cheng <tony.cheng@amd.com>
      Cc: Harry Wentland <Harry.wentland@amd.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
      Cc: Manasi Navare <manasi.d.navare@intel.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarManasi Navare <manasi.d.navare@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/1509054720-25325-1-git-send-email-manasi.d.navare@intel.comReviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      886c6b86
    • Chris Wilson's avatar
      drm/i915: Add -Wall -Wextra to our build, set warnings to full · 39bf4de8
      Chris Wilson authored
      Recently W=1 on gcc-7.2 (-Wunused-const-variable) caught a regression
      that had been lurking for 6 months, so lets try enabling the full set of
      warnings for CI builds. This means more patches will be rejected early
      that contain trivial and sometimes not so trivial bugs. However, our
      code does not yet compile cleanly with W=1, so we have to apply a filter
      to the set of warnings until we can eliminate the mistakes. It also
      means that developers will have to be running the full gamut of gcc to
      ensure that as warnings come and go with gcc updates, we have the CI
      build prepared.
      
      v2: Use fine-grained -Wno overrides. Inside the makefile, we can
      specify CFLAGS on a per-object level, which allows us to limit the scope
      of any particular warning override.
      v3: Place per-file overrides after the main enabling block.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
      Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Acked-by: default avatarTomi Sarvela <tomi.p.sarvela@intel.com>
      Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171024181547.27889-1-chris@chris-wilson.co.ukAcked-by: default avatarJani Nikula <jani.nikula@intel.com>
      39bf4de8
    • Chris Wilson's avatar
      drm/i915: Include RING_MODE when dumping the engine state · 3c75de5b
      Chris Wilson authored
      Knowing the RING_MODE flags is useful for checking the state of the
      engine, such as whether the CS is idle after trying to stop the engines
      before reset.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171026115048.20144-1-chris@chris-wilson.co.ukReviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      3c75de5b
    • Michal Wajdeczko's avatar
      drm/i915/huc: Use helper function while waiting for DMA completion · bad7b7e6
      Michal Wajdeczko authored
      Waiting for DMA status register can be done with dedicated function.
      Lets use it as additional bonus will be smaller driver footprint.
      Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171024105056.43276-1-michal.wajdeczko@intel.com
      bad7b7e6
    • Michał Winiarski's avatar
      drm/i915/guc: Preemption! With GuC · c41937fd
      Michał Winiarski authored
      Pretty similar to what we have on execlists.
      We're reusing most of the GEM code, however, due to GuC quirks we need a
      couple of extra bits.
      Preemption is implemented as GuC action, and actions can be pretty slow.
      Because of that, we're using a mutex to serialize them. Since we're
      requesting preemption from the tasklet, the task of creating a workitem
      and wrapping it in GuC action is delegated to a worker.
      
      To distinguish that preemption has finished, we're using additional
      piece of HWSP, and since we're not getting context switch interrupts,
      we're also adding a user interrupt.
      
      The fact that our special preempt context has completed unfortunately
      doesn't mean that we're ready to submit new work. We also need to wait
      for GuC to finish its own processing.
      
      v2: Don't compile out the wait for GuC, handle workqueue flush on reset,
      no need for ordered workqueue, put on a reviewer hat when looking at my own
      patches (Chris)
      Move struct work around in intel_guc, move user interruput outside of
      conditional (Michał)
      Keep ring around rather than chase though intel_context
      
      v3: Extract WA for flushing ggtt writes to a helper (Chris)
      Keep work_struct in intel_guc rather than engine (Michał)
      Use ordered workqueue for inject_preempt worker to avoid GuC quirks.
      
      v4: Drop now unused INTEL_GUC_PREEMPT_OPTION_IMMEDIATE (Daniele)
      Drop stray newlines, use container_of for intel_guc in worker,
      check for presence of workqueue when flushing it, rather than
      enable_guc_submission modparam, reorder preempt postprocessing (Chris)
      
      v5: Make wq NULL after destroying it
      
      v6: Swap struct guc_preempt_work members (Michał)
      Signed-off-by: default avatarMichał Winiarski <michal.winiarski@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Jeff McGee <jeff.mcgee@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Oscar Mateo <oscar.mateo@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171026133558.19580-1-michal.winiarski@intel.com
      c41937fd
    • Michał Winiarski's avatar
      drm/i915: Rename helpers used for unwinding, use macro for can_preempt · a4598d17
      Michał Winiarski authored
      We would also like to make use of execlist_cancel_port_requests and
      unwind_incomplete_requests in GuC preemption backend.
      Let's rename the functions to use the correct prefixes, so that we can
      simply add the declarations in the following patch.
      Similar thing for applies for can_preempt, except we're introducing
      HAS_LOGICAL_RING_PREEMPTION macro instad, converting other users that
      were previously touching device info directly.
      
      v2: s/intel_engine/execlists and pass execlists to unwind (Chris)
      v3: use locked version for exporting, drop const qual (Chris)
      Signed-off-by: default avatarMichał Winiarski <michal.winiarski@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171025200020.16636-11-michal.winiarski@intel.com
      a4598d17