linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Damien Le Moal <Damien.LeMoal@wdc.com>
To: Tian Tao <tiantao6@hisilicon.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH] skd: replace spin_lock_irqsave by spin_lock in hard IRQ
Date: Tue, 27 Oct 2020 04:09:05 +0000	[thread overview]
Message-ID: <BL0PR04MB65149BE243D53CEF34C992C5E7160@BL0PR04MB6514.namprd04.prod.outlook.com> (raw)
In-Reply-To: 1603243006-9189-1-git-send-email-tiantao6@hisilicon.com

On 2020/10/21 10:16, Tian Tao wrote:
> The code has been in a irq-disabled context since it is hard IRQ. There
> is no necessity to do it again.
> 
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> ---
>  drivers/block/skd_main.c | 25 ++++++++++---------------
>  1 file changed, 10 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c
> index ae6454c..e80b670 100644
> --- a/drivers/block/skd_main.c
> +++ b/drivers/block/skd_main.c
> @@ -2368,40 +2368,37 @@ static int skd_unquiesce_dev(struct skd_device *skdev)
>  static irqreturn_t skd_reserved_isr(int irq, void *skd_host_data)
>  {
>  	struct skd_device *skdev = skd_host_data;
> -	unsigned long flags;
>  
> -	spin_lock_irqsave(&skdev->lock, flags);
> +	spin_lock(&skdev->lock);
>  	dev_dbg(&skdev->pdev->dev, "MSIX = 0x%x\n",
>  		SKD_READL(skdev, FIT_INT_STATUS_HOST));
>  	dev_err(&skdev->pdev->dev, "MSIX reserved irq %d = 0x%x\n", irq,
>  		SKD_READL(skdev, FIT_INT_STATUS_HOST));
>  	SKD_WRITEL(skdev, FIT_INT_RESERVED_MASK, FIT_INT_STATUS_HOST);
> -	spin_unlock_irqrestore(&skdev->lock, flags);
> +	spin_unlock(&skdev->lock);
>  	return IRQ_HANDLED;
>  }
>  
>  static irqreturn_t skd_statec_isr(int irq, void *skd_host_data)
>  {
>  	struct skd_device *skdev = skd_host_data;
> -	unsigned long flags;
>  
> -	spin_lock_irqsave(&skdev->lock, flags);
> +	spin_lock(&skdev->lock);
>  	dev_dbg(&skdev->pdev->dev, "MSIX = 0x%x\n",
>  		SKD_READL(skdev, FIT_INT_STATUS_HOST));
>  	SKD_WRITEL(skdev, FIT_ISH_FW_STATE_CHANGE, FIT_INT_STATUS_HOST);
>  	skd_isr_fwstate(skdev);
> -	spin_unlock_irqrestore(&skdev->lock, flags);
> +	spin_unlock(&skdev->lock);
>  	return IRQ_HANDLED;
>  }
>  
>  static irqreturn_t skd_comp_q(int irq, void *skd_host_data)
>  {
>  	struct skd_device *skdev = skd_host_data;
> -	unsigned long flags;
>  	int flush_enqueued = 0;
>  	int deferred;
>  
> -	spin_lock_irqsave(&skdev->lock, flags);
> +	spin_lock(&skdev->lock);
>  	dev_dbg(&skdev->pdev->dev, "MSIX = 0x%x\n",
>  		SKD_READL(skdev, FIT_INT_STATUS_HOST));
>  	SKD_WRITEL(skdev, FIT_ISH_COMPLETION_POSTED, FIT_INT_STATUS_HOST);
> @@ -2415,7 +2412,7 @@ static irqreturn_t skd_comp_q(int irq, void *skd_host_data)
>  	else if (!flush_enqueued)
>  		schedule_work(&skdev->start_queue);
>  
> -	spin_unlock_irqrestore(&skdev->lock, flags);
> +	spin_unlock(&skdev->lock);
>  
>  	return IRQ_HANDLED;
>  }
> @@ -2423,27 +2420,25 @@ static irqreturn_t skd_comp_q(int irq, void *skd_host_data)
>  static irqreturn_t skd_msg_isr(int irq, void *skd_host_data)
>  {
>  	struct skd_device *skdev = skd_host_data;
> -	unsigned long flags;
>  
> -	spin_lock_irqsave(&skdev->lock, flags);
> +	spin_lock(&skdev->lock);
>  	dev_dbg(&skdev->pdev->dev, "MSIX = 0x%x\n",
>  		SKD_READL(skdev, FIT_INT_STATUS_HOST));
>  	SKD_WRITEL(skdev, FIT_ISH_MSG_FROM_DEV, FIT_INT_STATUS_HOST);
>  	skd_isr_msg_from_dev(skdev);
> -	spin_unlock_irqrestore(&skdev->lock, flags);
> +	spin_unlock(&skdev->lock);
>  	return IRQ_HANDLED;
>  }
>  
>  static irqreturn_t skd_qfull_isr(int irq, void *skd_host_data)
>  {
>  	struct skd_device *skdev = skd_host_data;
> -	unsigned long flags;
>  
> -	spin_lock_irqsave(&skdev->lock, flags);
> +	spin_lock(&skdev->lock);
>  	dev_dbg(&skdev->pdev->dev, "MSIX = 0x%x\n",
>  		SKD_READL(skdev, FIT_INT_STATUS_HOST));
>  	SKD_WRITEL(skdev, FIT_INT_QUEUE_FULL, FIT_INT_STATUS_HOST);
> -	spin_unlock_irqrestore(&skdev->lock, flags);
> +	spin_unlock(&skdev->lock);
>  	return IRQ_HANDLED;
>  }
>  
> 

Looks OK to me.

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>

-- 
Damien Le Moal
Western Digital Research

      reply	other threads:[~2020-10-27  4:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21  1:16 [PATCH] skd: replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
2020-10-27  4:09 ` Damien Le Moal [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=BL0PR04MB65149BE243D53CEF34C992C5E7160@BL0PR04MB6514.namprd04.prod.outlook.com \
    --to=damien.lemoal@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).