From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756075AbcLSQvQ (ORCPT ); Mon, 19 Dec 2016 11:51:16 -0500 Received: from fllnx209.ext.ti.com ([198.47.19.16]:54595 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755047AbcLSQvG (ORCPT ); Mon, 19 Dec 2016 11:51:06 -0500 Subject: Re: [PATCH] drm: tilcdc: simplify the recovery from sync lost error on rev1 To: Bartosz Golaszewski References: <1481641656-25227-1-git-send-email-bgolaszewski@baylibre.com> <590211f1-8e31-cecc-8dd2-f7e2976b81d1@ti.com> CC: Tomi Valkeinen , David Airlie , Kevin Hilman , Michael Turquette , Sekhar Nori , LKML , linux-drm , Peter Ujfalusi , arm-soc From: Jyri Sarha Message-ID: <477e8801-5b14-5d76-eb07-bf3ec6c1795b@ti.com> Date: Mon, 19 Dec 2016 18:50:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/19/16 16:19, Bartosz Golaszewski wrote: >> 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. Well, in theory it is quite possible. If the driver clears the raster enable at the same time when sync lost interrupt is generated, then the irq routine handles the irq before the interrupts are disabled. Then it happens that rastere remains on but the driver thinks it has already turned it off. In practice this is of course terribly unlikely, but a race is a race and should be avoided. Anyway, my vacation has already been started so I won't send a pull request now. I do not like the idea of doing something like that and then vanishing for two weeks. I hope they still take fixes for 4.10 in 4th Jan. Best regards, Jyri