From: Daniel Vetter <daniel@ffwll.ch>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>,
dri-devel@lists.freedesktop.org, David Airlie <airlied@linux.ie>,
syzbot <syzbot+6ea337c427f5083ebdf2@syzkaller.appspotmail.com>,
Sean Paul <sean@poorly.run>
Subject: Re: [PATCH (resend)] gpu/drm: Fix lock held when returning to user space.
Date: Thu, 10 Jan 2019 11:32:11 +0100 [thread overview]
Message-ID: <20190110103211.GJ21184@phenom.ffwll.local> (raw)
In-Reply-To: <1547115571-21219-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp>
On Thu, Jan 10, 2019 at 07:19:31PM +0900, Tetsuo Handa wrote:
> We need to call drm_modeset_acquire_fini() when drm_atomic_state_alloc()
> failed or call drm_modeset_acquire_init() after drm_atomic_state_alloc()
> succeeded.
>
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Reported-by: syzbot <syzbot+6ea337c427f5083ebdf2@syzkaller.appspotmail.com>
Queued for 5.0, thanks for your patch.
-Daniel
> ---
> drivers/gpu/drm/drm_atomic_uapi.c | 3 +--
> drivers/gpu/drm/drm_mode_object.c | 4 ++--
> 2 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
> index c408898..9a1f41a 100644
> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -1296,12 +1296,11 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
> (arg->flags & DRM_MODE_PAGE_FLIP_EVENT))
> return -EINVAL;
>
> - drm_modeset_acquire_init(&ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE);
> -
> state = drm_atomic_state_alloc(dev);
> if (!state)
> return -ENOMEM;
>
> + drm_modeset_acquire_init(&ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE);
> state->acquire_ctx = &ctx;
> state->allow_modeset = !!(arg->flags & DRM_MODE_ATOMIC_ALLOW_MODESET);
>
> diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c
> index cd9bc0c..004191d 100644
> --- a/drivers/gpu/drm/drm_mode_object.c
> +++ b/drivers/gpu/drm/drm_mode_object.c
> @@ -459,11 +459,11 @@ static int set_property_atomic(struct drm_mode_object *obj,
> struct drm_modeset_acquire_ctx ctx;
> int ret;
>
> - drm_modeset_acquire_init(&ctx, 0);
> -
> state = drm_atomic_state_alloc(dev);
> if (!state)
> return -ENOMEM;
> +
> + drm_modeset_acquire_init(&ctx, 0);
> state->acquire_ctx = &ctx;
> retry:
> if (prop == state->dev->mode_config.dpms_property) {
> --
> 1.8.3.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2019-01-10 10:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-10 10:19 [PATCH (resend)] gpu/drm: Fix lock held when returning to user space Tetsuo Handa
2019-01-10 10:32 ` Daniel Vetter [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=20190110103211.GJ21184@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=maxime.ripard@bootlin.com \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=sean@poorly.run \
--cc=syzbot+6ea337c427f5083ebdf2@syzkaller.appspotmail.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