1. 01 Jun, 2016 3 commits
  2. 31 May, 2016 1 commit
  3. 30 May, 2016 7 commits
  4. 27 May, 2016 1 commit
  5. 26 May, 2016 2 commits
    • Ander Conselvan de Oliveira's avatar
      drm/i915: Fix NULL pointer deference when out of PLLs in IVB · bb143165
      Ander Conselvan de Oliveira authored
      In commit f9476a6c ("drm/i915: Refactor platform specifics out of
      intel_get_shared_dpll()"), the ibx_get_dpll() function lacked an error
      check, that can lead to a NULL pointer dereference when trying to enable
      three pipes.
      
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000068
      IP: [<ffffffffa0482275>] intel_reference_shared_dpll+0x15/0x100 [i915]
      PGD cec87067 PUD d30ce067 PMD 0
      Oops: 0000 [#1] PREEMPT SMP
      Modules linked in: snd_hda_intel i915 drm_kms_helper drm intel_gtt sch_fq_codel cfg80211 binfmt_misc i2c_algo_bit cfbfillrect syscopyarea cfbimgblt sysfillrect sysimgblt fb_sys_fops cfbcopyarea intel_rapl iosf_mbi x86_pkg_temp_thermal coretemp agpgart kvm_intel snd_hda_codec_hdmi kvm iTCO_wdt snd_hda_codec_realtek snd_hda_codec_generic irqbypass aesni_intel aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd psmouse pcspkr snd_hda_codec i2c_i801 snd_hwdep snd_hda_core snd_pcm snd_timer lpc_ich mfd_core snd soundcore wmi evdev tpm_tis tpm [last unloaded: drm]
      CPU: 3 PID: 5810 Comm: kms_flip Tainted: G     U  W       4.6.0-test+ #3
      Hardware name:                  /DZ77BH-55K, BIOS BHZ7710H.86A.0100.2013.0517.0942 05/17/2013
      task: ffff8800d3908040 ti: ffff8801166c8000 task.ti: ffff8801166c8000
      RIP: 0010:[<ffffffffa0482275>]  [<ffffffffa0482275>] intel_reference_shared_dpll+0x15/0x100 [i915]
      RSP: 0018:ffff8801166cba60  EFLAGS: 00010246
      RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000002
      RDX: 0000000000000001 RSI: ffff8800d07f1bf8 RDI: 0000000000000000
      RBP: ffff8801166cba88 R08: 0000000000000002 R09: ffff8800d32e5698
      R10: 0000000000000001 R11: ffff8800cc89ac88 R12: ffff8800d07f1bf8
      R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
      FS:  00007f4c3fc8d8c0(0000) GS:ffff88011bcc0000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000068 CR3: 00000000d3b4c000 CR4: 00000000001406e0
      Stack:
       0000000000000000 ffff8800d07f1bf8 0000000000000000 ffff8800d04c0000
       0000000000000000 ffff8801166cbaa8 ffffffffa04823a7 ffff8800d07f1bf8
       ffff8800d32e5698 ffff8801166cbab8 ffffffffa04840cf ffff8801166cbaf0
      Call Trace:
       [<ffffffffa04823a7>] ibx_get_dpll+0x47/0xa0 [i915]
       [<ffffffffa04840cf>] intel_get_shared_dpll+0x1f/0x50 [i915]
       [<ffffffffa046d080>] ironlake_crtc_compute_clock+0x280/0x430 [i915]
       [<ffffffffa0472ac0>] intel_crtc_atomic_check+0x240/0x320 [i915]
       [<ffffffffa03da18e>] drm_atomic_helper_check_planes+0x14e/0x1d0 [drm_kms_helper]
       [<ffffffffa0474a0c>] intel_atomic_check+0x5dc/0x1110 [i915]
       [<ffffffffa029d3aa>] drm_atomic_check_only+0x14a/0x660 [drm]
       [<ffffffffa029d086>] ? drm_atomic_set_crtc_for_connector+0x96/0x100 [drm]
       [<ffffffffa029d8d7>] drm_atomic_commit+0x17/0x60 [drm]
       [<ffffffffa03dc3b7>] restore_fbdev_mode+0x237/0x260 [drm_kms_helper]
       [<ffffffffa029c65a>] ? drm_modeset_lock_all_ctx+0x9a/0xb0 [drm]
       [<ffffffffa03de9b3>] drm_fb_helper_restore_fbdev_mode_unlocked+0x33/0x80 [drm_kms_helper]
       [<ffffffffa03dea2d>] drm_fb_helper_set_par+0x2d/0x50 [drm_kms_helper]
       [<ffffffffa03de93a>] drm_fb_helper_hotplug_event+0xaa/0xf0 [drm_kms_helper]
       [<ffffffffa03de9d6>] drm_fb_helper_restore_fbdev_mode_unlocked+0x56/0x80 [drm_kms_helper]
       [<ffffffffa0490f72>] intel_fbdev_restore_mode+0x22/0x80 [i915]
       [<ffffffffa04ba45e>] i915_driver_lastclose+0xe/0x20 [i915]
       [<ffffffffa02810de>] drm_lastclose+0x2e/0x130 [drm]
       [<ffffffffa028148c>] drm_release+0x2ac/0x4b0 [drm]
       [<ffffffff811a6b2d>] __fput+0xed/0x1f0
       [<ffffffff811a6c6e>] ____fput+0xe/0x10
       [<ffffffff81079156>] task_work_run+0x76/0xb0
       [<ffffffff8105aaab>] do_exit+0x3ab/0xc60
       [<ffffffff810a145f>] ? trace_hardirqs_on_caller+0x12f/0x1c0
       [<ffffffff8105c67e>] do_group_exit+0x4e/0xc0
       [<ffffffff8105c704>] SyS_exit_group+0x14/0x20
       [<ffffffff8158bb25>] entry_SYSCALL_64_fastpath+0x18/0xa8
      Code: 14 80 48 8d 34 90 b8 01 00 00 00 d3 e0 09 04 b3 5b 41 5c 5d c3 90 0f 1f 44 00 00 55 48 89 e5 41 57 41 56 49 89 fe 41 55 41 54 53 <44> 8b 67 68 48 89 f3 48 8b be 08 02 00 00 4c 8b 2e e8 15 9d fd
      RIP  [<ffffffffa0482275>] intel_reference_shared_dpll+0x15/0x100 [i915]
       RSP <ffff8801166cba60>
      CR2: 0000000000000068
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: drm-intel-fixes@lists.freedesktop.org
      Reported-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Fixes: f9476a6c ("drm/i915: Refactor platform specifics out of intel_get_shared_dpll()")
      Signed-off-by: default avatarAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Tested-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1463748426-5956-1-git-send-email-ander.conselvan.de.oliveira@intel.com
      bb143165
    • Lyude's avatar
      drm/i915/ilk: Don't disable SSC source if it's in use · f165d283
      Lyude authored
      Thanks to Ville Syrjälä for pointing me towards the cause of this issue.
      
      Unfortunately one of the sideaffects of having the refclk for a DPLL set
      to SSC is that as long as it's set to SSC, the GPU will prevent us from
      powering down any of the pipes or transcoders using it. A couple of
      BIOSes enable SSC in both PCH_DREF_CONTROL and in the DPLL
      configurations. This causes issues on the first modeset, since we don't
      expect SSC to be left on and as a result, can't successfully power down
      the pipes or the transcoders using it. Here's an example from this Dell
      OptiPlex 990:
      
      [drm:intel_modeset_init] SSC enabled by BIOS, overriding VBT which says disabled
      [drm:intel_modeset_init] 2 display pipes available.
      [drm:intel_update_cdclk] Current CD clock rate: 400000 kHz
      [drm:intel_update_max_cdclk] Max CD clock rate: 400000 kHz
      [drm:intel_update_max_cdclk] Max dotclock rate: 360000 kHz
      vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
      [drm:intel_crt_reset] crt adpa set to 0xf40000
      [drm:intel_dp_init_connector] Adding DP connector on port C
      [drm:intel_dp_aux_init] registering DPDDC-C bus for card0-DP-1
      [drm:ironlake_init_pch_refclk] has_panel 0 has_lvds 0 has_ck505 0
      [drm:ironlake_init_pch_refclk] Disabling SSC entirely
      … later we try committing the first modeset …
      [drm:intel_dump_pipe_config] [CRTC:26][modeset] config ffff88041b02e800 for pipe A
      [drm:intel_dump_pipe_config] cpu_transcoder: A
      …
      [drm:intel_dump_pipe_config] dpll_hw_state: dpll: 0xc4016001, dpll_md: 0x0, fp0: 0x20e08, fp1: 0x30d07
      [drm:intel_dump_pipe_config] planes on this crtc
      [drm:intel_dump_pipe_config] STANDARD PLANE:23 plane: 0.0 idx: 0 enabled
      [drm:intel_dump_pipe_config]     FB:42, fb = 800x600 format = 0x34325258
      [drm:intel_dump_pipe_config]     scaler:0 src (0, 0) 800x600 dst (0, 0) 800x600
      [drm:intel_dump_pipe_config] CURSOR PLANE:25 plane: 0.1 idx: 1 disabled, scaler_id = 0
      [drm:intel_dump_pipe_config] STANDARD PLANE:27 plane: 0.1 idx: 2 disabled, scaler_id = 0
      [drm:intel_get_shared_dpll] CRTC:26 allocated PCH DPLL A
      [drm:intel_get_shared_dpll] using PCH DPLL A for pipe A
      [drm:ilk_audio_codec_disable] Disable audio codec on port C, pipe A
      [drm:intel_disable_pipe] disabling pipe A
      ------------[ cut here ]------------
      WARNING: CPU: 1 PID: 130 at drivers/gpu/drm/i915/intel_display.c:1146 intel_disable_pipe+0x297/0x2d0 [i915]
      pipe_off wait timed out
      …
      ---[ end trace 94fc8aa03ae139e8 ]---
      [drm:intel_dp_link_down]
      [drm:ironlake_crtc_disable [i915]] *ERROR* failed to disable transcoder A
      
      Later modesets succeed since they reset the DPLL's configuration anyway,
      but this is enough to get stuck with a big fat warning in dmesg.
      
      A better solution would be to add refcounts for the SSC source, but for
      now leaving the source clock on should suffice.
      
      Changes since v3:
       - Move temp variable into loop
       - Move checks for using_ssc_source to after we've figured out has_ck505
       - Add using_ssc_source to debug output
      Changes since v2:
       - Fix debug output for when we disable the CPU source
      Changes since v1:
       - Leave the SSC source clock on instead of just shutting it off on all
         of the DPLL configurations.
      
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarLyude <cpaul@redhat.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464199863-9397-1-git-send-email-cpaul@redhat.com
      f165d283
  6. 25 May, 2016 3 commits
    • Imre Deak's avatar
      drm/i915/bxt: Sanitize CDCLK to fix breakage during S4 resume · d66a2194
      Imre Deak authored
      I noticed that during S4 resume BIOS incorrectly sets bits 18, 19 which
      are reserved/MBZ and sets the decimal frequency fields to all 0xff in
      the CDCLK register. The result is a hard lockup as display register
      accesses are attempted later. Work around this by sanitizing the CDCLK
      PLL/dividers the same way it's done on SKL.
      
      While this is clearly a BIOS bug which should be fixed separately, it
      doesn't hurt to check/sanitize this regardless.
      
      v2:
      - Use the same condition for VCO and CDCLK in broxton_init_cdclk as is
        used in skl_init_cdclk for the same purpose.
      
      CC: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464093513-16258-2-git-send-email-imre.deak@intel.com
      d66a2194
    • Imre Deak's avatar
      drm/i915/gen9: Assume CDCLK PLL is off if it's not locked · 1c3f7700
      Imre Deak authored
      If the CDCLK PLL isn't locked or incorrectly configured we can just
      assume that it's off resulting in fully re-initializing both CDCLK PLL
      and CDCLK dividers. This way the CDCLK PLL sanitization added in the
      following patch can be done on BXT the same way as it's done on SKL.
      
      v2: (Ville)
      - Remove the remaining PLL specific checks from skl_sanitize_cdclk() and
        depend instead on the corresponding check in skl_dpll0_update().
      - Use vco == 0 instead of the corresponding boolean check in
        skl_sanitize_cdclk().
      
      CC: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464093513-16258-1-git-send-email-imre.deak@intel.com
      1c3f7700
    • Daniel Vetter's avatar
      drm/i915: Revert async unpin and nonblocking atomic commit · 5a21b665
      Daniel Vetter authored
      This reverts the following patches:
      
      d55dbd06 drm/i915: Allow nonblocking update of pageflips.
      15c86bdb drm/i915: Check for unpin correctness.
      95c2ccdc Reapply "drm/i915: Avoid stalling on pending flips for legacy cursor updates"
      a6747b73 drm/i915: Make unpin async.
      03f476e1 drm/i915: Prepare connectors for nonblocking checks.
      2099deff drm/i915: Pass atomic states to fbc update functions.
      ee7171af drm/i915: Remove reset_counter from intel_crtc.
      2ee004f7 drm/i915: Remove queue_flip pointer.
      b8d2afae drm/i915: Remove use_mmio_flip kernel parameter.
      8dd634d9 drm/i915: Remove cs based page flip support.
      143f73b3 drm/i915: Rework intel_crtc_page_flip to be almost atomic, v3.
      84fc494b drm/i915: Add the exclusive fence to plane_state.
      6885843a drm/i915: Convert flip_work to a list.
      aa420ddd drm/i915: Allow mmio updates on all platforms, v2.
      afee4d87 Revert "drm/i915: Avoid stalling on pending flips for legacy cursor updates"
      
      "drm/i915: Allow nonblocking update of pageflips" should have been
      split up, misses a proper commit message and seems to cause issues in
      the legacy page_flip path as demonstrated by kms_flip.
      
      "drm/i915: Make unpin async" doesn't handle the unthrottled cursor
      updates correctly, leading to an apparent pin count leak. This is
      caught by the WARN_ON in i915_gem_object_do_pin which screams if we
      have more than DRM_I915_GEM_OBJECT_MAX_PIN_COUNT pins.
      
      Unfortuantely we can't just revert these two because this patch series
      came with a built-in bisect breakage in the form of temporarily
      removing the unthrottled cursor update hack for legacy cursor ioctl.
      Therefore there's no other option than to revert the entire pile :(
      
      There's one tiny conflict in intel_drv.h due to other patches, nothing
      serious.
      
      Normally I'd wait a bit longer with doing a maintainer revert, but
      since the minimal set of patches we need to revert (due to the bisect
      breakage) is so big, time is running out fast. And very soon
      (especially after a few attempts at fixing issues) it'll be really
      hard to revert things cleanly.
      
      Lessons learned:
      - Not a good idea to rush the review (done by someone fairly new to
        the area) and not make sure domain experts had a chance to read it.
      
      - Patches should be properly split up. I only looked at the two
        patches that should be reverted in detail, but both look like the
        mix up different things in one patch.
      
      - Patches really should have proper commit messages. Especially when
        doing more than one thing, and especially when touching critical and
        tricky core code.
      
      - Building a patch series and r-b stamping it when it has a built-in
        bisect breakage is not a good idea.
      
      - I also think we need to stop building up technical debt by
        postponing atomic igt testcases even longer. I think it's clear that
        there's enough corner cases in this beast that we really need to
        have the testcases _before_ the next step lands.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
      Cc: John Harrison <John.C.Harrison@Intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Acked-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Acked-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Acked-by: default avatarDave Airlie <airlied@redhat.com>
      Acked-by: default avatarJani Nikula <jani.nikula@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      5a21b665
  7. 24 May, 2016 11 commits
  8. 23 May, 2016 12 commits