From: Eric Anholt <eric@anholt.net>
To: Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: David Airlie <airlied@linux.ie>,
Maxime Ripard <maxime.ripard@bootlin.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Eben Upton <eben@raspberrypi.org>,
Daniel Vetter <daniel@ffwll.ch>,
Boris Brezillon <boris.brezillon@bootlin.com>
Subject: Re: [PATCH v3 2/4] drm/vc4: Report underrun errors
Date: Fri, 25 Jan 2019 09:52:37 -0800 [thread overview]
Message-ID: <87munovd3u.fsf@anholt.net> (raw)
In-Reply-To: <70a1887da5ca55adeeceb0d1758ec7cfe2d747bb.camel@bootlin.com>
[-- Attachment #1: Type: text/plain, Size: 2867 bytes --]
Paul Kocialkowski <paul.kocialkowski@bootlin.com> writes:
> Hi Eric,
>
> On Wed, 2019-01-23 at 10:47 -0800, Eric Anholt wrote:
>> Paul Kocialkowski <paul.kocialkowski@bootlin.com> writes:
>> > +void vc4_hvs_mask_underrun(struct drm_device *dev)
>> > +{
>> > + struct vc4_dev *vc4 = to_vc4_dev(dev);
>> > + u32 dispctrl = HVS_READ(SCALER_DISPCTRL);
>> > +
>> > + dispctrl &= ~(SCALER_DISPCTRL_DSPEISLUR(0) |
>> > + SCALER_DISPCTRL_DSPEISLUR(1) |
>> > + SCALER_DISPCTRL_DSPEISLUR(2));
>> > +
>> > + HVS_WRITE(SCALER_DISPCTRL, dispctrl);
>> > +}
>> > +
>> > +void vc4_hvs_unmask_underrun(struct drm_device *dev)
>> > +{
>> > + struct vc4_dev *vc4 = to_vc4_dev(dev);
>> > + u32 dispctrl = HVS_READ(SCALER_DISPCTRL);
>> > +
>> > + dispctrl |= SCALER_DISPCTRL_DSPEISLUR(0) |
>> > + SCALER_DISPCTRL_DSPEISLUR(1) |
>> > + SCALER_DISPCTRL_DSPEISLUR(2);
>> > +
>> > + HVS_WRITE(SCALER_DISPSTAT,
>> > + SCALER_DISPSTAT_EUFLOW(0) |
>> > + SCALER_DISPSTAT_EUFLOW(1) |
>> > + SCALER_DISPSTAT_EUFLOW(2));
>> > + HVS_WRITE(SCALER_DISPCTRL, dispctrl);
>> > +}
>> > +
>> > +static void vc4_hvs_report_underrun(struct drm_device *dev)
>> > +{
>> > + struct vc4_dev *vc4 = to_vc4_dev(dev);
>> > +
>> > + atomic_inc(&vc4->underrun);
>> > + DRM_DEV_ERROR(dev->dev, "HVS underrun\n");
>> > +}
>> > +
>> > +static irqreturn_t vc4_hvs_irq_handler(int irq, void *data)
>> > +{
>> > + struct drm_device *dev = data;
>> > + struct vc4_dev *vc4 = to_vc4_dev(dev);
>> > + u32 status;
>> > +
>> > + status = HVS_READ(SCALER_DISPSTAT);
>> > +
>> > + if (status &
>> > + (SCALER_DISPSTAT_EUFLOW(0) | SCALER_DISPSTAT_EUFLOW(1) |
>> > + SCALER_DISPSTAT_EUFLOW(2))) {
>> > + vc4_hvs_mask_underrun(dev);
>> > + vc4_hvs_report_underrun(dev);
>> > + }
>> > +
>> > + HVS_WRITE(SCALER_DISPSTAT, status);
>> > +
>> > + return status ? IRQ_HANDLED : IRQ_NONE;
>> > +}
>>
>> So, if UFLOW is set then we incremented the counter and disabled the
>> interrupt, otherwise we acked this specific interrupt and return? Given
>> that a short-line error (the other potential cause of EISLUR) would be
>> likely to persist, we should probably either vc4_hvs_mask_underrun() in
>> that case too, or only return IRQ_HANDLED for the case we actually
>> handled.
>
> I see, there is definitely an inconsistency here. I don't think we
> should be disabling the interrupt if we get a short line indication,
> just in case the interrupt gets triggered later for a legitimate
> underrun (before the next commit).
>
> So I think we should just totally ignore the short line status bit for
> the IRQ return (although it certainly doesn't hurt to clear it as
> well). What do you think?
You just have to make sure that you return UNHANDLED for short line, so
an IRQ storm doesn't take down the machine.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2019-01-25 17:52 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-08 14:50 [PATCH v3 0/4] drm/vc4: Add a load tracker Paul Kocialkowski
2019-01-08 14:50 ` Paul Kocialkowski
2019-01-08 14:50 ` [PATCH v3 1/4] drm/vc4: Wait for display list synchronization when completing commit Paul Kocialkowski
2019-01-08 14:50 ` Paul Kocialkowski
2019-01-08 18:21 ` Daniel Vetter
2019-01-08 18:21 ` Daniel Vetter
2019-01-09 16:52 ` Paul Kocialkowski
2019-01-09 20:34 ` Daniel Vetter
2019-01-09 20:34 ` Daniel Vetter
2019-01-23 18:34 ` Eric Anholt
2019-01-23 18:34 ` Eric Anholt
2019-01-25 14:50 ` Paul Kocialkowski
2019-01-25 14:50 ` Paul Kocialkowski
2019-01-25 17:55 ` Eric Anholt
2019-01-25 17:55 ` Eric Anholt
2019-01-08 14:50 ` [PATCH v3 2/4] drm/vc4: Report underrun errors Paul Kocialkowski
2019-01-08 14:50 ` Paul Kocialkowski
2019-01-23 18:47 ` Eric Anholt
2019-01-25 14:43 ` Paul Kocialkowski
2019-01-25 14:43 ` Paul Kocialkowski
2019-01-25 17:52 ` Eric Anholt [this message]
2019-01-08 14:50 ` [PATCH v3 3/4] drm/vc4: Add a load tracker to prevent HVS underflow errors Paul Kocialkowski
2019-01-08 14:50 ` Paul Kocialkowski
2019-01-08 14:50 ` [PATCH v3 4/4] drm/vc4: Add a debugfs entry to disable/enable the load tracker Paul Kocialkowski
2019-01-08 14:50 ` Paul Kocialkowski
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=87munovd3u.fsf@anholt.net \
--to=eric@anholt.net \
--cc=airlied@linux.ie \
--cc=boris.brezillon@bootlin.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=eben@raspberrypi.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.ripard@bootlin.com \
--cc=paul.kocialkowski@bootlin.com \
--cc=thomas.petazzoni@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.