Skip to contentSkip to conversation

drm/i915: Handle RC6 counter wrap

PATCH Superseded Tvrtko Ursulin 4 participants 8 messages Feb 7, 2018 – Feb 8, 2018

Subsystems (2)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Tvrtko Ursulin

author maintainer
#0 lore raw

PATCH 1/1 drm/i915: Handle RC6 counter wrap

From: Tvrtko Ursulin <[email protected]>

We can implement limited RC6 counter wrap-around protection under the assumption that clients will be reading this value more frequently than the wrap period on a given platform.

With the typical wrap-around period being ~90 minutes, even with the exception of Baytrail which wraps every 13 seconds, this sounds like a reasonable assumption.

Implementation works by storing a 64-bit software copy of a hardware RC6 counter, along with the previous HW counter snapshot. This enables it to detect wrap is polled frequently enough and keep the software copy monotonically incrementing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94852
Cc: Chris Wilson <[email protected]>

---
 drivers/gpu/drm/i915/i915_drv.h |  2 ++
 drivers/gpu/drm/i915/intel_pm.c | 57 ++++++++++++++++++++++++++++++++++-------
 2 files changed, 50 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index ad1fc845cd1b..c5cba355bfa7 100644
@@ -946,6 +946,8 @@ struct intel_rps {
 
 struct intel_rc6 {
 	bool enabled;
+	u64 prev_hw_residency[3];
+	u64 cur_residency[3];
 };
 
 struct intel_llc_pstate {
drivers/gpu/drm/i915/intel_pm.c +48 -9

101 lines not on this page · raw message

Signature · 6 lines
2.14.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

Quoting Tvrtko Ursulin (2018-02-07 16:37:10)

Quoted 123 lines

From: Tvrtko Ursulin <[email protected]>

We can implement limited RC6 counter wrap-around protection under the assumption that clients will be reading this value more frequently than the wrap period on a given platform.

With the typical wrap-around period being ~90 minutes, even with the exception of Baytrail which wraps every 13 seconds, this sounds like a reasonable assumption.

Implementation works by storing a 64-bit software copy of a hardware RC6 counter, along with the previous HW counter snapshot. This enables it to detect wrap is polled frequently enough and keep the software copy monotonically incrementing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94852
Cc: Chris Wilson <[email protected]>

---
 drivers/gpu/drm/i915/i915_drv.h |  2 ++
 drivers/gpu/drm/i915/intel_pm.c | 57 ++++++++++++++++++++++++++++++++++-------
 2 files changed, 50 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index ad1fc845cd1b..c5cba355bfa7 100644
@@ -946,6 +946,8 @@ struct intel_rps {
 
 struct intel_rc6 {
        bool enabled;
+       u64 prev_hw_residency[3];
+       u64 cur_residency[3];
 };
 
 struct intel_llc_pstate {
drivers/gpu/drm/i915/intel_pm.c +30 -9
index 41f26ab46501..6480285d094c 100644
@@ -9417,15 +9417,16 @@ static u64 vlv_residency_raw(struct drm_i915_private *dev_priv,
                             const i915_reg_t reg)
 {
        u32 lower, upper, tmp;
-       unsigned long flags;
        int loop = 2;
 
-       /* The register accessed do not need forcewake. We borrow
+       /*
+        * The register accessed do not need forcewake. We borrow
         * uncore lock to prevent concurrent access to range reg.
         */
-       spin_lock_irqsave(&dev_priv->uncore.lock, flags);
+       lockdep_assert_held(&dev_priv->uncore.lock);
 
-       /* vlv and chv residency counters are 40 bits in width.
+       /*
+        * vlv and chv residency counters are 40 bits in width.
         * With a control bit, we can choose between upper or lower
         * 32bit window into this counter.
         *
@@ -9449,29 +9450,44 @@ static u64 vlv_residency_raw(struct drm_i915_private *dev_priv,
                upper = I915_READ_FW(reg);
        } while (upper != tmp && --loop);
 
-       /* Everywhere else we always use VLV_COUNTER_CONTROL with the
+       /*
+        * Everywhere else we always use VLV_COUNTER_CONTROL with the
         * VLV_COUNT_RANGE_HIGH bit set - so it is safe to leave it set
         * now.
         */
 
-       spin_unlock_irqrestore(&dev_priv->uncore.lock, flags);
-
        return lower | (u64)upper << 8;
 }
 
 u64 intel_rc6_residency_ns(struct drm_i915_private *dev_priv,
                           const i915_reg_t reg)
 {
-       u64 time_hw;
+       u64 time_hw, prev_hw, max_hw;
+       unsigned int fw_domains;
+       unsigned long flags;
        u32 mul, div;
+       int i;
 
        if (!HAS_RC6(dev_priv))
                return 0;
 
+       /* Counter wrap handling stores previous hw counter values. */
+       i = i915_mmio_reg_offset(reg) / sizeof(u32) -
+           i915_mmio_reg_offset(GEN6_GT_GFX_RC6) / sizeof(u32);
+       if (WARN_ON_ONCE(i < 0 ||
+                        i >= ARRAY_SIZE(dev_priv->gt_pm.rc6.cur_residency)))
+               return 0;
+
+       fw_domains = intel_uncore_forcewake_for_reg(dev_priv, reg, FW_REG_READ);
+
+       spin_lock_irqsave(&dev_priv->uncore.lock, flags);
+       intel_uncore_forcewake_get__locked(dev_priv, fw_domains);
+
        /* On VLV and CHV, residency time is in CZ units rather than 1.28us */
        if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
                mul = 1000000;
                div = dev_priv->czclk_freq;
+               max_hw = BIT_ULL(40) - 1;
                time_hw = vlv_residency_raw(dev_priv, reg);
        } else {
                /* 833.33ns units on Gen9LP, 1.28us elsewhere. */
@@ -9483,9 +9499,32 @@ u64 intel_rc6_residency_ns(struct drm_i915_private *dev_priv,
                        div = 1;
                }
 
-               time_hw = I915_READ(reg);
+               max_hw = BIT_ULL(32) - 1;
+               time_hw = I915_READ_FW(reg);
        }
 
+       /*
+        * Counter wrap handling.
+        *
+        * But relying on a sufficient frequency of queries otherwise counters

drivers/gpu/drm/i915/intel_pm.c u64 intel_rc6_residency_ns(struct drm_i915_private *dev_priv, · line 9519

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +10 -0
+        * can still wrap.
+        */
+       prev_hw = dev_priv->gt_pm.rc6.prev_hw_residency[i];
+       dev_priv->gt_pm.rc6.prev_hw_residency[i] = time_hw;
+
+       /* RC6 delta from last sample. */
+       if (time_hw >= prev_hw)
+               time_hw -= prev_hw;
+       else
+               time_hw += max_hw - prev_hw;

I think max_hw is off-by-one.

If prev_hw is the maximum value possible ~0, and time_hw is 0, the increment should be one. The above adds on 0.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

author maintainer
#2 lore raw

PATCH v2 1/1 drm/i915: Handle RC6 counter wrap

From: Tvrtko Ursulin <[email protected]>

We can implement limited RC6 counter wrap-around protection under the assumption that clients will be reading this value more frequently than the wrap period on a given platform.

With the typical wrap-around period being ~90 minutes, even with the exception of Baytrail which wraps every 13 seconds, this sounds like a reasonable assumption.

Implementation works by storing a 64-bit software copy of a hardware RC6 counter, along with the previous HW counter snapshot. This enables it to detect wrap is polled frequently enough and keep the software copy monotonically incrementing.

v2:
* Missed GEN6_GT_GFX_RC6_LOCKED when considering slot sizing and indexing.
* Fixed off-by-one in wrap-around handling. (Chris Wilson)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94852
Cc: Chris Wilson <[email protected]>

---
 drivers/gpu/drm/i915/i915_drv.h |  2 ++
 drivers/gpu/drm/i915/intel_pm.c | 57 ++++++++++++++++++++++++++++++++++-------
 2 files changed, 50 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index ad1fc845cd1b..28a2671a26c7 100644
@@ -946,6 +946,8 @@ struct intel_rps {
 
 struct intel_rc6 {
 	bool enabled;
+	u64 prev_hw_residency[4];
+	u64 cur_residency[4];
 };
 
 struct intel_llc_pstate {
drivers/gpu/drm/i915/intel_pm.c +48 -9

101 lines not on this page · raw message

Signature · 6 lines
2.14.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v2 1/1
#3 lore raw

Quoting Tvrtko Ursulin (2018-02-08 07:04:37)

Quoted 90 lines

From: Tvrtko Ursulin <[email protected]>

We can implement limited RC6 counter wrap-around protection under the assumption that clients will be reading this value more frequently than the wrap period on a given platform.

With the typical wrap-around period being ~90 minutes, even with the exception of Baytrail which wraps every 13 seconds, this sounds like a reasonable assumption.

Implementation works by storing a 64-bit software copy of a hardware RC6 counter, along with the previous HW counter snapshot. This enables it to detect wrap is polled frequently enough and keep the software copy monotonically incrementing.

v2:
* Missed GEN6_GT_GFX_RC6_LOCKED when considering slot sizing and indexing.
* Fixed off-by-one in wrap-around handling. (Chris Wilson)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94852
Cc: Chris Wilson <[email protected]>

---
 drivers/gpu/drm/i915/i915_drv.h |  2 ++
 drivers/gpu/drm/i915/intel_pm.c | 57 ++++++++++++++++++++++++++++++++++-------
 2 files changed, 50 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index ad1fc845cd1b..28a2671a26c7 100644
@@ -946,6 +946,8 @@ struct intel_rps {
 
 struct intel_rc6 {
        bool enabled;
+       u64 prev_hw_residency[4];
+       u64 cur_residency[4];
 };
 
 struct intel_llc_pstate {
drivers/gpu/drm/i915/intel_pm.c +10 -8
index 41f26ab46501..6b01700334a9 100644
@@ -9417,15 +9417,16 @@ static u64 vlv_residency_raw(struct drm_i915_private *dev_priv,
                             const i915_reg_t reg)
 {
        u32 lower, upper, tmp;
-       unsigned long flags;
        int loop = 2;
 
-       /* The register accessed do not need forcewake. We borrow
+       /*
+        * The register accessed do not need forcewake. We borrow
         * uncore lock to prevent concurrent access to range reg.
         */
-       spin_lock_irqsave(&dev_priv->uncore.lock, flags);
+       lockdep_assert_held(&dev_priv->uncore.lock);
 
-       /* vlv and chv residency counters are 40 bits in width.
+       /*
+        * vlv and chv residency counters are 40 bits in width.
         * With a control bit, we can choose between upper or lower
         * 32bit window into this counter.
         *
@@ -9449,29 +9450,44 @@ static u64 vlv_residency_raw(struct drm_i915_private *dev_priv,
                upper = I915_READ_FW(reg);
        } while (upper != tmp && --loop);
 
-       /* Everywhere else we always use VLV_COUNTER_CONTROL with the
+       /*
+        * Everywhere else we always use VLV_COUNTER_CONTROL with the
         * VLV_COUNT_RANGE_HIGH bit set - so it is safe to leave it set
         * now.
         */
 
-       spin_unlock_irqrestore(&dev_priv->uncore.lock, flags);
-
        return lower | (u64)upper << 8;
 }
 
 u64 intel_rc6_residency_ns(struct drm_i915_private *dev_priv,
                           const i915_reg_t reg)
 {
-       u64 time_hw;
+       u64 time_hw, prev_hw, overflow_hw;
+       unsigned int fw_domains;
+       unsigned long flags;
        u32 mul, div;

drivers/gpu/drm/i915/intel_pm.c static u64 vlv_residency_raw(struct drm_i915_private *dev_priv, · line 9478

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +6 -0
+       int i;
 
        if (!HAS_RC6(dev_priv))
                return 0;
 
+       /* Counter wrap handling stores previous hw counter values. */
+       i = (i915_mmio_reg_offset(reg) -
+            i915_mmio_reg_offset(GEN6_GT_GFX_RC6_LOCKED)) / sizeof(u32);
+       if (WARN_ON_ONCE(i < 0 ||
+                        i >= ARRAY_SIZE(dev_priv->gt_pm.rc6.cur_residency)))

int i, but ARRAY_SIZE is unsigned, so just

if (WARN_ON_ONCE(i >= ARRAY_SIZE(dev_priv->gt_pm.rc6.cur_residency)))

would suffice.

I remain surprised that they are in a neat block across atom/big-core

#define VLV_GT_RENDER_RC6 _MMIO(0x138108)
#define VLV_GT_MEDIA_RC6 _MMIO(0x13810C)

#define GEN6_GT_GFX_RC6_LOCKED                  _MMIO(0x138104)
#define GEN6_GT_GFX_RC6                         _MMIO(0x138108)
#define GEN6_GT_GFX_RC6p                        _MMIO(0x13810C)
#define GEN6_GT_GFX_RC6pp                       _MMIO(0x138110)

are indeed just the 4 registers in use.

Quoted 30 lines
drivers/gpu/drm/i915/intel_pm.c +16 -1
+       fw_domains = intel_uncore_forcewake_for_reg(dev_priv, reg, FW_REG_READ);
+
+       spin_lock_irqsave(&dev_priv->uncore.lock, flags);
+       intel_uncore_forcewake_get__locked(dev_priv, fw_domains);
+
        /* On VLV and CHV, residency time is in CZ units rather than 1.28us */
        if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
                mul = 1000000;
                div = dev_priv->czclk_freq;
+               overflow_hw = BIT_ULL(40);
                time_hw = vlv_residency_raw(dev_priv, reg);
        } else {
                /* 833.33ns units on Gen9LP, 1.28us elsewhere. */
@@ -9483,9 +9499,32 @@ u64 intel_rc6_residency_ns(struct drm_i915_private *dev_priv,
                        div = 1;
                }
 
-               time_hw = I915_READ(reg);
+               overflow_hw = BIT_ULL(32);
+               time_hw = I915_READ_FW(reg);
        }
 
+       /*
+        * Counter wrap handling.
+        *
+        * But relying on a sufficient frequency of queries otherwise counters
+        * can still wrap.
+        */
+       prev_hw = dev_priv->gt_pm.rc6.prev_hw_residency[i];
+       dev_priv->gt_pm.rc6.prev_hw_residency[i] = time_hw;

drivers/gpu/drm/i915/intel_pm.c u64 intel_rc6_residency_ns(struct drm_i915_private *dev_priv, · line 9523

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +10 -0
+
+       /* RC6 delta from last sample. */
+       if (time_hw >= prev_hw)
+               time_hw -= prev_hw;
+       else
+               time_hw += overflow_hw - prev_hw;
+
+       /* Add delta to RC6 extended raw driver copy. */
+       time_hw += dev_priv->gt_pm.rc6.cur_residency[i];
+       dev_priv->gt_pm.rc6.cur_residency[i] = time_hw;

Ok.

The other part of the puzzle was perhaps just using a timer to read the registers every 1/2 wrap period, but there was no clear picture on when to start and stop that timer for sysfs. However, with perf we can create and destroy a background timer on PMU open/destroy.

Fancy hooking up a background timer?
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
Quoted 163 lines · Chris Wilson

Quoting Tvrtko Ursulin (2018-02-08 07:04:37)

Quoted 90 lines

From: Tvrtko Ursulin <[email protected]>

We can implement limited RC6 counter wrap-around protection under the assumption that clients will be reading this value more frequently than the wrap period on a given platform.

With the typical wrap-around period being ~90 minutes, even with the exception of Baytrail which wraps every 13 seconds, this sounds like a reasonable assumption.

Implementation works by storing a 64-bit software copy of a hardware RC6 counter, along with the previous HW counter snapshot. This enables it to detect wrap is polled frequently enough and keep the software copy monotonically incrementing.

v2:
* Missed GEN6_GT_GFX_RC6_LOCKED when considering slot sizing and indexing.
* Fixed off-by-one in wrap-around handling. (Chris Wilson)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94852
Cc: Chris Wilson <[email protected]>

---
  drivers/gpu/drm/i915/i915_drv.h |  2 ++
  drivers/gpu/drm/i915/intel_pm.c | 57 ++++++++++++++++++++++++++++++++++-------
  2 files changed, 50 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index ad1fc845cd1b..28a2671a26c7 100644
@@ -946,6 +946,8 @@ struct intel_rps {
 
  struct intel_rc6 {
         bool enabled;
+       u64 prev_hw_residency[4];
+       u64 cur_residency[4];
  };
 
  struct intel_llc_pstate {
drivers/gpu/drm/i915/intel_pm.c +10 -8
index 41f26ab46501..6b01700334a9 100644
@@ -9417,15 +9417,16 @@ static u64 vlv_residency_raw(struct drm_i915_private *dev_priv,
                              const i915_reg_t reg)
  {
         u32 lower, upper, tmp;
-       unsigned long flags;
         int loop = 2;
 
-       /* The register accessed do not need forcewake. We borrow
+       /*
+        * The register accessed do not need forcewake. We borrow
          * uncore lock to prevent concurrent access to range reg.
          */
-       spin_lock_irqsave(&dev_priv->uncore.lock, flags);
+       lockdep_assert_held(&dev_priv->uncore.lock);
 
-       /* vlv and chv residency counters are 40 bits in width.
+       /*
+        * vlv and chv residency counters are 40 bits in width.
          * With a control bit, we can choose between upper or lower
          * 32bit window into this counter.
          *
@@ -9449,29 +9450,44 @@ static u64 vlv_residency_raw(struct drm_i915_private *dev_priv,
                 upper = I915_READ_FW(reg);
         } while (upper != tmp && --loop);
 
-       /* Everywhere else we always use VLV_COUNTER_CONTROL with the
+       /*
+        * Everywhere else we always use VLV_COUNTER_CONTROL with the
          * VLV_COUNT_RANGE_HIGH bit set - so it is safe to leave it set
          * now.
          */
 
-       spin_unlock_irqrestore(&dev_priv->uncore.lock, flags);
-
         return lower | (u64)upper << 8;
  }
 
  u64 intel_rc6_residency_ns(struct drm_i915_private *dev_priv,
                            const i915_reg_t reg)
  {
-       u64 time_hw;
+       u64 time_hw, prev_hw, overflow_hw;
+       unsigned int fw_domains;
+       unsigned long flags;
         u32 mul, div;

drivers/gpu/drm/i915/intel_pm.c static u64 vlv_residency_raw(struct drm_i915_private *dev_priv, · line 9478

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +6 -0
+       int i;
 
         if (!HAS_RC6(dev_priv))
                 return 0;
 
+       /* Counter wrap handling stores previous hw counter values. */
+       i = (i915_mmio_reg_offset(reg) -
+            i915_mmio_reg_offset(GEN6_GT_GFX_RC6_LOCKED)) / sizeof(u32);
+       if (WARN_ON_ONCE(i < 0 ||
+                        i >= ARRAY_SIZE(dev_priv->gt_pm.rc6.cur_residency)))

int i, but ARRAY_SIZE is unsigned, so just

if (WARN_ON_ONCE(i >= ARRAY_SIZE(dev_priv->gt_pm.rc6.cur_residency)))

would suffice.

I remain surprised that they are in a neat block across atom/big-core

#define VLV_GT_RENDER_RC6 _MMIO(0x138108)
#define VLV_GT_MEDIA_RC6 _MMIO(0x13810C)

#define GEN6_GT_GFX_RC6_LOCKED                  _MMIO(0x138104)
#define GEN6_GT_GFX_RC6                         _MMIO(0x138108)
#define GEN6_GT_GFX_RC6p                        _MMIO(0x13810C)
#define GEN6_GT_GFX_RC6pp                       _MMIO(0x138110)

are indeed just the 4 registers in use.

Quoted 30 lines
drivers/gpu/drm/i915/intel_pm.c +16 -1
+       fw_domains = intel_uncore_forcewake_for_reg(dev_priv, reg, FW_REG_READ);
+
+       spin_lock_irqsave(&dev_priv->uncore.lock, flags);
+       intel_uncore_forcewake_get__locked(dev_priv, fw_domains);
+
         /* On VLV and CHV, residency time is in CZ units rather than 1.28us */
         if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
                 mul = 1000000;
                 div = dev_priv->czclk_freq;
+               overflow_hw = BIT_ULL(40);
                 time_hw = vlv_residency_raw(dev_priv, reg);
         } else {
                 /* 833.33ns units on Gen9LP, 1.28us elsewhere. */
@@ -9483,9 +9499,32 @@ u64 intel_rc6_residency_ns(struct drm_i915_private *dev_priv,
                         div = 1;
                 }
 
-               time_hw = I915_READ(reg);
+               overflow_hw = BIT_ULL(32);
+               time_hw = I915_READ_FW(reg);
         }
 
+       /*
+        * Counter wrap handling.
+        *
+        * But relying on a sufficient frequency of queries otherwise counters
+        * can still wrap.
+        */
+       prev_hw = dev_priv->gt_pm.rc6.prev_hw_residency[i];
+       dev_priv->gt_pm.rc6.prev_hw_residency[i] = time_hw;

drivers/gpu/drm/i915/intel_pm.c u64 intel_rc6_residency_ns(struct drm_i915_private *dev_priv, · line 9523

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +10 -0
+
+       /* RC6 delta from last sample. */
+       if (time_hw >= prev_hw)
+               time_hw -= prev_hw;
+       else
+               time_hw += overflow_hw - prev_hw;
+
+       /* Add delta to RC6 extended raw driver copy. */
+       time_hw += dev_priv->gt_pm.rc6.cur_residency[i];
+       dev_priv->gt_pm.rc6.cur_residency[i] = time_hw;

Ok.

Quoted 8 lines

The other part of the puzzle was perhaps just using a timer to read the registers every 1/2 wrap period, but there was no clear picture on when to start and stop that timer for sysfs. However, with perf we can create and destroy a background timer on PMU open/destroy.

Fancy hooking up a background timer?

Could do, wasn't sure that the complication is worth it.

Idea would be to schedule a timer for instance, as you say, 1/2 wrap period, and keep pushing it forward on manual reads.

But then question of runtime suspend arises again. If we decide to estimate the counter, as in the case of PMU, then I need to move that code out of PMU and make intel_pm.c the one and only authoritative source of RC6 data.

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

Quoting Tvrtko Ursulin (2018-02-08 08:50:58)

Quoted 10 lines · Chris Wilson
Quoted 6 lines

The other part of the puzzle was perhaps just using a timer to read the registers every 1/2 wrap period, but there was no clear picture on when to start and stop that timer for sysfs. However, with perf we can create and destroy a background timer on PMU open/destroy.

Fancy hooking up a background timer?

Could do, wasn't sure that the complication is worth it.

Just thought about 10m work to make sure it's done and dusted. However, wait and see if Len's happy is a fair policy.

Quoted 7 lines

Idea would be to schedule a timer for instance, as you say, 1/2 wrap period, and keep pushing it forward on manual reads.

But then question of runtime suspend arises again. If we decide to estimate the counter, as in the case of PMU, then I need to move that code out of PMU and make intel_pm.c the one and only authoritative source of RC6 data.

The timer would also entail waking up the device every 30m. One more reason to loathe adding a timer (and trying to make sure the timer is only run as required).
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw

✗ Fi.CI.BAT: warning for drm/i915: Handle RC6 counter wrap

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: drm/i915: Handle RC6 counter wrap
URL : https://patchwork.freedesktop.org/series/37824/
State : warning

== Summary ==

Series 37824v1 drm/i915: Handle RC6 counter wrap
https://patchwork.freedesktop.org/api/1.0/series/37824/revisions/1/mbox/

Test debugfs_test:

        Subgroup read_all_entries:
                pass       -> DMESG-WARN (fi-snb-2520m) fdo#103713 +1
                pass       -> DMESG-WARN (fi-snb-2600)
                pass       -> DMESG-WARN (fi-ivb-3520m)
                pass       -> DMESG-WARN (fi-ivb-3770)
                pass       -> DMESG-WARN (fi-hsw-4770)
                pass       -> DMESG-WARN (fi-bdw-5557u)
                pass       -> DMESG-WARN (fi-bdw-gvtdvm) fdo#103938
                pass       -> DMESG-WARN (fi-skl-6260u)
                pass       -> DMESG-WARN (fi-skl-6600u)
                pass       -> DMESG-WARN (fi-skl-6700hq)
                pass       -> DMESG-WARN (fi-skl-6700k2)
                pass       -> DMESG-WARN (fi-skl-6770hq)
                pass       -> DMESG-WARN (fi-skl-guc)
                pass       -> DMESG-WARN (fi-skl-gvtdvm)
                pass       -> DMESG-WARN (fi-bxt-dsi)
                pass       -> DMESG-WARN (fi-bxt-j4205)
                pass       -> DMESG-WARN (fi-kbl-7500u)
                pass       -> DMESG-WARN (fi-kbl-7560u)
                pass       -> DMESG-WARN (fi-kbl-7567u)
                pass       -> DMESG-WARN (fi-kbl-r)
                pass       -> DMESG-WARN (fi-glk-1)
                pass       -> DMESG-WARN (fi-cfl-s2)
                pass       -> DMESG-WARN (fi-cnl-y3)

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#103938 https://bugs.freedesktop.org/show_bug.cgi?id=103938

fi-bdw-5557u     total:288  pass:266  dwarn:1   dfail:0   fail:0   skip:21  time:421s
fi-bdw-gvtdvm    total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:424s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:375s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:494s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:288s
fi-bxt-dsi       total:288  pass:257  dwarn:1   dfail:0   fail:0   skip:30  time:480s
fi-bxt-j4205     total:288  pass:258  dwarn:1   dfail:0   fail:0   skip:29  time:487s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:473s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:461s
fi-cfl-s2        total:288  pass:261  dwarn:1   dfail:0   fail:0   skip:26  time:567s
fi-cnl-y3        total:288  pass:261  dwarn:1   dfail:0   fail:0   skip:26  time:586s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:415s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:288s
fi-glk-1         total:288  pass:259  dwarn:1   dfail:0   fail:0   skip:28  time:511s
fi-hsw-4770      total:288  pass:260  dwarn:1   dfail:0   fail:0   skip:27  time:392s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:413s
fi-ivb-3520m     total:288  pass:258  dwarn:1   dfail:0   fail:0   skip:29  time:448s
fi-ivb-3770      total:288  pass:254  dwarn:1   dfail:0   fail:0   skip:33  time:421s
fi-kbl-7500u     total:288  pass:262  dwarn:2   dfail:0   fail:0   skip:24  time:459s
fi-kbl-7560u     total:288  pass:268  dwarn:1   dfail:0   fail:0   skip:19  time:498s
fi-kbl-7567u     total:288  pass:267  dwarn:1   dfail:0   fail:0   skip:20  time:460s
fi-kbl-r         total:288  pass:260  dwarn:1   dfail:0   fail:0   skip:27  time:504s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:599s
fi-skl-6260u     total:288  pass:267  dwarn:1   dfail:0   fail:0   skip:20  time:437s
fi-skl-6600u     total:288  pass:260  dwarn:1   dfail:0   fail:0   skip:27  time:509s
fi-skl-6700hq    total:288  pass:261  dwarn:1   dfail:0   fail:0   skip:26  time:527s
fi-skl-6700k2    total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:483s
fi-skl-6770hq    total:288  pass:267  dwarn:1   dfail:0   fail:0   skip:20  time:477s
fi-skl-guc       total:288  pass:259  dwarn:1   dfail:0   fail:0   skip:28  time:417s
fi-skl-gvtdvm    total:288  pass:264  dwarn:1   dfail:0   fail:0   skip:23  time:428s
fi-snb-2520m     total:245  pass:210  dwarn:1   dfail:0   fail:0   skip:33 
fi-snb-2600      total:288  pass:247  dwarn:1   dfail:0   fail:0   skip:40  time:403s

Blacklisted hosts:
fi-glk-dsi total:288 pass:257 dwarn:1 dfail:0 fail:0 skip:30 time:469s

94ca1ebb0652da416401b22e227d0d95eb382b22 drm-tip: 2018y-02m-07d-13h-38m-30s UTC integration manifest 475bea3436fa drm/i915: Handle RC6 counter wrap

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7927/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw

✗ Fi.CI.BAT: failure for drm/i915: Handle RC6 counter wrap (rev2)

In reply to Tvrtko Ursulin
== Series Details ==

== Series Details ==

Series: drm/i915: Handle RC6 counter wrap (rev2)
URL : https://patchwork.freedesktop.org/series/37824/
State : failure

== Summary ==

Series 37824v2 drm/i915: Handle RC6 counter wrap
https://patchwork.freedesktop.org/api/1.0/series/37824/revisions/2/mbox/

Test kms_pipe_crc_basic:

        Subgroup suspend-read-crc-pipe-a:
                pass       -> FAIL       (fi-skl-6700k2) fdo#103191
        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713
Test drv_module_reload:
        Subgroup basic-reload:
                pass       -> INCOMPLETE (fi-elk-e7500)

fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:424s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:424s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:377s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:495s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:288s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:484s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:495s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:473s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:467s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:565s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:575s
fi-elk-e7500     total:285  pass:226  dwarn:0   dfail:0   fail:0   skip:58 
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:285s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:513s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:391s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:414s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:451s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:418s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:460s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:496s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:459s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:503s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:602s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:432s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:507s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:530s
fi-skl-6700k2    total:288  pass:263  dwarn:0   dfail:0   fail:1   skip:24  time:488s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:480s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:421s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:433s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:532s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:397s

Blacklisted hosts:
fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:473s

3a0a17a6152eeae75653d005494cc83f6f2bf47b drm-tip: 2018y-02m-07d-22h-59m-51s UTC integration manifest 618d7dc316bf drm/i915: Handle RC6 counter wrap

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7935/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx