From: Sean Paul <seanpaul@chromium.org>
To: Jeffy Chen <jeffy.chen@rock-chips.com>
Cc: linux-kernel@vger.kernel.org, briannorris@chromium.org,
dianders@chromium.org, tfiga@chromium.org, seanpaul@chromium.org,
zyw@rock-chips.com, marcheu@chromium.org,
mark.yao@rock-chips.com, hshi@chromium.org,
Daniel Vetter <daniel.vetter@intel.com>,
Jani Nikula <jani.nikula@linux.intel.com>,
dri-devel@lists.freedesktop.org, David Airlie <airlied@linux.ie>
Subject: Re: [PATCH] drm: Fixup hang when unregistering drm dev with open_count 0
Date: Tue, 11 Apr 2017 17:05:03 -0400 [thread overview]
Message-ID: <20170411210503.l3fcubrrbvpdwbkk@art_vandelay> (raw)
In-Reply-To: <1491944274-29007-1-git-send-email-jeffy.chen@rock-chips.com>
On Wed, Apr 12, 2017 at 04:57:54AM +0800, Jeffy Chen wrote:
> My previous patch (c5d8fac2bf drm: Unplug drm device when unregistering
> it) calls drm_unplug_dev when unregistering drm dev. But if open_count
> is 0, the unplug will try to unregister the drm dev again and cause
> deadlock.
>
> Fix it by dropping drm_unplug_dev and use drm_device_set_plug_state
> directly.
Hi Jeffy,
That patch was not applied anywhere, the test robot just picked it up from the
mailing list.
Please squash this into the original patch and re-send.
Thanks,
Sean
>
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
>
> ---
>
> drivers/gpu/drm/drm_drv.c | 15 +--------------
> include/drm/drm_drv.h | 1 -
> 2 files changed, 1 insertion(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index ad13e20..cc2d018 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -355,19 +355,6 @@ void drm_put_dev(struct drm_device *dev)
> }
> EXPORT_SYMBOL(drm_put_dev);
>
> -void drm_unplug_dev(struct drm_device *dev)
> -{
> - mutex_lock(&drm_global_mutex);
> -
> - drm_device_set_plug_state(dev, false);
> -
> - if (dev->open_count == 0) {
> - drm_put_dev(dev);
> - }
> - mutex_unlock(&drm_global_mutex);
> -}
> -EXPORT_SYMBOL(drm_unplug_dev);
> -
> /*
> * DRM internal mount
> * We want to be able to allocate our own "struct address_space" to control
> @@ -825,7 +812,7 @@ void drm_dev_unregister(struct drm_device *dev)
> drm_lastclose(dev);
>
> dev->registered = false;
> - drm_unplug_dev(dev);
> + drm_device_set_plug_state(dev, false);
>
> if (drm_core_check_feature(dev, DRIVER_MODESET))
> drm_modeset_unregister_all(dev);
> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
> index 0fefc3f..eb63078 100644
> --- a/include/drm/drm_drv.h
> +++ b/include/drm/drm_drv.h
> @@ -544,7 +544,6 @@ void drm_dev_unregister(struct drm_device *dev);
> void drm_dev_ref(struct drm_device *dev);
> void drm_dev_unref(struct drm_device *dev);
> void drm_put_dev(struct drm_device *dev);
> -void drm_unplug_dev(struct drm_device *dev);
>
> int drm_dev_set_unique(struct drm_device *dev, const char *name);
>
> --
> 2.1.4
>
--
Sean Paul, Software Engineer, Google / Chromium OS
prev parent reply other threads:[~2017-04-11 21:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-11 20:57 Jeffy Chen
2017-04-11 21:05 ` Sean Paul [this message]
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=20170411210503.l3fcubrrbvpdwbkk@art_vandelay \
--to=seanpaul@chromium.org \
--cc=airlied@linux.ie \
--cc=briannorris@chromium.org \
--cc=daniel.vetter@intel.com \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hshi@chromium.org \
--cc=jani.nikula@linux.intel.com \
--cc=jeffy.chen@rock-chips.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcheu@chromium.org \
--cc=mark.yao@rock-chips.com \
--cc=tfiga@chromium.org \
--cc=zyw@rock-chips.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
all inboxes | Powered by JetHome®