dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Agner <stefan@agner.ch>
To: daniel.vetter@ffwll.ch, meng.yi@nxp.com, dri-devel@lists.freedesktop.org
Cc: alison.wang@freescale.com, jianwei.wang.chn@gmail.com,
	linux-kernel@vger.kernel.org, Stefan Agner <stefan@agner.ch>
Subject: [PATCH 2/3] drm/fsl-dcu: unload driver before disabling clocks
Date: Wed, 19 Oct 2016 17:32:20 -0700	[thread overview]
Message-ID: <20161020003221.2941-3-stefan@agner.ch> (raw)
In-Reply-To: <20161020003221.2941-1-stefan@agner.ch>

Use drm_put_dev to unload the driver before disabling clocks.
Otherwise the driver might read a register during unload which
leads to an external abort.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
index 07969f5..66f3d2c 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
@@ -429,9 +429,9 @@ static int fsl_dcu_drm_remove(struct platform_device *pdev)
 {
 	struct fsl_dcu_drm_device *fsl_dev = platform_get_drvdata(pdev);
 
+	drm_put_dev(fsl_dev->drm);
 	clk_disable_unprepare(fsl_dev->clk);
 	clk_unregister(fsl_dev->pix_clk);
-	drm_put_dev(fsl_dev->drm);
 
 	return 0;
 }
-- 
2.10.0

  parent reply	other threads:[~2016-10-20  0:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20  0:32 [PATCH 0/3] drm/fsl-dcu: fix driver remove/DRM unload Stefan Agner
2016-10-20  0:32 ` [PATCH 1/3] drm/fb_cma_helper: do not free fbdev if there is none Stefan Agner
2016-10-20  6:42   ` Daniel Vetter
2016-10-20  0:32 ` Stefan Agner [this message]
2016-10-20  0:32 ` [PATCH 3/3] drm/fsl-dcu: disable outputs before unloading driver Stefan Agner
2016-11-17  0:59 ` [PATCH 0/3] drm/fsl-dcu: fix driver remove/DRM unload Stefan Agner

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=20161020003221.2941-3-stefan@agner.ch \
    --to=stefan@agner.ch \
    --cc=alison.wang@freescale.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jianwei.wang.chn@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=meng.yi@nxp.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;
as well as URLs for NNTP newsgroup(s).