Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Chen-Yu Tsai <wens@csie.org>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	David Airlie <airlied@linux.ie>,
	linux-sunxi <linux-sunxi@googlegroups.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [linux-sunxi] [PATCH 3/3] drm/sun4i: Fix component unbinding and component master deletion
Date: Thu, 18 Apr 2019 19:23:05 +0200	[thread overview]
Message-ID: <db33cf62349f13dbb6e1eaa7dc970df97d2cb257.camel@bootlin.com> (raw)
In-Reply-To: <CAGb2v67MYXQsdv7E_SGXALVVr0T7aTTP6AhwA3N8U7HNJkRH7w@mail.gmail.com>

Hi,

Le jeudi 18 avril 2019 à 08:03 -0700, Chen-Yu Tsai a écrit :
> On Thu, Apr 18, 2019 at 6:27 AM Paul Kocialkowski
> <paul.kocialkowski@bootlin.com> wrote:
> > For our component-backed driver to be properly removed, we need to
> > delete the component master in sun4i_drv_remove and make sure to call
> > component_unbind_all in the master's unbind so that all components are
> > unbound when the master is.
> > 
> > Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support")
> > Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> > ---
> >  drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
> > index af07291544a4..0ea365e54de1 100644
> > --- a/drivers/gpu/drm/sun4i/sun4i_drv.c
> > +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
> > @@ -137,6 +137,8 @@ static void sun4i_drv_unbind(struct device *dev)
> >         drm_mode_config_cleanup(drm);
> >         of_reserved_mem_device_release(dev);
> >         drm_dev_put(drm);
> > +
> > +       component_unbind_all(dev, NULL);
> 
> Shouldn't this be before drm_dev_put? Everything being in reverse order
> of the complement calls in the bind function and all. The component
> drivers might still be using the drm dev before they are unbound.

Mhh, yes that's a valid concern, thanks for pointing it out. I'll send
out a fix for it tomorrow.

Cheers,

Paul

> ChenYu
> 
> >  }
> > 
> >  static const struct component_master_ops sun4i_drv_master_ops = {
> > @@ -385,6 +387,8 @@ static int sun4i_drv_probe(struct platform_device *pdev)
> > 
> >  static int sun4i_drv_remove(struct platform_device *pdev)
> >  {
> > +       component_master_del(&pdev->dev, &sun4i_drv_master_ops);
> > +
> >         return 0;
> >  }
> > 
> > --
> > 2.21.0
> > 
> > --
> > You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-04-18 17:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18 13:27 [PATCH 0/3] sun4i/drm: Fixes for removing and re-probing the driver Paul Kocialkowski
2019-04-18 13:27 ` [PATCH 1/3] drm/sun4i: Add missing drm_atomic_helper_shutdown at driver unbind Paul Kocialkowski
2019-04-18 13:27 ` [PATCH 2/3] drm/sun4i: Set device driver data at bind time for use in unbind Paul Kocialkowski
2019-04-18 13:27 ` [PATCH 3/3] drm/sun4i: Fix component unbinding and component master deletion Paul Kocialkowski
2019-04-18 15:03   ` [linux-sunxi] " Chen-Yu Tsai
2019-04-18 17:23     ` Paul Kocialkowski [this message]
2019-04-18 14:27 ` [PATCH 0/3] sun4i/drm: Fixes for removing and re-probing the driver Maxime Ripard

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=db33cf62349f13dbb6e1eaa7dc970df97d2cb257.camel@bootlin.com \
    --to=paul.kocialkowski@bootlin.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wens@csie.org \
    /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