From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Convert BUG_ON(!pll->active) and friends to a WARN
Date: Sun, 13 May 2012 22:08:10 +0200 [thread overview]
Message-ID: <20120513200810.GG4720@phenom.ffwll.local> (raw)
In-Reply-To: <1336936572-19548-1-git-send-email-chris@chris-wilson.co.uk>
On Sun, May 13, 2012 at 08:16:12PM +0100, Chris Wilson wrote:
> Turn a fatal lockup into a merely blank display with lots of shouty
> messages.
>
> v2: Whilst in the area, convert the other BUG_ON into less fatal errors.
> In particular, note that we may be called on a PCH platform not using
> PLLs, such as Haswell, and so we do not always want to BUG_ON(!pll)
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Ok, I guess you want me to drop v1 of this again. I'll wait for a bit of
feedback on these two then (and the tested-by from qa on the 2nd one).
-Daniel
> ---
> drivers/gpu/drm/i915/intel_display.c | 21 +++++++++++++++------
> 1 file changed, 15 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 12dba60..f9e1e1c 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -1473,14 +1473,18 @@ out_unlock:
> static void intel_enable_pch_pll(struct intel_crtc *intel_crtc)
> {
> struct drm_i915_private *dev_priv = intel_crtc->base.dev->dev_private;
> - struct intel_pch_pll *pll = intel_crtc->pch_pll;
> + struct intel_pch_pll *pll;
> int reg;
> u32 val;
>
> - /* PCH only available on ILK+ */
> + /* PCH PLLs only available on ILK, SNB and IVB */
> BUG_ON(dev_priv->info->gen < 5);
> - BUG_ON(pll == NULL);
> - BUG_ON(pll->refcount == 0);
> + pll = intel_crtc->pch_pll;
> + if (pll == NULL)
> + return;
> +
> + if (WARN_ON(pll->refcount == 0))
> + return;
>
> DRM_DEBUG_KMS("enable PCH PLL %x (active %d, on? %d)for crtc %d\n",
> pll->pll_reg, pll->active, pll->on,
> @@ -1518,13 +1522,18 @@ static void intel_disable_pch_pll(struct intel_crtc *intel_crtc)
> if (pll == NULL)
> return;
>
> - BUG_ON(pll->refcount == 0);
> + if (WARN_ON(pll->refcount == 0))
> + return;
>
> DRM_DEBUG_KMS("disable PCH PLL %x (active %d, on? %d) for crtc %d\n",
> pll->pll_reg, pll->active, pll->on,
> intel_crtc->base.base.id);
>
> - BUG_ON(pll->active == 0);
> + if (WARN_ON(pll->active == 0)) {
> + assert_pch_pll_disabled(dev_priv, intel_crtc);
> + return;
> + }
> +
> if (--pll->active) {
> assert_pch_pll_enabled(dev_priv, intel_crtc);
> return;
> --
> 1.7.10
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48
next prev parent reply other threads:[~2012-05-13 20:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-13 8:54 [PATCH 1/2] drm/i915: Convert BUG_ON(!pll->active) to a WARN Chris Wilson
2012-05-13 8:54 ` [PATCH 2/2] drm/i915: Enable the PCH PLL for all generations after link training Chris Wilson
2012-05-13 14:08 ` Daniel Vetter
2012-05-13 14:25 ` Chris Wilson
2012-05-13 23:35 ` Eugeni Dodonov
2012-05-13 23:39 ` Eugeni Dodonov
2012-05-14 15:12 ` Jesse Barnes
2012-05-14 15:23 ` Chris Wilson
2012-05-13 13:42 ` [PATCH 1/2] drm/i915: Convert BUG_ON(!pll->active) to a WARN Daniel Vetter
2012-05-13 19:16 ` [PATCH] drm/i915: Convert BUG_ON(!pll->active) and friends " Chris Wilson
2012-05-13 20:08 ` Daniel Vetter [this message]
2012-05-13 20:15 ` Chris Wilson
2012-05-19 21:11 ` Daniel Vetter
2012-05-13 23:51 ` Eugeni Dodonov
2012-05-19 21:09 ` 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=20120513200810.GG4720@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.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