[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201201154332.GB23661@amd>
Date: Tue, 1 Dec 2020 16:43:32 +0100
From: Pavel Machek <pavel@....cz>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Ville Syrjälä
<ville.syrjala@...ux.intel.com>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
David Airlie <airlied@...ux.ie>, Lyude Paul <lyude@...hat.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Christoph Niedermaier <cniedermaier@...electronics.com>
Subject: Re: [PATCH 4.19 11/57] drm/atomic_helper: Stop modesets on
unregistered connectors harder
Hi!
> From: Lyude Paul <lyude@...hat.com>
>
> commit de9f8eea5a44b0b756d3d6345af7f8e630a3c8c0 upstream.
So this says protected by mutex:
> /**
> - * @registered: Is this connector exposed (registered) with userspace?
> + * @registration_state: Is this connector initializing, exposed
> + * (registered) with userspace, or unregistered?
> + *
> * Protected by @mutex.
> */
> - bool registered;
> + enum drm_connector_registration_state registration_state;
>
> /**
> * @modes:
> @@ -1165,6 +1214,24 @@ static inline void drm_connector_unrefer
> drm_connector_put(connector);
> }
>
> +/**
> + * drm_connector_is_unregistered - has the connector been unregistered from
> + * userspace?
> + * @connector: DRM connector
> + *
> + * Checks whether or not @connector has been unregistered from userspace.
> + *
> + * Returns:
> + * True if the connector was unregistered, false if the connector is
> + * registered or has not yet been registered with userspace.
> + */
> +static inline bool
> +drm_connector_is_unregistered(struct drm_connector *connector)
> +{
> + return READ_ONCE(connector->registration_state) ==
> + DRM_CONNECTOR_UNREGISTERED;
> +}
But this uses READ_ONCE() for protection, and corresponding
WRITE_ONCE() is nowhere to be seen. Should this take the mutex, too?
Best regards,
Pavel
--
http://www.livejournal.com/~pavelmachek
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists