lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4FC71347.3030107@kernel.dk>
Date:	Thu, 31 May 2012 08:44:23 +0200
From:	Jens Axboe <axboe@...nel.dk>
To:	Asai Thambi S P <asamymuthupa@...ron.com>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Sam Bradshaw <sbradshaw@...ron.com>
Subject: Re: [PATCH 06/11] mtip32xx: Use plain spinlock for 'cmd_issue_lock'

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@...ron.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ