[PATCH] drm/panel: sony-acx565akm: Fix race condition in probe
Jarkko Nikula
jarkko.nikula at bitmer.com
Sun Nov 29 15:06:12 UTC 2020
On 11/28/20 7:46 PM, Aaro Koskinen wrote:
> Hi,
>
> On Fri, Nov 27, 2020 at 09:04:29PM +0100, Sebastian Reichel wrote:
>> The probe routine acquires the reset GPIO using GPIOD_OUT_LOW. Directly
>> afterwards it calls acx565akm_detect(), which sets the GPIO value to
>> HIGH. If the bootloader initialized the GPIO to HIGH before the probe
>> routine was called, there is only a very short time period of a few
>> instructions where the reset signal is LOW. Exact time depends on
>> compiler optimizations, kernel configuration and alignment of the stars,
>> but I expect it to be always way less than 10us. There are no public
>> datasheets for the panel, but acx565akm_power_on() has a comment with
>> timings and reset period should be at least 10us. So this potentially
>> brings the panel into a half-reset state.
>>
>> The result is, that panel may not work after boot and can get into a
>> working state by re-enabling it (e.g. by blanking + unblanking), since
>> that does a clean reset cycle. This bug has recently been hit by Ivaylo
>> Dimitrov, but there are some older reports which are probably the same
>> bug. At least Tony Lindgren, Peter Ujfalusi and Jarkko Nikula have
>> experienced it in 2017 describing the blank/unblank procedure as
>> possible workaround.
>>
>> Note, that the bug really goes back in time. It has originally been
>> introduced in the predecessor of the omapfb driver in 3c45d05be382
>> ("OMAPDSS: acx565akm panel: handle gpios in panel driver") in 2012.
>> That driver eventually got replaced by a newer one, which had the bug
>> from the beginning in 84192742d9c2 ("OMAPDSS: Add Sony ACX565AKM panel
>> driver") and still exists in fbdev world. That driver has later been
>> copied to omapdrm and then was used as a basis for this driver. Last
>> but not least the omapdrm specific driver has been removed in
>> 45f16c82db7e ("drm/omap: displays: Remove unused panel drivers").
>>
>> Reported-by: Jarkko Nikula <jarkko.nikula at bitmer.com>
>> Reported-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
>> Reported-by: Tony Lindgren <tony at atomide.com>
>> Reported-by: Aaro Koskinen <aaro.koskinen at iki.fi>
>> Reported-by: Ivaylo Dimitrov <ivo.g.dimitrov.75 at gmail.com>
>> Cc: Merlijn Wajer <merlijn at wizzup.org>
>> Cc: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
>> Cc: Tomi Valkeinen <tomi.valkeinen at ti.com>
>> Fixes: 1c8fc3f0c5d2 ("drm/panel: Add driver for the Sony ACX565AKM panel")
>> Signed-off-by: Sebastian Reichel <sebastian.reichel at collabora.com>
>
> Tested-by: Aaro Koskinen <aaro.koskinen at iki.fi>
>
I had difficulties with recent kernels. Yesterday's vanilla head
c84e1efae022 and linux-next next-20201127 didn't boot, v5.9.11 had some
other DRM issues. I went back to v5.4.80 which didn't show this panel
issue and was actually working fine. Strange since obviously issue exist
before.
But v5.6.19 was testable, had the issue and this patch fixed it, so
Tested-by: Jarkko Nikula <jarkko.nikula at bitmer.com>
More information about the dri-devel
mailing list