lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMpxmJVHXoP0BokfbPwQmC=eBaNfS5yfG77EB_MnScmSbUVAdA@mail.gmail.com>
Date:   Mon, 19 Dec 2016 15:19:20 +0100
From:   Bartosz Golaszewski <bgolaszewski@...libre.com>
To:     Jyri Sarha <jsarha@...com>
Cc:     Tomi Valkeinen <tomi.valkeinen@...com>,
        David Airlie <airlied@...ux.ie>,
        Kevin Hilman <khilman@...libre.com>,
        Michael Turquette <mturquette@...libre.com>,
        Sekhar Nori <nsekhar@...com>,
        LKML <linux-kernel@...r.kernel.org>,
        linux-drm <dri-devel@...ts.freedesktop.org>,
        Peter Ujfalusi <peter.ujfalusi@...com>,
        arm-soc <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] drm: tilcdc: simplify the recovery from sync lost error
 on rev1

2016-12-19 14:09 GMT+01:00 Jyri Sarha <jsarha@...com>:
> One comment bellow.
>
> On 12/13/16 17:07, Bartosz Golaszewski wrote:
>> Revision 2 of LCDC suffers from an issue where a SYNC_LOST error
>> caused by limited memory bandwidth may leave the picture shifted a
>> couple pixels to the right.
>>
>> This issue has not been observed on revision 1, while the recovery
>> mechanism introduces a different issue, where the END_OF_FRAME
>> interrupt doesn't fire while drm is waiting for vblanks.
>>
>> On rev1: recover from sync lost errors by simply clearing the
>> RASTER_ENABLE bit in the RASTER_CTRL register and re-enabling it
>> again as is suggested by the datasheet.
>>
>> Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
>> ---
>>  drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 24 +++++++++++++++---------
>>  1 file changed, 15 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>> index 9942b05..70e57a7 100644
>> --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>> +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
>> @@ -921,17 +921,23 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc)
>>               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);
>> -                     if (priv->rev == 1)
>> -                             tilcdc_clear(dev, LCDC_RASTER_CTRL_REG,
>> -                                          LCDC_V1_SYNC_LOST_INT_ENA);
>> -                     else
>> +             if (priv->rev == 1) {
>
> I would add here:
> +               if ((tilcdc_read(dev, LCDC_RASTER_CTRL_REG) &
> +                               LCDC_RASTER_ENABLE)) {
>
>> +                     tilcdc_clear(dev,
>> +                                  LCDC_RASTER_CTRL_REG, LCDC_RASTER_ENABLE);
>> +                     tilcdc_set(dev,
>> +                                LCDC_RASTER_CTRL_REG, LCDC_RASTER_ENABLE);
> +               }
>
> Just in case the interrupt is for some reason handled right after the
> crtc is disabled.
>
> With this addition I could send a pull request for this fix still today,
> if you agree with the change.

I'm not sure this can really happen, but it won't hurt either, so I'll
send a v2.

Thanks,
Bartosz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ