Commit 6c5df6f6 authored by Noralf Trønnes's avatar Noralf Trønnes Committed by Greg Kroah-Hartman

drm/fb-helper: generic: Call drm_client_add() after setup is done

[ Upstream commit 6e3f17ee ]

Hotplug can happen while drm_fbdev_generic_setup() is running so move
drm_client_add() call after setup is done to avoid
drm_fbdev_client_hotplug() running in two threads at the same time.

Fixes: 9060d7f4 ("drm/fb-helper: Finish the generic fbdev emulation")
Cc: stable@vger.kernel.org
Reported-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190401141358.25309-1-noralf@tronnes.orgSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 8af3f204
...@@ -3257,8 +3257,6 @@ int drm_fbdev_generic_setup(struct drm_device *dev, unsigned int preferred_bpp) ...@@ -3257,8 +3257,6 @@ int drm_fbdev_generic_setup(struct drm_device *dev, unsigned int preferred_bpp)
return ret; return ret;
} }
drm_client_add(&fb_helper->client);
if (!preferred_bpp) if (!preferred_bpp)
preferred_bpp = dev->mode_config.preferred_depth; preferred_bpp = dev->mode_config.preferred_depth;
if (!preferred_bpp) if (!preferred_bpp)
...@@ -3267,6 +3265,8 @@ int drm_fbdev_generic_setup(struct drm_device *dev, unsigned int preferred_bpp) ...@@ -3267,6 +3265,8 @@ int drm_fbdev_generic_setup(struct drm_device *dev, unsigned int preferred_bpp)
drm_fbdev_client_hotplug(&fb_helper->client); drm_fbdev_client_hotplug(&fb_helper->client);
drm_client_add(&fb_helper->client);
return 0; return 0;
} }
EXPORT_SYMBOL(drm_fbdev_generic_setup); EXPORT_SYMBOL(drm_fbdev_generic_setup);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment