dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Inki Dae <daeinki@gmail.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	DRI mailing list <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 1/2] drm: exynos: Perform initialization/cleanup at probe/remove time
Date: Sun, 18 Dec 2016 00:12:40 +0200	[thread overview]
Message-ID: <4205210.BZzHJHFGsf@avalon> (raw)
In-Reply-To: <CAAQKjZOt517fVhWvwQn3BN7ycavfWCyciitowam7LOF=hnotMA@mail.gmail.com>

Hello Inki,

On Saturday 17 Dec 2016 09:33:31 Inki Dae wrote:
> HI,
> 
> Thanks for patch. Reasonable to me and go to misc excepting below one thing.
> Please check my comment.
> 
> 2016-12-14 4:34 GMT+09:00 Laurent Pinchart:
> > 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(-)
> > 
> > diff --git a/drivers/gpu/drm/exynos/exynos_dp.c
> > b/drivers/gpu/drm/exynos/exynos_dp.c index 528229faffe4..b839f065f4b3
> > 100644
> > --- a/drivers/gpu/drm/exynos/exynos_dp.c
> > +++ b/drivers/gpu/drm/exynos/exynos_dp.c
> > @@ -102,7 +102,6 @@ static int exynos_dp_bridge_attach(struct
> > analogix_dp_plat_data *plat_data,> 
> >         struct drm_encoder *encoder = &dp->encoder;
> >         int ret;
> > 
> > -       drm_connector_register(connector);
> 
> You removed above function from encoder and connector drivers.Is
> removing this required?
> And is this related to this patch? If not so, it seems this change
> should go to another patch with the reason to remove this function
> call.

When using the .load() callback, driver initialization is performed from 
drm_dev_register() after the DRM device gets registered with sysfs. With this 
patch driver initialization is moved before drm_dev_register(), and 
registering connectors manually would then trigger a WARN due to the sysfs 
parent not being registered yet.

The connectors are registered by the DRM core (drm_modeset_register_all() 
called from drm_dev_register()), so there's no need to register them manually 
after drm_dev_register(), we can just drop that code.

-- 
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-17 22:11 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
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 [this message]
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=4205210.BZzHJHFGsf@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=daeinki@gmail.com \
    --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