aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ipr.c
diff options
context:
space:
mode:
authorwenxiong@linux.vnet.ibm.com <wenxiong@linux.vnet.ibm.com>2013-05-24 10:59:13 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-06-26 13:48:38 -0400
commitfeccada972756b959e21d450e75f91907e53e9e1 (patch)
treef189105617db507fc13421c776de876517e5facc /drivers/scsi/ipr.c
parent3bd3e8bf6250f32c153d95f85ec9249ed305589d (diff)
[SCSI] ipr: possible irq lock inversion dependency detected
When enable lockdep, seeing "possible irq lock inversion dependency detected" error. This patch fixes the issue. Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com> Acked-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/ipr.c')
-rw-r--r--drivers/scsi/ipr.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 6c4cedb44c07..a87767f73913 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -9392,7 +9392,7 @@ static int ipr_probe_ioa(struct pci_dev *pdev,
9392 void __iomem *ipr_regs; 9392 void __iomem *ipr_regs;
9393 int rc = PCIBIOS_SUCCESSFUL; 9393 int rc = PCIBIOS_SUCCESSFUL;
9394 volatile u32 mask, uproc, interrupts; 9394 volatile u32 mask, uproc, interrupts;
9395 unsigned long lock_flags; 9395 unsigned long lock_flags, driver_lock_flags;
9396 9396
9397 ENTER; 9397 ENTER;
9398 9398
@@ -9615,9 +9615,9 @@ static int ipr_probe_ioa(struct pci_dev *pdev,
9615 } else 9615 } else
9616 ioa_cfg->reset = ipr_reset_start_bist; 9616 ioa_cfg->reset = ipr_reset_start_bist;
9617 9617
9618 spin_lock(&ipr_driver_lock); 9618 spin_lock_irqsave(&ipr_driver_lock, driver_lock_flags);
9619 list_add_tail(&ioa_cfg->queue, &ipr_ioa_head); 9619 list_add_tail(&ioa_cfg->queue, &ipr_ioa_head);
9620 spin_unlock(&ipr_driver_lock); 9620 spin_unlock_irqrestore(&ipr_driver_lock, driver_lock_flags);
9621 9621
9622 LEAVE; 9622 LEAVE;
9623out: 9623out:
@@ -9700,6 +9700,7 @@ static void __ipr_remove(struct pci_dev *pdev)
9700 unsigned long host_lock_flags = 0; 9700 unsigned long host_lock_flags = 0;
9701 struct ipr_ioa_cfg *ioa_cfg = pci_get_drvdata(pdev); 9701 struct ipr_ioa_cfg *ioa_cfg = pci_get_drvdata(pdev);
9702 int i; 9702 int i;
9703 unsigned long driver_lock_flags;
9703 ENTER; 9704 ENTER;
9704 9705
9705 spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags); 9706 spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags);
@@ -9723,9 +9724,9 @@ static void __ipr_remove(struct pci_dev *pdev)
9723 INIT_LIST_HEAD(&ioa_cfg->used_res_q); 9724 INIT_LIST_HEAD(&ioa_cfg->used_res_q);
9724 spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags); 9725 spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags);
9725 9726
9726 spin_lock(&ipr_driver_lock); 9727 spin_lock_irqsave(&ipr_driver_lock, driver_lock_flags);
9727 list_del(&ioa_cfg->queue); 9728 list_del(&ioa_cfg->queue);
9728 spin_unlock(&ipr_driver_lock); 9729 spin_unlock_irqrestore(&ipr_driver_lock, driver_lock_flags);
9729 9730
9730 if (ioa_cfg->sdt_state == ABORT_DUMP) 9731 if (ioa_cfg->sdt_state == ABORT_DUMP)
9731 ioa_cfg->sdt_state = WAIT_FOR_DUMP; 9732 ioa_cfg->sdt_state = WAIT_FOR_DUMP;
@@ -9991,12 +9992,12 @@ static int ipr_halt(struct notifier_block *nb, ulong event, void *buf)
9991{ 9992{
9992 struct ipr_cmnd *ipr_cmd; 9993 struct ipr_cmnd *ipr_cmd;
9993 struct ipr_ioa_cfg *ioa_cfg; 9994 struct ipr_ioa_cfg *ioa_cfg;
9994 unsigned long flags = 0; 9995 unsigned long flags = 0, driver_lock_flags;
9995 9996
9996 if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF) 9997 if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF)
9997 return NOTIFY_DONE; 9998 return NOTIFY_DONE;
9998 9999
9999 spin_lock(&ipr_driver_lock); 10000 spin_lock_irqsave(&ipr_driver_lock, driver_lock_flags);
10000 10001
10001 list_for_each_entry(ioa_cfg, &ipr_ioa_head, queue) { 10002 list_for_each_entry(ioa_cfg, &ipr_ioa_head, queue) {
10002 spin_lock_irqsave(ioa_cfg->host->host_lock, flags); 10003 spin_lock_irqsave(ioa_cfg->host->host_lock, flags);
@@ -10014,7 +10015,7 @@ static int ipr_halt(struct notifier_block *nb, ulong event, void *buf)
10014 ipr_do_req(ipr_cmd, ipr_halt_done, ipr_timeout, IPR_DEVICE_RESET_TIMEOUT); 10015 ipr_do_req(ipr_cmd, ipr_halt_done, ipr_timeout, IPR_DEVICE_RESET_TIMEOUT);
10015 spin_unlock_irqrestore(ioa_cfg->host->host_lock, flags); 10016 spin_unlock_irqrestore(ioa_cfg->host->host_lock, flags);
10016 } 10017 }
10017 spin_unlock(&ipr_driver_lock); 10018 spin_unlock_irqrestore(&ipr_driver_lock, driver_lock_flags);
10018 10019
10019 return NOTIFY_OK; 10020 return NOTIFY_OK;
10020} 10021}