1. 12 Dec, 2013 4 commits
    • Mika Kuoppala's avatar
      drm/i915: Fix timeout with missed interrupts in __wait_seqno · 47e9766d
      Mika Kuoppala authored
      Commit 094f9a54 ("drm/i915: Fix __wait_seqno to use true infinite
      timeouts") added support for __wait_seqno to detect missing interrupts and
      go around them by polling. As there is also timeout detection in
      __wait_seqno, the polling and timeout detection were done with the same
      timer.
      
      When there has been missed interrupts and polling is needed, the timer is
      set to trigger in (now + 1) jiffies in future, instead of the caller
      specified timeout.
      
      Now when io_schedule() returns, we calculate the jiffies left to timeout
      using the timer expiration value. As the current jiffies is now bound to be
      always equal or greater than the expiration value, the timeout_jiffies will
      become zero or negative and we return -ETIME to caller even tho the
      timeout was never reached.
      
      Fix this by decoupling timeout calculation from timer expiration.
      
      v2: Commit message with some sense in it (Chris Wilson)
      
      v3: add parenthesis on timeout_expire calculation
      
      v4: don't read jiffies without timeout (Chris Wilson)
      Signed-off-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      47e9766d
    • Paulo Zanoni's avatar
      drm/i915: touch VGA MSR after we enable the power well · f9dcb0df
      Paulo Zanoni authored
      Fixes regression introduced by:
          commit bf51d5e2
          Author: Paulo Zanoni <paulo.r.zanoni at intel.com>
          Date:   Wed Jul 3 17:12:13 2013 -0300
              drm/i915: switch disable_power_well default value to 1
      
      The bug I'm seeing can be reproduced with:
        - Have vgacon configured/enabled
        - Make sure the power well gets disabled, then enabled. You can
          check this by seeing the messages print by hsw_set_power_well
        - Stop your display manager
        - echo 0 > /sys/class/vtconsole/vtcon1/bind
      
      I can easily reproduce this by blacklising snd_hda_intel and booting
      with eDP+HDMI.
      
      If you do this and then look at dmesg, you'll see we're printing
      infinite "Unclaimed register" messages. This is happening because
      we're stuck on an infinite loop inside console_unlock(), which is
      calling many functions from vgacon.c. And the code that's triggering
      the error messages is from vgacon_set_cursor_size().
      
      After we re-enable the power well, every time we read/write the VGA
      address 0x3d5 we get an "unclaimed register" interrupt (ERR_INT) and
      print error messages. If we write anything to the VGA MSR register (it
      doesn't really matter which value you write to bit 0), any
      reads/writes to 0x3d5 _don't_ trigger the "unclaimed register" errors
      anymore (even if MSR bit 0 is zero). So what happens with the current
      code is that when we unbind i915 and bind vgacon, we call
      console_unlock(). Function console_unlock() is responsible for
      printing any messages that were supposed to be print when the console
      was locked, so it calls the TTY layer, which calls the console layer,
      which calls vgacon to print the messages. At this point, vgacon
      eventually calls vgacon_set_cursor_size(), which touches 0x3d5, which
      triggers unclaimed register interrupts. The problem is that when we
      get these interrupts, we print the error messages, so we add more work
      to console_unlock(), which will try to print it again, and then call
      vgacon again, trigger a new interrupt, which will put more stuff to
      the buffer, and then we'll be stuck at console_unlock() forever.
      
      If you patch intel_uncore.c to not print anything when we detect
      unclaimed registers, we won't get into the console_unlock() infinite
      loop and the driver unbind will work just fine. We will still be
      getting interrupts every time vgacon touches those registers, but we
      will survive. This is a valid experiment, but IMHO it's not the real
      fix: if we don't print any error messages we will still keep getting
      the interrupts, and if we disable ERR_INT we won't get the interrupt
      anymore, but we will also stop getting all the other error interrupts.
      
      I talked about this problem with the HW engineer and his
      recommendation is "So don't do any VGA I/O or memory access while the
      power well is disabled, and make to re-program MSR after enabling the
      power well and before using VGA I/O or memory accesses.".
      
      Notice that this is just a partial fix to fd.o #67813. This fixes the
      case where the power well is already enabled when we unbind, not when
      it's disabled when we unbind.
      
      V2: - Rebase (first version was sent in September).
      V3: - Complete rewrite of the same fix: smaller implementation,
            improved commit message.
      
      Testcase: igt/drv_module_reload
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67813Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      f9dcb0df
    • Paulo Zanoni's avatar
      drm/i915: extract hsw_power_well_post_{enable, disable} · d5e8fdc8
      Paulo Zanoni authored
      I want to add more code to the post_enable function.
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      d5e8fdc8
    • Paulo Zanoni's avatar
      drm/i915: remove i915_disable_vga_mem declaration · b6646074
      Paulo Zanoni authored
      It was supposed to have been killed on the same commit that killed the
      function, e1264ebe, but I guess the
      intel_drv.h reorganization accidentally brought it back.
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      b6646074
  2. 11 Dec, 2013 16 commits
  3. 10 Dec, 2013 14 commits
  4. 09 Dec, 2013 2 commits
    • Deepak S's avatar
      drm/i915: Remove duplicate intel_uncore_forcewake_reset. · c461562e
      Deepak S authored
      Since early sanitize and uncore sanitize are called one after the other,
      I think, we can remove second forcewake reset which was are calling
      twice in both the functions.
      
      Note that this is merge fallout between
      
      commit ef46e0d2
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Sat Nov 16 16:00:09 2013 +0100
      
          drm/i915: restore the early forcewake cleanup
      
      and
      
      commit 521198a2
      Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Date:   Fri Aug 23 16:52:30 2013 +0300
      
          drm/i915: sanitize forcewake registers on reset
      Signed-off-by: default avatarDeepak S <deepak.s@intel.com>
      [danvet: Explain how this came to be.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      c461562e
    • Daniel Vetter's avatar
      Merge tag 'v3.13-rc3' into drm-intel-next-queued · f7698ba7
      Daniel Vetter authored
      Linux 3.13-rc3
      
      I need a backmerge for two reasons:
      - For merging the ppgtt patches from Ben I need to pull in the bdw
        support.
      - We now have duplicated calls to intel_uncore_forcewake_reset in the
        setup code to due 2 different patches merged into -next and 3.13.
        The conflict is silen so I need the merge to be able to apply
        Deepak's fixup patch.
      
      Conflicts:
      	drivers/gpu/drm/i915/intel_display.c
      
      Trivial conflict, it doesn't even show up in the merge diff.
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      f7698ba7
  5. 06 Dec, 2013 4 commits
    • Paulo Zanoni's avatar
      drm/i915: change CRTC assertion on LCPLL disable · 798183c5
      Paulo Zanoni authored
      Currently, PC8 is enabled at modeset_global_resources, which is called
      after intel_modeset_update_state. Due to this, there's a small race
      condition on the case where we start enabling PC8, then do a modeset
      while PC8 is still being enabled. The racing condition triggers a WARN
      because intel_modeset_update_state will mark the CRTC as enabled, then
      the thread that's still enabling PC8 might look at the data structure
      and think that PC8 is being enabled while a pipe is enabled. Despite
      the WARN, this is not really a bug since we'll wait for the
      PC8-enabling thread to finish when we call modeset_global_resources.
      
      The spec says the CRTC cannot be enabled when we disable LCPLL, so we
      had a check for crtc->base.enabled. If we change to crtc->active we
      will still prevent disabling LCPLL while the CRTC is enabled, and we
      will also prevent the WARN above.
      
      This is a replacement for the previous patch named
          "drm/i915: get/put PC8 when we get/put a CRTC"
      
      Testcase: igt/pm_pc8/modeset-lpsp-stress-no-wait
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      798183c5
    • Linus Torvalds's avatar
      Linux 3.13-rc3 · 374b1057
      Linus Torvalds authored
      374b1057
    • Linus Torvalds's avatar
      Merge tag 'trace-fixes-3.13-rc2' of... · 843f4f4b
      Linus Torvalds authored
      Merge tag 'trace-fixes-3.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
      
      Pull tracing fix from Steven Rostedt:
       "A regression showed up that there's a large delay when enabling all
        events.  This was prevalent when FTRACE_SELFTEST was enabled which
        enables all events several times, and caused the system bootup to
        pause for over a minute.
      
        This was tracked down to an addition of a synchronize_sched()
        performed when system call tracepoints are unregistered.
      
        The synchronize_sched() is needed between the unregistering of the
        system call tracepoint and a deletion of a tracing instance buffer.
        But placing the synchronize_sched() in the unreg of *every* system
        call tracepoint is a bit overboard.  A single synchronize_sched()
        before the deletion of the instance is sufficient"
      
      * tag 'trace-fixes-3.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Only run synchronize_sched() at instance deletion time
      843f4f4b
    • Linus Torvalds's avatar
      Merge git://git.kvack.org/~bcrl/aio-next · c537aba0
      Linus Torvalds authored
      Pull aio fix from Benjamin LaHaise:
       "AIO fix from Gu Zheng that fixes a GPF that Dave Jones uncovered with
        trinity"
      
      * git://git.kvack.org/~bcrl/aio-next:
        aio: clean up aio ring in the fail path
      c537aba0