dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
To: Jyri Sarha <jsarha@ti.com>
Cc: Kevin Hilman <khilman@baylibre.com>, Sekhar Nori <nsekhar@ti.com>,
	linux-drm <dri-devel@lists.freedesktop.org>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH v2 1/7] drm/tilcdc: Enable sync lost error and recovery handling for rev 1 LCDC
Date: Fri, 18 Nov 2016 14:34:14 +0100	[thread overview]
Message-ID: <CAMpxmJWzbn7OMFBmc8qP4rP_oF6Gw6yCyG=THb6-wZuBDmc-uA@mail.gmail.com> (raw)
In-Reply-To: <d16d40e1c9530ecfd5e32669e5e2f8a61a5a29ca.1479297559.git.jsarha@ti.com>

2016-11-16 13:41 GMT+01:00 Jyri Sarha <jsarha@ti.com>:
> Revision 1 LCDC support also sync lost errors and can benefit from
> sync lost recovery routine.
>

Hi Jyri,

I think I found the issue with this patch. Please see below.

> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 39 ++++++++++++++++++------------------
>  drivers/gpu/drm/tilcdc/tilcdc_regs.h |  1 +
>  2 files changed, 21 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> index c787349..dfe5796 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> @@ -113,8 +113,8 @@ static void tilcdc_crtc_enable_irqs(struct drm_device *dev)
>
>         if (priv->rev == 1) {
>                 tilcdc_set(dev, LCDC_RASTER_CTRL_REG,
> -                       LCDC_V1_UNDERFLOW_INT_ENA);
> -               tilcdc_set(dev, LCDC_DMA_CTRL_REG,
> +                       LCDC_V1_UNDERFLOW_INT_ENA |
> +                       LCDC_V1_SYNC_LOST_ENA |
>                         LCDC_V1_END_OF_FRAME_INT_ENA);
>         } else {
>                 tilcdc_write(dev, LCDC_INT_ENABLE_SET_REG,
> @@ -131,8 +131,9 @@ static void tilcdc_crtc_disable_irqs(struct drm_device *dev)
>         /* disable irqs that we might have enabled: */
>         if (priv->rev == 1) {
>                 tilcdc_clear(dev, LCDC_RASTER_CTRL_REG,
> -                       LCDC_V1_UNDERFLOW_INT_ENA | LCDC_V1_PL_INT_ENA);
> -               tilcdc_clear(dev, LCDC_DMA_CTRL_REG,
> +                       LCDC_V1_UNDERFLOW_INT_ENA |
> +                       LCDC_V1_PL_INT_ENA |
> +                       LCDC_V1_SYNC_LOST_ENA |
>                         LCDC_V1_END_OF_FRAME_INT_ENA);
>         } else {
>                 tilcdc_write(dev, LCDC_INT_ENABLE_CLR_REG,

This is what breaks the driver. The END_OF_FRAME interrupt is enabled
by writing to the LCD DMA control register on rev 1, not LCDC RASTER
control. It should be left as it is - you only need to enable the
SYNC_LOST interrupt.

Hint: maybe call it LCDC_V1_SYNC_LOST_INT_ENA?

> @@ -845,6 +846,21 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc)
>                 dev_err_ratelimited(dev->dev, "%s(0x%08x): FIFO underflow",
>                                     __func__, stat);
>
> +       if (stat & LCDC_SYNC_LOST) {
> +               dev_err_ratelimited(dev->dev, "%s(0x%08x): Sync lost",
> +                                   __func__, stat);
> +               tilcdc_crtc->frame_intact = false;
> +               if (tilcdc_crtc->sync_lost_count++ >
> +                   SYNC_LOST_COUNT_LIMIT) {
> +                       dev_err(dev->dev, "%s(0x%08x): Sync lost flood detected, recovering", __func__, stat);
> +                       queue_work(system_wq,
> +                                  &tilcdc_crtc->recover_work);
> +                       tilcdc_write(dev, LCDC_INT_ENABLE_CLR_REG,
> +                                    LCDC_SYNC_LOST);
> +                       tilcdc_crtc->sync_lost_count = 0;
> +               }
> +       }

The SYNC_LOST bit still needs clearing here - otherwise the flood
never stops even after recovery work completes.

Thanks,
Bartosz Golaszewski
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-11-18 13:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-16 12:40 [PATCH v2 0/7] drm/tilcdc: LCDC Revision 1 related fixes Jyri Sarha
2016-11-16 12:41 ` [PATCH v2 1/7] drm/tilcdc: Enable sync lost error and recovery handling for rev 1 LCDC Jyri Sarha
2016-11-18 13:34   ` Bartosz Golaszewski [this message]
2016-11-18 21:41     ` Jyri Sarha
2016-11-16 12:41 ` [PATCH v2 2/7] drm: tilcdc: implement palette loading for rev1 Jyri Sarha
2016-11-16 12:41 ` [PATCH v2 3/7] drm/tilcdc: Fix tilcdc_crtc_create() return value handling Jyri Sarha
2016-11-16 12:41 ` [PATCH v2 4/7] drm/tilcdc: Free palette dma memory in tilcdc_crtc_destroy() Jyri Sarha
2016-11-16 12:41 ` [PATCH v2 5/7] drm/tilcdc: Add tilcdc_write_mask() to tilcdc_regs.h Jyri Sarha
2016-11-16 12:41 ` [PATCH v2 6/7] drm/tilcdc: Enable palette loading for revision 2 LCDC too Jyri Sarha
2016-11-16 12:41 ` [PATCH v2 7/7] drm/tilcdc: Load palette at the end of mode_set_nofb() Jyri Sarha
2016-11-18 15:34   ` Bartosz Golaszewski
2016-11-18 16:10     ` Bartosz Golaszewski
2016-11-18 21:53       ` Jyri Sarha
2016-11-19 15:58         ` Jyri Sarha
2016-11-16 15:18 ` [PATCH v2 0/7] drm/tilcdc: LCDC Revision 1 related fixes Bartosz Golaszewski
2016-11-16 18:00   ` Jyri Sarha
2016-11-17 11:31     ` Bartosz Golaszewski
2016-11-17 20:06       ` Jyri Sarha
2016-11-18 10:31         ` Bartosz Golaszewski

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='CAMpxmJWzbn7OMFBmc8qP4rP_oF6Gw6yCyG=THb6-wZuBDmc-uA@mail.gmail.com' \
    --to=bgolaszewski@baylibre.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=khilman@baylibre.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=nsekhar@ti.com \
    --cc=tomi.valkeinen@ti.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;
as well as URLs for NNTP newsgroup(s).