1. 18 4月, 2017 1 次提交
  2. 15 4月, 2017 2 次提交
  3. 14 4月, 2017 2 次提交
    • D
      drm/i915: checking for NULL instead of IS_ERR() in mock selftests · be02f755
      Dan Carpenter 提交于
      i915_gem_request_alloc() uses error pointers.  It never returns NULLs.
      
      Fixes: 0daf0113 ("drm/i915: Mock infrastructure for request emission")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170413195217.GA26108@mwandaReviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      be02f755
    • M
      drm/i915: Implement Link Rate fallback on Link training failure · 9301397a
      Manasi Navare 提交于
      If link training at a link rate optimal for a particular
      mode fails during modeset's atomic commit phase, then we
      let the modeset complete and then retry. We save the link rate
      value at which link training failed, update the link status property
      to "BAD" and use a lower link rate to prune the modes. It will redo
      the modeset on the current mode at lower link rate or if the current
      mode gets pruned due to lower link constraints then, it will send a
      hotplug uevent for userspace to handle it.
      
      This is also required to pass DP CTS tests 4.3.1.3, 4.3.1.4,
      4.3.1.6.
      
      This patch is a resend of the original commit id (233ce881
      "drm/i915: Implement Link Rate fallback on Link training failure")
      which got reverted in this commit id (afc1ebf4 Revert
      "drm/i915: Implement Link Rate fallback on Link training failure")
      due to CI failures.
      
      After investigating the CI failures it was found that these
      were essentially the failures which were always there but hidden because
      they used to be DRM_DEBUG_KMS messages for link failures so never got
      caught by CI. But now this patch actually throws DRM_ERROR if the link
      training fails at RBR and 1 lane. So it caught these link train failures.
      
      There were two failures:
      1. On SKL 6700k this was because the machine in CI lab is a SKL desktop
      without eDP on Port A. But our VBT initialization code in the driver writes
      VBT defaults in a way that it always sets DP flag on Port A and this does
      not get cleared after parsing the VBT outputs. This has been fixed in
      commit id (bb1d1329 "drm/i915/vbt: split out defaults that are set
      when there is no VBT) and (66578857 "drm/i915/vbt: don't propagate
      errors from intel_bios_init())
      
      2. On ILK-650 desktop - This was happening because of a bad monitor desktop
      combination. I switched the monitor in the CI lab and that helped get rid
      of the link failures on ILK system.
      
      v10:
      * Rebase on drm-tip and resend after revert
      v9:
      * Use the trimmed max values of link rate/lane count based on
      link train fallback (Daniel Vetter)
      v8:
      * Set link_status to BAD first and then call mode_valid (Jani Nikula)
      v7:
      Remove the redundant variable in previous patch itself
      v6:
      * Obtain link rate index from fallback_link_rate using
      the helper intel_dp_link_rate_index (Jani Nikula)
      * Include fallback within intel_dp_start_link_train (Jani Nikula)
      v5:
      * Move set link status to drm core (Daniel Vetter, Jani Nikula)
      v4:
      * Add fallback support for non DDI platforms too
      * Set connector->link status inside set_link_status function
      (Jani Nikula)
      v3:
      * Set link status property to BAd unconditionally (Jani Nikula)
      * Dont use two separate variables link_train_failed and link_status
      to indicate same thing (Jani Nikula)
      v2:
      * Squashed a few patches (Jani Nikula)
      Acked-by: NTony Cheng <tony.cheng@amd.com>
      Acked-by: NHarry 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>
      Signed-off-by: NManasi Navare <manasi.d.navare@intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/16ca48b1e74c618929245e9a085b9e3483c3a16d.1491485983.git.jani.nikula@intel.com
      9301397a
  4. 13 4月, 2017 3 次提交
    • V
      drm/i915: Perform link quality check unconditionally during long pulse · 1a36147b
      Ville Syrjälä 提交于
      Apparently some DP sinks are a little nuts and cause HPD to drop
      intermittently during modesets. This happens eg. on an ASUS PB287Q.
      In oder to recover from this we can't really use the previous
      connector status to determine if the link needs retraining, so let's
      just ignore that piece of information and do the retrain
      unconditionally. We do of course still check whether the link is
      supposed to be running or not.
      
      To actually get read out the EDID and update things properly we
      also need to nuke the goto out added by commit 7d23e3c3
      ("drm/i915: Cleaning up intel_dp_hpd_pulse"). I'm actually not sure
      why that was there. Perhaps to avoid an EDID read if the connector
      status didn't appear to change, but that sort of thing is quite racy
      and would have failed anyway if we failed to keep up with the
      hotplugs (if we missed the HPD down in between two HPD ups). And
      now that we take this codepath unconditionally we definitely need
      to drop the goto as otherwise we would never do the EDID read.
      
      v2: Drop the goto that made us skip EDID reads entirely. Doh!
      v3: Rebase due to locking changes
          s/apparely/apparently/ in the comment (Chris)
      
      Cc: stable@vger.kernel.org
      Cc: Manasi Navare <manasi.d.navare@intel.com>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Reported-by: NPalmer Dabbelt <palmer@dabbelt.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99766
      References: https://lists.freedesktop.org/archives/intel-gfx/2017-February/119779.htmlSigned-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170412193017.21029-1-ville.syrjala@linux.intel.com
      1a36147b
    • D
      drm/i915/guc: write wopcm related register once during uc init · 13f6c719
      daniele.ceraolospurio@intel.com 提交于
      The wopcm registers are write-once, so any write after the first one
      will just be ignored. The registers survive a GPU reset but not
      always a suspend/resume cycle, so to keep things simple keep the
      writes in the intel_uc_init_hw function instead of moving it earlier
      to make sure we attempt them every time we try to load GuC.
      
      Cc: Jeff McGee <jeff.mcgee@intel.com>
      Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
      Signed-off-by: NDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1491524332-23860-1-git-send-email-daniele.ceraolospurio@intel.com
      13f6c719
    • C
      drm/i915: Fix use after free in lpe_audio_platdev_destroy() · 48ae8074
      Chris Wilson 提交于
      [31908.547136] BUG: KASAN: use-after-free in intel_lpe_audio_teardown+0x78/0xb0 [i915] at addr ffff8801f7788358
      [31908.547297] Read of size 8 by task drv_selftest/3781
      [31908.547405] CPU: 0 PID: 3781 Comm: drv_selftest Tainted: G    BU  W       4.10.0+ #451
      [31908.547553] Hardware name:                  /        , BIOS PYBSWCEL.86A.0027.2015.0507.1758 05/07/2015
      [31908.547682] Call Trace:
      [31908.547772]  dump_stack+0x68/0x9f
      [31908.547857]  kasan_object_err+0x1c/0x70
      [31908.547947]  kasan_report_error+0x1f1/0x4f0
      [31908.548038]  ? kfree+0xaa/0x170
      [31908.548121]  kasan_report+0x34/0x40
      [31908.548211]  ? klist_children_get+0x20/0x30
      [31908.548472]  ? intel_lpe_audio_teardown+0x78/0xb0 [i915]
      [31908.548567]  __asan_load8+0x5e/0x70
      [31908.548824]  intel_lpe_audio_teardown+0x78/0xb0 [i915]
      [31908.549080]  intel_audio_deinit+0x28/0x80 [i915]
      [31908.549315]  i915_driver_unload+0xe4/0x360 [i915]
      [31908.549551]  ? i915_driver_load+0x1d70/0x1d70 [i915]
      [31908.549651]  ? trace_hardirqs_on+0xd/0x10
      [31908.549885]  i915_pci_remove+0x23/0x30 [i915]
      [31908.549978]  pci_device_remove+0x5c/0x100
      [31908.550069]  device_release_driver_internal+0x1db/0x2e0
      [31908.550165]  driver_detach+0x68/0xc0
      [31908.550256]  bus_remove_driver+0x8b/0x150
      [31908.550346]  driver_unregister+0x3e/0x60
      [31908.550439]  pci_unregister_driver+0x1d/0x110
      [31908.550531]  ? find_module_all+0x7a/0xa0
      [31908.550791]  i915_exit+0x1a/0x87 [i915]
      [31908.550881]  SyS_delete_module+0x264/0x2c0
      [31908.550971]  ? free_module+0x430/0x430
      [31908.551064]  ? trace_hardirqs_off_caller+0x16/0x110
      [31908.551159]  ? trace_hardirqs_on_caller+0x16/0x280
      [31908.551256]  ? trace_hardirqs_on_thunk+0x1a/0x1c
      [31908.551350]  entry_SYSCALL_64_fastpath+0x1c/0xb1
      [31908.551440] RIP: 0033:0x7f1d67312ec7
      [31908.551520] RSP: 002b:00007ffebe34e888 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
      [31908.551650] RAX: ffffffffffffffda RBX: ffffffff811123f6 RCX: 00007f1d67312ec7
      [31908.551743] RDX: 0000000000000000 RSI: 0000000000000800 RDI: 0000560d0af476b8
      [31908.551837] RBP: ffff880233d87f98 R08: 0000000000000000 R09: 00007ffebe34e8b8
      [31908.551930] R10: 00007f1d68adf8c0 R11: 0000000000000206 R12: 0000000000000000
      [31908.552023] R13: 0000560d0af46440 R14: 0000000000000034 R15: 00007ffebe34d860
      [31908.552121]  ? trace_hardirqs_off_caller+0x16/0x110
      [31908.552217] Object at ffff8801f7788000, in cache kmalloc-2048 size: 2048
      [31908.552306] Allocated:
      [31908.552377] PID = 3781
      [31908.552456]  save_stack_trace+0x16/0x20
      [31908.552539]  kasan_kmalloc+0xee/0x190
      [31908.552627]  __kmalloc+0xdb/0x1b0
      [31908.552713]  platform_device_alloc+0x27/0x90
      [31908.552804]  platform_device_register_full+0x36/0x220
      [31908.553066]  intel_lpe_audio_init+0x41e/0x570 [i915]
      [31908.553320]  intel_audio_init+0xd/0x40 [i915]
      [31908.553552]  i915_driver_load+0x13f5/0x1d70 [i915]
      [31908.553788]  i915_pci_probe+0x65/0xe0 [i915]
      [31908.553881]  pci_device_probe+0xda/0x140
      [31908.553969]  driver_probe_device+0x400/0x660
      [31908.554058]  __driver_attach+0x11c/0x120
      [31908.554147]  bus_for_each_dev+0xe6/0x150
      [31908.554237]  driver_attach+0x26/0x30
      [31908.554325]  bus_add_driver+0x26b/0x3b0
      [31908.554412]  driver_register+0xce/0x190
      [31908.554502]  __pci_register_driver+0xaf/0xc0
      [31908.554589]  0xffffffffa0550063
      [31908.554675]  do_one_initcall+0x8b/0x1e0
      [31908.554764]  do_init_module+0x102/0x325
      [31908.554852]  load_module+0x3aad/0x45e0
      [31908.554944]  SyS_finit_module+0x169/0x1a0
      [31908.555033]  entry_SYSCALL_64_fastpath+0x1c/0xb1
      [31908.555119] Freed:
      [31908.555188] PID = 3781
      [31908.555266]  save_stack_trace+0x16/0x20
      [31908.555349]  kasan_slab_free+0xb0/0x180
      [31908.555436]  kfree+0xaa/0x170
      [31908.555520]  platform_device_release+0x76/0x80
      [31908.555610]  device_release+0x45/0xe0
      [31908.555698]  kobject_put+0x11f/0x260
      [31908.555785]  put_device+0x12/0x20
      [31908.555871]  platform_device_unregister+0x1b/0x20
      [31908.556135]  intel_lpe_audio_teardown+0x5c/0xb0 [i915]
      [31908.556390]  intel_audio_deinit+0x28/0x80 [i915]
      [31908.556622]  i915_driver_unload+0xe4/0x360 [i915]
      [31908.556858]  i915_pci_remove+0x23/0x30 [i915]
      [31908.556948]  pci_device_remove+0x5c/0x100
      [31908.557037]  device_release_driver_internal+0x1db/0x2e0
      [31908.557129]  driver_detach+0x68/0xc0
      [31908.557217]  bus_remove_driver+0x8b/0x150
      [31908.557304]  driver_unregister+0x3e/0x60
      [31908.557394]  pci_unregister_driver+0x1d/0x110
      [31908.557653]  i915_exit+0x1a/0x87 [i915]
      [31908.557741]  SyS_delete_module+0x264/0x2c0
      [31908.557834]  entry_SYSCALL_64_fastpath+0x1c/0xb1
      [31908.557919] Memory state around the buggy address:
      [31908.558005]  ffff8801f7788200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [31908.558127]  ffff8801f7788280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [31908.558255] >ffff8801f7788300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [31908.558374]                                                     ^
      [31908.558467]  ffff8801f7788380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [31908.558595]  ffff8801f7788400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      
      v2: Just leak the memory (8 bytes) as freeing it ourselves is not safe,
      and we need to coordinate a proper fix in platform_device itself.
      
      Fixes: eef57324 ("drm/i915: setup bridge for HDMI LPE audio driver")
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99952Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Cc: Jerome Anand <jerome.anand@intel.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170412080251.30648-1-chris@chris-wilson.co.ukReviewed-by: NTakashi Iwai <tiwai@suse.de>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      48ae8074
  5. 12 4月, 2017 19 次提交
  6. 11 4月, 2017 13 次提交