Thread (9 messages) 9 messages, 3 authors, 2021-02-16

Re: [PATCH v5 3/3] drm: Add Generic USB Display driver

From: Noralf Trønnes <hidden>
Date: 2021-02-16 16:42:04
Also in: dri-devel


Den 16.02.2021 14.36, skrev Oliver Neukum:
Am Freitag, den 12.02.2021, 18:46 +0100 schrieb Noralf Trønnes:
quoted
+static void gud_connector_early_unregister(struct drm_connector *connector)
+{
+       struct gud_connector *gconn = to_gud_connector(connector);
+
+       backlight_device_unregister(gconn->backlight);
+       cancel_work_sync(&gconn->backlight_work);
+}
Hi,

this looks like you are creating a race condition where the queued work
may operate on an already unregistered backlight.
backlight_device_unregister() sets bd->ops = NULL. This means that
userspace can't update brightness anymore, and thus won't call into this
driver. After that it should be safe to flush/cancel the workqueue.

Unless I'm missing something here.

Noralf.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help