public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/5] drm/i915/vlv: warn on bad VLV PLL divider values
Date: Fri, 27 Sep 2013 22:11:33 +0200	[thread overview]
Message-ID: <20130927201133.GJ26592@phenom.ffwll.local> (raw)
In-Reply-To: <20130927200524.GC744@nuc-i3427.alporthouse.com>

On Fri, Sep 27, 2013 at 09:05:24PM +0100, Chris Wilson wrote:
> On Fri, Sep 27, 2013 at 12:57:24PM -0700, Jesse Barnes wrote:
> > This avoids a divide by zero and warns appropriately on this serious bug.
> > 
> > Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 8da1c96..9a83236 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -5109,6 +5109,11 @@ static void vlv_crtc_clock_get(struct intel_crtc *crtc,
> >  	clock.p1 = (mdiv >> DPIO_P1_SHIFT) & 7;
> >  	clock.p2 = (mdiv >> DPIO_P2_SHIFT) & 0x1f;
> >  
> > +	if (!clock.n || !(clock.p1 * clock.p2)) {
> 
> if ((clock.n & clock.p1 & clock.p2) == 0) {
> 
> or just
> 
> if (!clock.n || !clock.p1 || !clock.p2)
> 
> > +		WARN(1, "bad divider values on pipe %d\n", crtc->pipe);
> > +		return;
> > +	}
> > +
> 
> So I think you want
> 
> if (WARN_ONCE(clock.n == 0 || clock.p1 == 0 || clock.p2 == 0,
>               "bad divider values on pipe %d (m1=%d, m2=%d, p1=%d, p2=%d, n=%d)\n",
> 	      crtc->pipe, clock.m1, clock.m2, clock.p1, clock.p2, clock.n))
>    return;

So the bios leaves a broken setup behind or is our hw state readout not
quite careful enough?
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2013-09-27 20:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-27 19:57 [PATCH 1/5] drm/i915/vlv: reduce GT FIFO error info to a debug message Jesse Barnes
2013-09-27 19:57 ` [PATCH 2/5] drm/i915: use wait_event_timeout when waiting for flip completions Jesse Barnes
2013-09-27 20:45   ` Chris Wilson
2013-09-27 21:27     ` Jesse Barnes
2013-09-28  9:35   ` Daniel Vetter
2013-09-28 14:58     ` Jesse Barnes
2013-09-27 19:57 ` [PATCH 3/5] drm/i915/vlv: warn on bad VLV PLL divider values Jesse Barnes
2013-09-27 20:05   ` Chris Wilson
2013-09-27 20:11     ` Daniel Vetter [this message]
2013-09-27 20:17       ` Jesse Barnes
2013-09-27 19:57 ` [PATCH 4/5] drm/i915/vlv: untangle integrated clock source handling v2 Jesse Barnes
2013-09-27 19:57 ` [PATCH 5/5] drm/i915/vlv: add valleyview_crtc_disable function Jesse Barnes
2013-09-27 20:05   ` 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=20130927201133.GJ26592@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jbarnes@virtuousgeek.org \
    /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