[PATCH 1/2] drm: exynos: Perform initialization/cleanup at probe/remove time

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sat Dec 17 21:49:31 UTC 2016


Hi Daniel,

On Friday 16 Dec 2016 18:02:20 Daniel Stone wrote:
> On 13 December 2016 at 19:34, Laurent Pinchart wrote:
> > From: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> > 
> > The drm driver .load() operation is prone to race conditions as it
> > initializes the driver after registering the device nodes. Its usage is
> > deprecated, inline it in the probe function and call drm_dev_alloc() and
> > drm_dev_register() explicitly.
> > 
> > For consistency inline the .unload() handler in the remove function as
> > well.
> 
> Almost there: you need to add 'drm->platformdev =
> to_platform_device(dev)' next to the drm->dev_private assignment.

I don't think that's needed. The field was indeed initialized by 
drm_get_platform_dev() (called from drm_platform_init()), but only used in two 
locations in the driver where the struct device is available through different 
ways.

As struct drm_device contains a separate struct device *dev, I'll write a 
patch to remove the platformdev field.

> I thought about cleaning this up, but my XU3's eMMC is dead, so testing
> on Exynos for me has a 5+ minute RTT through LAVA ... so this is:
> 
> Reviewed-by: Daniel Stone <daniels at collabora.com>

Thanks.

-- 
Regards,

Laurent Pinchart



More information about the dri-devel mailing list