]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
drm: safely free connectors from connector_iter
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 4 Dec 2017 20:48:18 +0000 (21:48 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 6 Dec 2017 09:22:55 +0000 (10:22 +0100)
commita703c55004e1c5076d57e43771b3e11117796ea0
tree2be0916f74fc5e69786a4347e19f0d793cbf4309
parentae64f9bd1d3621b5e60d7363bc20afb46aede215
drm: safely free connectors from connector_iter

In

commit 613051dac40da1751ab269572766d3348d45a197
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Wed Dec 14 00:08:06 2016 +0100

    drm: locking&new iterators for connector_list

we've went to extreme lengths to make sure connector iterations works
in any context, without introducing any additional locking context.
This worked, except for a small fumble in the implementation:

When we actually race with a concurrent connector unplug event, and
our temporary connector reference turns out to be the final one, then
everything breaks: We call the connector release function from
whatever context we happen to be in, which can be an irq/atomic
context. And connector freeing grabs all kinds of locks and stuff.

Fix this by creating a specially safe put function for connetor_iter,
which (in this rare case) punts the cleanup to a worker.

Reported-by: Ben Widawsky <ben@bwidawsk.net>
Cc: Ben Widawsky <ben@bwidawsk.net>
Fixes: 613051dac40d ("drm: locking&new iterators for connector_list")
Cc: Dave Airlie <airlied@gmail.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: <stable@vger.kernel.org> # v4.11+
Reviewed-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171204204818.24745-1-daniel.vetter@ffwll.ch
drivers/gpu/drm/drm_connector.c
drivers/gpu/drm/drm_mode_config.c
include/drm/drm_connector.h