lkml.org 
[lkml]   [2020]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4.19 11/57] drm/atomic_helper: Stop modesets on unregistered connectors harder
Hi!

> From: Lyude Paul <lyude@redhat.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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-12-01 16:46    [W:0.445 / U:0.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site