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>] [day] [month] [year] [list]
Message-ID: <20210914150641.dzyioa3wkoyv2o7k@gilmour>
Date:   Tue, 14 Sep 2021 17:06:41 +0200
From:   Maxime Ripard <maxime@...no.tech>
To:     Sam Ravnborg <sam@...nborg.org>
Cc:     dri-devel@...ts.freedesktop.org,
        Daniel Vetter <daniel.vetter@...el.com>,
        David Airlie <airlied@...ux.ie>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        Emma Anholt <emma@...olt.net>,
        linux-rpi-kernel@...ts.infradead.org,
        Dave Stevenson <dave.stevenson@...pberrypi.com>,
        Phil Elwell <phil@...pberrypi.com>,
        Tim Gover <tim.gover@...pberrypi.com>,
        Dom Cobley <dom@...pberrypi.com>,
        Nicolas Saenz Julienne <nsaenz@...nel.org>,
        bcm-kernel-feedback-list@...adcom.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/3] drm/probe-helper: Create a HPD IRQ event helper
 for a single connector

Hi Sam,

On Tue, Sep 14, 2021 at 12:41:55PM +0200, Sam Ravnborg wrote:
> On Tue, Sep 14, 2021 at 12:17:23PM +0200, Maxime Ripard wrote:
> > The drm_helper_hpd_irq_event() function is iterating over all the
> > connectors when an hotplug event is detected.
> > 
> > During that iteration, it will call each connector detect function and
> > figure out if its status changed.
> > 
> > Finally, if any connector changed, it will notify the user-space and the
> > clients that something changed on the DRM device.
> > 
> > This is supposed to be used for drivers that don't have a hotplug
> > interrupt for individual connectors. However, drivers that can use an
> > interrupt for a single connector are left in the dust and can either
> > reimplement the logic used during the iteration for each connector or
> > use that helper and iterate over all connectors all the time.
> > 
> > Since both are suboptimal, let's create a helper that will only perform
> > the status detection on a single connector.
> > 
> > Signed-off-by: Maxime Ripard <maxime@...no.tech>
> > 
> > ---
> > Changes from v2:
> >   - Skip connectors with DRM_CONNECTOR_POLL_HPD in drm_helper_hpd_irq_event
> >   - Add drm_connector_helper_hpd_irq_event returned value documentation
> >   - Improve logging
> > 
> > Changes from v1:
> >   - Rename the shared function
> >   - Move the hotplug event notification out of the shared function
> >   - Added missing locks
> >   - Improve the documentation
> >   - Switched to drm_dbg_kms
> > ---
> >  drivers/gpu/drm/drm_probe_helper.c | 117 +++++++++++++++++++++--------
> >  include/drm/drm_probe_helper.h     |   1 +
> >  2 files changed, 87 insertions(+), 31 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> > index 5b77fb5c1a32..a1ffc0c30b3a 100644
> > --- a/drivers/gpu/drm/drm_probe_helper.c
> > +++ b/drivers/gpu/drm/drm_probe_helper.c
> > @@ -795,6 +795,87 @@ void drm_kms_helper_poll_fini(struct drm_device *dev)
> >  }
> >  EXPORT_SYMBOL(drm_kms_helper_poll_fini);
> >  
> > +static bool check_connector_changed(struct drm_connector *connector)
> > +{
> > +	struct drm_device *dev = connector->dev;
> > +	enum drm_connector_status old_status;
> > +	u64 old_epoch_counter;
> > +	bool changed = false;
> > +
> > +	/* Only handle HPD capable connectors. */
> > +	drm_WARN_ON(dev, !(connector->polled & DRM_CONNECTOR_POLL_HPD));
>
> This will WARN if DRM_CONNECTOR_POLL_HPD is not set - which the previous
> code did not. I am not sure this is intentional.
> Or have I missed something?

Sorry, I misunderstood your previous comment and thought you wanted to
skip the !HPD connectors in the drm_helper_hpd_irq_event loop.

What do you think would be the proper scenario here? Just return false?

Maxime

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ