mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Lyude Paul <lyude@redhat.com>
Cc: dri-devel@lists.freedesktop.org, Daniel Vetter <daniel@ffwll.ch>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@linux.ie>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/5] drm/vblank: Use spin_(un)lock_irq() in drm_queue_vblank_event()
Date: Tue, 21 Jul 2020 08:50:58 +0200	[thread overview]
Message-ID: <20200721065058.GA3278063@phenom.ffwll.local> (raw)
In-Reply-To: <20200720190736.180297-5-lyude@redhat.com>

On Mon, Jul 20, 2020 at 03:07:35PM -0400, Lyude Paul wrote:
> This one's easy - we're already calling kzalloc() in this function, so

Nit: "kzalloc(GFP_KERNEL)", since kzalloc(GFP_ATOMIC) is perfectly fine in
interrupt context. With that clarified for the entire series:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> we must already be guaranteed to have IRQs enabled when calling this.
> So, use the plain _irq() variants of spin_(un)lock() to make this more
> obvious.
> 
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> ---
>  drivers/gpu/drm/drm_vblank.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
> index 51f2e988205e7..64610070ba473 100644
> --- a/drivers/gpu/drm/drm_vblank.c
> +++ b/drivers/gpu/drm/drm_vblank.c
> @@ -1611,7 +1611,6 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
>  	struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
>  	struct drm_pending_vblank_event *e;
>  	ktime_t now;
> -	unsigned long flags;
>  	u64 seq;
>  	int ret;
>  
> @@ -1633,7 +1632,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
>  			e->event.vbl.crtc_id = crtc->base.id;
>  	}
>  
> -	spin_lock_irqsave(&dev->event_lock, flags);
> +	spin_lock_irq(&dev->event_lock);
>  
>  	/*
>  	 * drm_crtc_vblank_off() might have been called after we called
> @@ -1670,12 +1669,12 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
>  		vblwait->reply.sequence = req_seq;
>  	}
>  
> -	spin_unlock_irqrestore(&dev->event_lock, flags);
> +	spin_unlock_irq(&dev->event_lock);
>  
>  	return 0;
>  
>  err_unlock:
> -	spin_unlock_irqrestore(&dev->event_lock, flags);
> +	spin_unlock_irq(&dev->event_lock);
>  	kfree(e);
>  err_put:
>  	drm_vblank_put(dev, pipe);
> -- 
> 2.26.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2020-07-21  6:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200720190736.180297-1-lyude@redhat.com>
2020-07-20 19:07 ` [PATCH 1/5] drm/vblank: Use spin_(un)lock_irq() in drm_crtc_vblank_reset() Lyude Paul
2020-07-20 19:07 ` [PATCH 2/5] drm/vblank: Use spin_(un)lock_irq() in drm_crtc_vblank_on() Lyude Paul
2020-07-20 19:07 ` [PATCH 3/5] drm/vblank: Use spin_(un)lock_irq() in drm_legacy_vblank_post_modeset() Lyude Paul
2020-07-20 19:07 ` [PATCH 4/5] drm/vblank: Use spin_(un)lock_irq() in drm_queue_vblank_event() Lyude Paul
2020-07-21  6:50   ` Daniel Vetter [this message]
2020-07-20 19:07 ` [PATCH 5/5] drm/vblank: Use spin_(un)lock_irq() in drm_crtc_queue_sequence_ioctl() Lyude Paul

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=20200721065058.GA3278063@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=tzimmermann@suse.de \
    /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®