mtip32xx: Use plain spinlock for 'cmd_issue_lock'
PATCH 6/11 mtip32xx: Use plain spinlock for 'cmd_issue_lock'
'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 <[email protected]>
--- drivers/block/mtip32xx/mtip32xx.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/block/mtip32xx/mtip32xx.c +2 -4
@@ -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);/* Set the command's timeout value.*/ port->commands[tag].comp_time = jiffies + msecs_to_jiffies(
Signature · 1 line
1.7.1
Jens Axboe
maintainerQuoted 21 lines · Asai Thambi S P
'
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 <[email protected]>--- drivers/block/mtip32xx/mtip32xx.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)drivers/block/mtip32xx/mtip32xx.c +0
-2@@ -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 );
drivers/block/mtip32xx/mtip32xx.c static int hba_reset_nosleep(struct driver_data *dd) · line 306
Quoted 10 lines
drivers/block/mtip32xx/mtip32xx.c +2
-2-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().
Signature · 1 line
Jens Axboe