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]
Date:   Fri, 20 Jan 2023 10:03:48 +0100
From:   Michael Rodin <mrodin@...adit-jv.com>
To:     Maxime Ripard <maxime@...no.tech>
CC:     Michael Rodin <mrodin@...adit-jv.com>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        David Airlie <airlied@...il.com>,
        Daniel Vetter <daniel@...ll.ch>,
        Dave Airlie <airlied@...hat.com>,
        Alex Deucher <alexander.deucher@....com>,
        <dri-devel@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>,
        <michael@...in.online>, <erosca@...adit-jv.com>,
        <laurent.pinchart@...asonboard.com>
Subject: Re: [PATCH] drm: override detected status for connectors which are
 forced on

Hi Maxime,

thank you for your feedback!
On Thu, Dec 22, 2022 at 06:40:54PM +0100, Maxime Ripard wrote:
> Hi,
> 
> On Thu, Dec 15, 2022 at 06:03:59PM +0100, Michael Rodin wrote:
> > The detected status of a connector should be ignored when a connector is
> > forced as hinted in the commit d50ba256b5f1 ("drm/kms: start
> > adding command line interface using fb."). One negative side effect of
> > not ignoring this is observed on the RCar3 SoCs which use the dw-hdmi
> > driver. It continues executing drm_helper_hpd_irq_event even if its
> > connector is forced to ON. As consequence drm_helper_hpd_irq_event calls
> > "detect" so the connector status is updated to "disconnected":
> > 
> > [  420.201527] [drm:drm_helper_hpd_irq_event] [CONNECTOR:76:HDMI-A-1] status updated from connected to disconnected
> > 
> > This status is corrected by drm_helper_probe_single_connector_modes shortly
> > after this because this function checks if a connector is forced:
> > 
> > [  420.218703] [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:76:HDMI-A-1] status updated from disconnected to connected
> > 
> > To avoid similar issues this commit adapts functions which call "detect"
> > so they check additionally if a connector is forced and override the status
> > returned by "detect".
> > 
> > Fixes: 816da85a0990 ("drm: handle HPD and polled connectors separately")
> > Signed-off-by: Michael Rodin <mrodin@...adit-jv.com>
> 
> As reported here, this breaks vc4, and probably i915:
> https://lore.kernel.org/dri-devel/20221107123657.24vbgep3jqeklb2s@houat/
> 
> Maxime

My understanding from [1,2] was that the way to avoid such regressions is
to make sure that the "detect" callbacks of connector drivers are always
called even if a connector is forced. This is what I have implemented in my
second patch where "detect" is called first and then the return value is
adjusted based on the "force" status. If my understanding was wrong, I
would very much appreciate if you could give me some hints for the
implementation of an acceptable solution. Maybe it would be safer to simply
avoid calling drm_helper_hpd_irq_event in the dw-hdmi driver when the
connector is forced like mentioned by Laurent [3]? Although this would fix
this global problem only for one particular driver.

[1] https://lore.kernel.org/dri-devel/20221107123657.24vbgep3jqeklb2s@houat/
[2] https://lore.kernel.org/dri-devel/20221107122504.tejlb24bjbaxw5t6@houat/
[3] https://lore.kernel.org/dri-devel/YzYrNJbfGcch1UtX@pendragon.ideasonboard.com/

-- 
Best Regards,
Michael

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ