All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Asai Thambi S P <asamymuthupa@micron.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Sam Bradshaw <sbradshaw@micron.com>
Subject: Re: [PATCH 06/11] mtip32xx: Use plain spinlock for 'cmd_issue_lock'
Date: Thu, 31 May 2012 08:44:23 +0200	[thread overview]
Message-ID: <4FC71347.3030107@kernel.dk> (raw)
In-Reply-To: <4FC57B34.3020405@micron.com>

On 05/30/2012 03:43 AM, Asai Thambi S P wrote:
> 
> 'cmd_issue_lock' is for only acquiring a free slot, and it is not used
> in interrupt context. So replaced irq version with non-irq version of spinlock.
> 
> Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com>
> ---
>  drivers/block/mtip32xx/mtip32xx.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
> index 801e70c..a8a5522 100644
> --- a/drivers/block/mtip32xx/mtip32xx.c
> +++ b/drivers/block/mtip32xx/mtip32xx.c
> @@ -294,18 +294,16 @@ static int hba_reset_nosleep(struct driver_data *dd)
>   */
>  static inline void mtip_issue_ncq_command(struct mtip_port *port, int tag)
>  {
> -	unsigned long flags = 0;
> -
>  	atomic_set(&port->commands[tag].active, 1);
>  
> -	spin_lock_irqsave(&port->cmd_issue_lock, flags);
> +	spin_lock(&port->cmd_issue_lock);
>  
>  	writel((1 << MTIP_TAG_BIT(tag)),
>  			port->s_active[MTIP_TAG_INDEX(tag)]);
>  	writel((1 << MTIP_TAG_BIT(tag)),
>  			port->cmd_issue[MTIP_TAG_INDEX(tag)]);
>  
> -	spin_unlock_irqrestore(&port->cmd_issue_lock, flags);
> +	spin_unlock(&port->cmd_issue_lock);

Looks fine - wasn't going to comment specifically on this one, but
wanted to say, that in general you don't need to pre-clear the flags
variable before passing it to _irqsave().

-- 
Jens Axboe


      reply	other threads:[~2012-05-31  6:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-30  1:43 [PATCH 06/11] mtip32xx: Use plain spinlock for 'cmd_issue_lock' Asai Thambi S P
2012-05-31  6:44 ` Jens Axboe [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=4FC71347.3030107@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=asamymuthupa@micron.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sbradshaw@micron.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.