1. 08 Feb, 2018 5 commits
  2. 07 Feb, 2018 8 commits
  3. 06 Feb, 2018 2 commits
  4. 05 Feb, 2018 14 commits
  5. 02 Feb, 2018 7 commits
  6. 01 Feb, 2018 4 commits
    • Imre Deak's avatar
      drm/i915/bxt, glk: Avoid long atomic poll during CDCLK change · 006bb4cc
      Imre Deak authored
      There is no requirement for doing the PCODE request polling atomically,
      so do that only for a short time switching to sleeping poll afterwards.
      The specification requires a 150usec timeout for the change notification,
      so let's use that for the atomic poll. Do the extra 2ms poll - needed as
      a workaround on BXT/GLK - in sleeping mode.
      
      v2:
      - rebase on v2 of patchset dropping the sandybridge_pcode_read/write
        refactoring (Chris)
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180130142939.17983-2-imre.deak@intel.com
      006bb4cc
    • Imre Deak's avatar
      drm/i915/bxt, glk: Increase PCODE timeouts during CDCLK freq changing · e76019a8
      Imre Deak authored
      Currently we see sporadic timeouts during CDCLK changing both on BXT and
      GLK as reported by the Bugzilla: ticket. It's easy to reproduce this by
      changing the frequency in a tight loop after blanking the display. The
      upper bound for the completion time is 800us based on my tests, so
      increase it from the current 500us to 2ms; with that I couldn't trigger
      the problem either on BXT or GLK.
      
      Note that timeouts happened during both the change notification and the
      voltage level setting PCODE request. (For the latter one BSpec doesn't
      require us to wait for completion before further HW programming.)
      
      This issue is similar to
      commit 2c7d0602 ("drm/i915/gen9: Fix PCODE polling during CDCLK
      change notification")
      but there the PCODE request does complete (as shown by the mbox
      busy flag), only the reply we get from PCODE indicates a failure.
      So there we keep resending the request until a success reply, here we
      just have to increase the timeout for the one PCODE request we send.
      
      v2:
      - s/snb_pcode_request/sandybridge_pcode_write_timeout/ (Ville)
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v4.4+
      Acked-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103326Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180130142939.17983-1-imre.deak@intel.com
      e76019a8
    • Michal Wajdeczko's avatar
      drm/i915/guc: Don't try to create log runtime if there is no log · 28647b52
      Michal Wajdeczko authored
      In case of GuC initialization failure we may continue with driver
      load, but we wrongly assume that GuC is fully functional. This
      leads to the BUG as we attempt to access non-existing log vma.
      
      [26386.121085] BUG: unable to handle kernel NULL pointer dereference at 00000000000000a0
      [26386.121225] IP: guc_log_runtime_create+0x23/0xe0 [i915]
      [26386.121763] Call Trace:
      [26386.121870]  guc_log_late_setup+0xfd/0x140 [i915]
      [26386.121969]  i915_driver_load+0x7ab/0x1730 [i915]
      [26386.122069]  i915_pci_probe+0x2d/0x90 [i915]
      [26386.122089]  pci_device_probe+0x9c/0x120
      [26386.122107]  driver_probe_device+0x2a9/0x490
      [26386.122126]  __driver_attach+0xd9/0xe0
      [26386.122143]  ? driver_probe_device+0x490/0x490
      [26386.122158]  bus_for_each_dev+0x57/0x90
      [26386.122175]  bus_add_driver+0x1eb/0x260
      [26386.122190]  ? 0xffffffffa069a000
      [26386.122206]  driver_register+0x52/0xc0
      [26386.122220]  ? 0xffffffffa069a000
      [26386.122234]  do_one_initcall+0x39/0x170
      [26386.122252]  ? kmem_cache_alloc_trace+0x1fd/0x2e0
      [26386.122273]  do_init_module+0x56/0x1ec
      [26386.122289]  load_module+0x219e/0x2550
      [26386.122309]  ? vfs_read+0x121/0x140
      [26386.122331]  ? SyS_finit_module+0xa5/0xe0
      [26386.122346]  SyS_finit_module+0xa5/0xe0
      [26386.122371]  entry_SYSCALL_64_fastpath+0x22/0x8f
      Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Michal Winiarski <michal.winiarski@intel.com>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180131173241.19704-4-michal.wajdeczko@intel.comReviewed-by: default avatarSagar Arun Kamble <sagar.a.kamble@intel.com>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      28647b52
    • Michal Wajdeczko's avatar
      drm/i915/guc: Don't forget to free GuC error log · bf67ce62
      Michal Wajdeczko authored
      We're freeing GuC error log in uc_fini_hw() that matches
      corresponding uc_init_hw() but we missed the point that this
      log object is copied on error path and in case of failure in
      uc_init_hw() we will leak this object as uc_fini_hw() is
      never called.
      
      If we free this log object as part of the late uC cleanup, where
      we also release other firmware objects, we can avoid this BUG:
      
      [70841.001413] BUG drm_i915_gem_object (Tainted: G     U  W       ): Objects remaining in drm_i915_gem_object on __kmem_cache_shutdown()
      [70841.001436] INFO: Slab 0x00000000c94e41af objects=21 used=1 fp=0x000000001d60c40a flags=0x8000000000008100
      
      [70841.001466] Call Trace:
      [70841.001471]  dump_stack+0x5e/0x8e
      [70841.001476]  slab_err+0x99/0xb0
      [70841.001483]  ? __slab_alloc.isra.24.constprop.29+0x62/0x70
      [70841.001491]  ? __kmalloc+0x1f5/0x320
      [70841.001497]  __kmem_cache_shutdown+0x18b/0x400
      [70841.001505]  shutdown_cache+0x13/0x1c0
      [70841.001511]  kmem_cache_destroy+0x1c2/0x240
      [70841.001517]  ? __mutex_unlock_slowpath+0x38/0x270
      [70841.001559]  i915_gem_load_cleanup+0xbc/0x130 [i915]
      [70841.001595]  i915_driver_cleanup_early+0x11/0x60 [i915]
      [70841.001630]  i915_driver_load+0x708/0x1720 [i915]
      [70841.001638]  ? trace_hardirqs_on_caller+0xe2/0x1c0
      [70841.001673]  i915_pci_probe+0x2d/0x90 [i915]
      [70841.001680]  pci_device_probe+0x9c/0x120
      [70841.001687]  driver_probe_device+0x2a9/0x490
      [70841.001694]  __driver_attach+0xd9/0xe0
      [70841.001700]  ? driver_probe_device+0x490/0x490
      [70841.001705]  bus_for_each_dev+0x57/0x90
      [70841.001712]  bus_add_driver+0x1eb/0x260
      [70841.001717]  ? 0xffffffffa0685000
      [70841.001723]  driver_register+0x52/0xc0
      [70841.001728]  ? 0xffffffffa0685000
      [70841.001733]  do_one_initcall+0x39/0x170
      [70841.001739]  ? rcu_read_lock_sched_held+0x6f/0x80
      [70841.001746]  ? kmem_cache_alloc_trace+0x27b/0x2e0
      [70841.001753]  do_init_module+0x56/0x1ec
      [70841.001759]  load_module+0x219e/0x2550
      [70841.001766]  ? vfs_read+0x121/0x140
      [70841.001774]  ? SyS_finit_module+0xa5/0xe0
      [70841.001779]  SyS_finit_module+0xa5/0xe0
      [70841.001788]  entry_SYSCALL_64_fastpath+0x22/0x8f
      
      [70841.001806] INFO: Object 0x00000000eab7ed96 @offset=6208
      [70841.001850] INFO: Allocated in i915_gem_object_create.part.32+0x1f/0x260 [i915] age=38 cpu=0 pid=2708
      [70841.001861] 	kmem_cache_alloc+0x23d/0x2d0
      [70841.001897] 	i915_gem_object_create.part.32+0x1f/0x260 [i915]
      [70841.001937] 	intel_guc_allocate_vma+0x15/0x100 [i915]
      [70841.001977] 	intel_guc_log_create+0x34/0x1c0 [i915]
      [70841.002014] 	intel_guc_init+0x5a/0x100 [i915]
      [70841.002051] 	intel_uc_init+0x3e/0xb0 [i915]
      [70841.002089] 	i915_gem_init+0x18e/0x540 [i915]
      [70841.002123] 	i915_driver_load+0xa7a/0x1720 [i915]
      [70841.002159] 	i915_pci_probe+0x2d/0x90 [i915]
      [70841.002165] 	pci_device_probe+0x9c/0x120
      [70841.002171] 	driver_probe_device+0x2a9/0x490
      [70841.002177] 	__driver_attach+0xd9/0xe0
      [70841.002182] 	bus_for_each_dev+0x57/0x90
      [70841.002188] 	bus_add_driver+0x1eb/0x260
      [70841.002193] 	driver_register+0x52/0xc0
      [70841.002198] 	do_one_initcall+0x39/0x170
      [70841.002462] kmem_cache_destroy drm_i915_gem_object: Slab cache still has objects
      
      [70841.002491] Call Trace:
      [70841.002497]  dump_stack+0x5e/0x8e
      [70841.002503]  kmem_cache_destroy+0x1e0/0x240
      [70841.002509]  ? __mutex_unlock_slowpath+0x38/0x270
      [70841.002551]  i915_gem_load_cleanup+0xbc/0x130 [i915]
      [70841.002586]  i915_driver_cleanup_early+0x11/0x60 [i915]
      [70841.002621]  i915_driver_load+0x708/0x1720 [i915]
      [70841.002629]  ? trace_hardirqs_on_caller+0xe2/0x1c0
      [70841.002664]  i915_pci_probe+0x2d/0x90 [i915]
      [70841.002671]  pci_device_probe+0x9c/0x120
      [70841.002678]  driver_probe_device+0x2a9/0x490
      [70841.002684]  __driver_attach+0xd9/0xe0
      [70841.002690]  ? driver_probe_device+0x490/0x490
      [70841.002696]  bus_for_each_dev+0x57/0x90
      [70841.002702]  bus_add_driver+0x1eb/0x260
      [70841.002708]  ? 0xffffffffa0685000
      [70841.002713]  driver_register+0x52/0xc0
      [70841.002719]  ? 0xffffffffa0685000
      [70841.002724]  do_one_initcall+0x39/0x170
      [70841.002731]  ? rcu_read_lock_sched_held+0x6f/0x80
      [70841.002737]  ? kmem_cache_alloc_trace+0x27b/0x2e0
      [70841.002745]  do_init_module+0x56/0x1ec
      [70841.002751]  load_module+0x219e/0x2550
      [70841.002758]  ? vfs_read+0x121/0x140
      [70841.002766]  ? SyS_finit_module+0xa5/0xe0
      [70841.002772]  SyS_finit_module+0xa5/0xe0
      [70841.002781]  entry_SYSCALL_64_fastpath+0x22/0x8f
      Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
      Cc: Michal Winiarski <michal.winiarski@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180131173241.19704-2-michal.wajdeczko@intel.comReviewed-by: default avatarSagar Arun Kamble <sagar.a.kamble@intel.com>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      bf67ce62