dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 1/2] drm: exynos: Perform initialization/cleanup at probe/remove time
Date: Tue, 13 Dec 2016 23:54:12 +0200	[thread overview]
Message-ID: <2047755.8xtriVnsP8@avalon> (raw)
In-Reply-To: <20161213214951.roolpky5shmfdecp@phenom.ffwll.local>

Hi Daniel,

On Tuesday 13 Dec 2016 22:49:51 Daniel Vetter wrote:
> On Tue, Dec 13, 2016 at 04:32:30PM -0500, Sean Paul wrote:
> > On Tue, Dec 13, 2016 at 4:30 PM, Laurent Pinchart wrote:
> >> On Tuesday 13 Dec 2016 22:10:58 Daniel Vetter wrote:
> >>> On Tue, Dec 13, 2016 at 09:34:05PM +0200, Laurent Pinchart wrote:
> >>>> From: Laurent Pinchart <laurent.pinchart@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.
> >>>> 
> >>>> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >>>> ---
> >>>> 
> >>>>  drivers/gpu/drm/exynos/exynos_dp.c       |   1 -
> >>>>  drivers/gpu/drm/exynos/exynos_drm_dpi.c  |   1 -
> >>>>  drivers/gpu/drm/exynos/exynos_drm_drv.c  | 245 ++++++++++++---------
> >>>>  drivers/gpu/drm/exynos/exynos_drm_dsi.c  |   1 -
> >>>>  drivers/gpu/drm/exynos/exynos_drm_vidi.c |   1 -
> >>>>  drivers/gpu/drm/exynos/exynos_hdmi.c     |   1 -
> >>>>  6 files changed, 127 insertions(+), 123 deletions(-)
> >> 
> >> [snip]
> >> 
> >>>>  static void exynos_drm_unbind(struct device *dev)
> >>>>  {
> >>>> 
> >>>> -   drm_put_dev(dev_get_drvdata(dev));
> >>>> +   struct drm_device *drm = dev_get_drvdata(dev);
> >>>> +
> >>>> +   drm_dev_unregister(drm);
> >>>> +
> >>>> +   exynos_drm_device_subdrv_remove(drm);
> >>>> +
> >>>> +   exynos_drm_fbdev_fini(drm);
> >>>> +   drm_kms_helper_poll_fini(drm);
> >>> 
> >>> Unbind order is inverted from the error paths in the probe function,
> >>> but meh, preexisting.
> >>> 
> >>> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>o
> >>> 
> >>> ... because I really want to see drm_platform.c gone! Feel free to push
> >>> to drm-misc, you haz commit rights after all ;-)
> >> 
> >> Let's try to get the patch tested first :-) Is exynosdrm merged through
> >> drm- misc ?
> > 
> > Since 2/2 should go through misc, it makes sense to take the whole
> > series through there (instead of lockstepping with exynos tree)
> 
> Same for the one omapdrm patch if that's ok. drm-misc is resynced with
> drm-next-4.10, so there shouldn't be anything pending and it should all
> apply cleanly.

Except that the omapdrm patch is based on top of a series of ~20 pending 
patches. I'll respin the whole lot soon.

> >>>> +
> >>>> +   component_unbind_all(drm->dev, drm);
> >>>> +   drm_mode_config_cleanup(drm);
> >>>> +   drm_release_iommu_mapping(drm);
> >>>> +
> >>>> +   kfree(drm->dev_private);
> >>>> +   drm->dev_private = NULL;
> >>>> +
> >>>> +   drm_dev_unref(drm);
> >>>>  }

-- 
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-12-13 21:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-13 19:34 [PATCH 0/2] exynosdrm: Remove .load/.unload midlayer Laurent Pinchart
2016-12-13 19:34 ` [PATCH 1/2] drm: exynos: Perform initialization/cleanup at probe/remove time Laurent Pinchart
2016-12-13 21:03   ` Sean Paul
2016-12-13 21:10   ` Daniel Vetter
2016-12-13 21:30     ` Laurent Pinchart
2016-12-13 21:32       ` Sean Paul
2016-12-13 21:49         ` Daniel Vetter
2016-12-13 21:54           ` Laurent Pinchart [this message]
2016-12-16 18:02   ` Daniel Stone
2016-12-17 21:49     ` Laurent Pinchart
2016-12-17  0:33   ` Inki Dae
2016-12-17 22:12     ` Laurent Pinchart
2016-12-19  6:32       ` Inki Dae
2016-12-17 22:29   ` [PATCH v2] " Laurent Pinchart
2016-12-19  9:29     ` Daniel Stone
2016-12-13 19:34 ` [PATCH 2/2] drm: Remove unused drm_platform midlayer Laurent Pinchart
2016-12-13 21:03   ` Daniel Vetter
2016-12-13 21:04     ` Sean Paul
2016-12-17 22:39 ` [PATCH] drm: Remove the struct drm_device platformdev field Laurent Pinchart
2016-12-18 13:16   ` Daniel Vetter
2016-12-18 20:24     ` Laurent Pinchart
2016-12-19  8:30   ` Jyri Sarha
2017-01-03 13:49   ` Vincent ABRIOU
2017-01-03 14:00   ` Russell King - ARM Linux
2017-01-03 15:29   ` Rob Clark
2017-01-04  1:22   ` Xinwei Kong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2047755.8xtriVnsP8@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=sw0312.kim@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox