From: Paulo Zanoni <przanoni@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: [PATCH 3/3] drm/i915: fix infinite loop at gen6_update_ring_freq
Date: Tue, 1 Apr 2014 19:39:49 -0300 [thread overview]
Message-ID: <1396391989-2244-4-git-send-email-przanoni@gmail.com> (raw)
In-Reply-To: <1396391989-2244-1-git-send-email-przanoni@gmail.com>
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
If I boot my Broadwell machine to X on a system with Mesa Gallium
llvmpipe instead of i965, then kill X and try to run pm_pc8.c, when we
disable PC8 and call gen6_update_ring_freq(), we will get stuck on an
infinite loop because the frequencies are zero and the variables are
unsigned. This happens because we never ran any batch, so we did not
enable RC6, so the variables are zero. If I run gem_exec_nop before
running pm_pc8, everything works as expected because gem_exec_nop
makes RC6 be enabled.
This commit should prevent the infinite loop, which IMHO is already a
good reason to be merged, but it is not the proper fix to the "RC6 is
not being enabled" problem.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
drivers/gpu/drm/i915/intel_pm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index cebe0d4..0a0685b 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3487,7 +3487,8 @@ void gen6_update_ring_freq(struct drm_device *dev)
* to use for memory access. We do this by specifying the IA frequency
* the PCU should use as a reference to determine the ring frequency.
*/
- for (gpu_freq = dev_priv->rps.max_freq_softlimit; gpu_freq >= dev_priv->rps.min_freq_softlimit;
+ for (gpu_freq = dev_priv->rps.max_freq_softlimit;
+ gpu_freq >= dev_priv->rps.min_freq_softlimit && gpu_freq != 0;
gpu_freq--) {
int diff = dev_priv->rps.max_freq_softlimit - gpu_freq;
unsigned int ia_freq = 0, ring_freq = 0;
--
1.8.5.3
next prev parent reply other threads:[~2014-04-01 22:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-01 22:39 [PATCH 0/3] BDW runtime PM fixes Paulo Zanoni
2014-04-01 22:39 ` [PATCH 1/3] drm/i915: only check for irqs_disabled when disabling LCPLL Paulo Zanoni
2014-04-02 7:28 ` Daniel Vetter
2014-04-01 22:39 ` [PATCH 2/3] drm/i915: Allow i915_pc8_status debug info on BDW Paulo Zanoni
2014-04-02 5:04 ` Ben Widawsky
2014-04-02 7:27 ` Daniel Vetter
2014-04-01 22:39 ` Paulo Zanoni [this message]
2014-04-02 5:03 ` [PATCH 3/3] drm/i915: fix infinite loop at gen6_update_ring_freq Ben Widawsky
2014-04-02 7:26 ` Daniel Vetter
2014-04-02 14:58 ` [PATCH 0/3] BDW runtime PM fixes Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1396391989-2244-4-git-send-email-przanoni@gmail.com \
--to=przanoni@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox