1. 13 11月, 2019 1 次提交
    • U
      drm/i915: Lower RM timeout to avoid DSI hard hangs · 011b7173
      Uma Shankar 提交于
      commit 1d85a299c4db57c55e0229615132c964d17aa765 upstream.
      
      In BXT/APL, device 2 MMIO reads from MIPI controller requires its PLL
      to be turned ON. When MIPI PLL is turned off (MIPI Display is not
      active or connected), and someone (host or GT engine) tries to read
      MIPI registers, it causes hard hang. This is a hardware restriction
      or limitation.
      
      Driver by itself doesn't read MIPI registers when MIPI display is off.
      But any userspace application can submit unprivileged batch buffer for
      execution. In that batch buffer there can be mmio reads. And these
      reads are allowed even for unprivileged applications. If these
      register reads are for MIPI DSI controller and MIPI display is not
      active during that time, then the MMIO read operation causes system
      hard hang and only way to recover is hard reboot. A genuine
      process/application won't submit batch buffer like this and doesn't
      cause any issue. But on a compromised system, a malign userspace
      process/app can generate such batch buffer and can trigger system
      hard hang (denial of service attack).
      
      The fix is to lower the internal MMIO timeout value to an optimum
      value of 950us as recommended by hardware team. If the timeout is
      beyond 1ms (which will hit for any value we choose if MMIO READ on a
      DSI specific register is performed without PLL ON), it causes the
      system hang. But if the timeout value is lower than it will be below
      the threshold (even if timeout happens) and system will not get into
      a hung state. This will avoid a system hang without losing any
      programming or GT interrupts, taking the worst case of lowest CDCLK
      frequency and early DC5 abort into account.
      Signed-off-by: NUma Shankar <uma.shankar@intel.com>
      Reviewed-by: NJon Bloomfield <jon.bloomfield@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      011b7173
  2. 13 12月, 2018 1 次提交
  3. 01 12月, 2018 1 次提交
  4. 07 8月, 2018 1 次提交
    • C
      drm/i915: Interactive RPS mode · 027063b1
      Chris Wilson 提交于
      RPS provides a feedback loop where we use the load during the previous
      evaluation interval to decide whether to up or down clock the GPU
      frequency. Our responsiveness is split into 3 regimes, a high and low
      plateau with the intent to keep the gpu clocked high to cover occasional
      stalls under high load, and low despite occasional glitches under steady
      low load, and inbetween. However, we run into situations like kodi where
      we want to stay at low power (video decoding is done efficiently
      inside the fixed function HW and doesn't need high clocks even for high
      bitrate streams), but just occasionally the pipeline is more complex
      than a video decode and we need a smidgen of extra GPU power to present
      on time. In the high power regime, we sample at sub frame intervals with
      a bias to upclocking, and conversely at low power we sample over a few
      frames worth to provide what we consider to be the right levels of
      responsiveness respectively. At low power, we more or less expect to be
      kicked out to high power at the start of a busy sequence by waitboosting.
      
      Prior to commit e9af4ea2 ("drm/i915: Avoid waitboosting on the active
      request") whenever we missed the frame or stalled, we would immediate go
      full throttle and upclock the GPU to max. But in commit e9af4ea2, we
      relaxed the waitboosting to only apply if the pipeline was deep to avoid
      over-committing resources for a near miss. Sadly though, a near miss is
      still a miss, and perceptible as jitter in the frame delivery.
      
      To try and prevent the near miss before having to resort to boosting
      after the fact, we use the pageflip queue as an indication that we are
      in an "interactive" regime and so should sample the load more frequently
      to provide power before the frame misses it vblank. This will make us
      more favorable to providing a small power increase (one or two bins) as
      required rather than going all the way to maximum and then having to
      work back down again. (We still keep the waitboosting mechanism around
      just in case a dramatic change in system load requires urgent uplocking,
      faster than we can provide in a few evaluation intervals.)
      
      v2: Reduce rps_set_interactive to a boolean parameter to avoid the
      confusion of what if they wanted a new power mode after pinning to a
      different mode (which to choose?)
      v3: Only reprogram RPS while the GT is awake, it will be set when we
      wake the GT, and while off warns about being used outside of rpm.
      v4: Fix deferred application of interactive mode
      v5: s/state/interactive/
      v6: Group the mutex with its principle in a substruct
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107111
      Fixes: e9af4ea2 ("drm/i915: Avoid waitboosting on the active request")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180731132629.3381-1-chris@chris-wilson.co.uk
      (cherry picked from commit 60548c554be2830d29d2533dad0ac8133347ee51)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      027063b1
  5. 12 7月, 2018 1 次提交
    • C
      drm/i915: Silence warning for no vlv powercontext · 818fed4f
      Chris Wilson 提交于
      Along a module load error path, we may try to cleanup the powercontext
      even before we have allocated it.  Reorganising GT powermanagement is an
       on going process, so for simplicity handle it.
      
      [  522.733832] WARN_ON(!dev_priv->vlv_pctx)
      [  522.733986] WARNING: CPU: 1 PID: 3856 at drivers/gpu/drm/i915/intel_pm.c:7350 intel_cleanup_gt_powersave+0x5f/0x70 [i915]
      [  522.733991] Modules linked in: i915(+) vgem snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic btusb btrtl btbcm btintel intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul bluetooth snd_hda_codec ghash_clmulni_intel snd_hwdep snd_hda_core ecdh_generic lpc_ich r8169 snd_pcm mii i2c_hid prime_numbers [last unloaded: i915]
      [  522.734105] CPU: 1 PID: 3856 Comm: drv_module_relo Tainted: G     U            4.18.0-rc4-CI-CI_DRM_4474+ #1
      [  522.734110] Hardware name: \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff/DN2820FYK, BIOS FYBYT10H.86A.0059.2017.0607.2130 06/07/2017
      [  522.734193] RIP: 0010:intel_cleanup_gt_powersave+0x5f/0x70 [i915]
      [  522.734197] Code: 00 74 0d 48 c7 83 68 a6 00 00 00 00 00 00 eb c8 e8 36 6f 37 e1 eb ec 48 c7 c6 c5 7a 3d a0 48 c7 c7 b5 78 3d a0 e8 71 04 e0 e0 <0f> 0b eb aa 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 f3 c3 0f 1f 40
      [  522.734445] RSP: 0018:ffffc900004f3af0 EFLAGS: 00010282
      [  522.734453] RAX: 0000000000000000 RBX: ffff880106360000 RCX: 0000000000000001
      [  522.734458] RDX: 0000000080000001 RSI: ffffffff820c65c4 RDI: 00000000ffffffff
      [  522.734463] RBP: ffff880106360000 R08: 000000009f79baee R09: 0000000000000000
      [  522.734467] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88013b3133f8
      [  522.734472] R13: 00000000ffffffed R14: ffff880106360d58 R15: ffff88013b3133f8
      [  522.734477] FS:  00007f43f70af980(0000) GS:ffff88013fd00000(0000) knlGS:0000000000000000
      [  522.734481] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  522.734486] CR2: 000055a13a787580 CR3: 00000001325e6000 CR4: 00000000001006e0
      [  522.734490] Call Trace:
      [  522.734595]  intel_modeset_cleanup+0xcf/0x140 [i915]
      [  522.734682]  i915_driver_load+0xc85/0x10a0 [i915]
      [  522.734694]  ? _raw_spin_unlock_irqrestore+0x4c/0x60
      [  522.734703]  ? trace_hardirqs_on_caller+0xe0/0x1b0
      [  522.734790]  i915_pci_probe+0x29/0x90 [i915]
      [  522.734801]  pci_device_probe+0xa1/0x130
      [  522.734813]  driver_probe_device+0x306/0x480
      [  522.734824]  __driver_attach+0xdb/0x100
      [  522.734830]  ? driver_probe_device+0x480/0x480
      [  522.734836]  ? driver_probe_device+0x480/0x480
      [  522.734844]  bus_for_each_dev+0x74/0xc0
      [  522.734855]  bus_add_driver+0x15f/0x250
      [  522.734863]  ? 0xffffffffa0793000
      [  522.734870]  driver_register+0x56/0xe0
      [  522.734877]  ? 0xffffffffa0793000
      [  522.734883]  do_one_initcall+0x58/0x370
      [  522.734893]  ? do_init_module+0x1d/0x1ea
      [  522.734900]  ? rcu_read_lock_sched_held+0x6f/0x80
      [  522.734906]  ? kmem_cache_alloc_trace+0x282/0x2e0
      [  522.734918]  do_init_module+0x56/0x1ea
      [  522.734927]  load_module+0x2435/0x2b20
      [  522.734965]  ? __se_sys_finit_module+0xd3/0xf0
      [  522.734972]  __se_sys_finit_module+0xd3/0xf0
      [  522.734995]  do_syscall_64+0x55/0x190
      [  522.735003]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
      [  522.735009] RIP: 0033:0x7f43f675d839
      [  522.735014] Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 1f f6 2c 00 f7 d8 64 89 01 48
      [  522.735260] RSP: 002b:00007ffe69384238 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
      [  522.735269] RAX: ffffffffffffffda RBX: 000056100e387090 RCX: 00007f43f675d839
      [  522.735273] RDX: 0000000000000000 RSI: 000056100e37bff0 RDI: 0000000000000003
      [  522.735278] RBP: 000056100e37bff0 R08: 0000000000000000 R09: 0000000000000000
      [  522.735282] R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000
      [  522.735286] R13: 000056100e37c890 R14: 0000000000000020 R15: 0000000000000027
      [  522.735309] irq event stamp: 1389594
      [  522.735316] hardirqs last  enabled at (1389593): [<ffffffff810f896c>] console_unlock+0x3fc/0x600
      [  522.735323] hardirqs last disabled at (1389594): [<ffffffff81a0111c>] error_entry+0x7c/0x100
      [  522.735329] softirqs last  enabled at (13893567): [<ffffffff81c0034f>] __do_softirq+0x34f/0x505
      [  522.735336] softirqs last disabled at (1389335): [<ffffffff8108c7b9>] irq_exit+0xa9/0xc0
      [  522.735432] WARNING: CPU: 1 PID: 3856 at drivers/gpu/drm/i915/intel_pm.c:7350 intel_cleanup_gt_powersave+0x5f/0x70 [i915]
      
      Testcase: igt/drv_module_reload/basic-reload-inject
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180712105454.16091-1-chris@chris-wilson.co.uk
      818fed4f
  6. 07 6月, 2018 1 次提交
  7. 05 6月, 2018 1 次提交
  8. 11 5月, 2018 2 次提交
  9. 28 4月, 2018 3 次提交
  10. 09 4月, 2018 9 次提交
  11. 06 4月, 2018 2 次提交
  12. 23 3月, 2018 1 次提交
  13. 09 3月, 2018 1 次提交
  14. 08 3月, 2018 1 次提交
  15. 07 3月, 2018 2 次提交
  16. 01 3月, 2018 1 次提交
  17. 28 2月, 2018 1 次提交
  18. 22 2月, 2018 1 次提交
  19. 21 2月, 2018 1 次提交
  20. 20 2月, 2018 1 次提交
  21. 14 2月, 2018 2 次提交
  22. 10 2月, 2018 2 次提交
  23. 08 2月, 2018 1 次提交
  24. 07 2月, 2018 2 次提交