public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Tian Tao <tiantao6@hisilicon.com>
Cc: <eric.auger@redhat.com>, <cohuck@redhat.com>,
	<kvm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<song.bao.hua@hisilicon.com>, <linuxarm@huawei.com>
Subject: Re: [PATCH] vfio/platform: Replace spin_lock_irqsave by spin_lock in hard IRQ
Date: Tue, 13 Oct 2020 15:32:29 -0600	[thread overview]
Message-ID: <20201013153229.7fe74e65@w520.home> (raw)
In-Reply-To: <1602554458-26927-1-git-send-email-tiantao6@hisilicon.com>

On Tue, 13 Oct 2020 10:00:58 +0800
Tian Tao <tiantao6@hisilicon.com> wrote:

> It is redundant to do irqsave and irqrestore in hardIRQ context.

But this function is also called from non-IRQ context.  Thanks,

Alex
 
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> ---
>  drivers/vfio/platform/vfio_platform_irq.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/vfio/platform/vfio_platform_irq.c b/drivers/vfio/platform/vfio_platform_irq.c
> index c5b09ec..24fd6c5 100644
> --- a/drivers/vfio/platform/vfio_platform_irq.c
> +++ b/drivers/vfio/platform/vfio_platform_irq.c
> @@ -139,10 +139,9 @@ static int vfio_platform_set_irq_unmask(struct vfio_platform_device *vdev,
>  static irqreturn_t vfio_automasked_irq_handler(int irq, void *dev_id)
>  {
>  	struct vfio_platform_irq *irq_ctx = dev_id;
> -	unsigned long flags;
>  	int ret = IRQ_NONE;
>  
> -	spin_lock_irqsave(&irq_ctx->lock, flags);
> +	spin_lock(&irq_ctx->lock);
>  
>  	if (!irq_ctx->masked) {
>  		ret = IRQ_HANDLED;
> @@ -152,7 +151,7 @@ static irqreturn_t vfio_automasked_irq_handler(int irq, void *dev_id)
>  		irq_ctx->masked = true;
>  	}
>  
> -	spin_unlock_irqrestore(&irq_ctx->lock, flags);
> +	spin_unlock(&irq_ctx->lock);
>  
>  	if (ret == IRQ_HANDLED)
>  		eventfd_signal(irq_ctx->trigger, 1);


  reply	other threads:[~2020-10-13 21:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13  2:00 [PATCH] vfio/platform: Replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
2020-10-13 21:32 ` Alex Williamson [this message]
2020-10-14  0:15   ` Song Bao Hua (Barry Song)
2020-10-14  0:50     ` Alex Williamson
2020-10-14  1:19       ` Song Bao Hua (Barry Song)

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=20201013153229.7fe74e65@w520.home \
    --to=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=song.bao.hua@hisilicon.com \
    --cc=tiantao6@hisilicon.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