aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwenxiong@linux.vnet.ibm.com <wenxiong@linux.vnet.ibm.com>2013-01-11 18:43:54 -0500
committerJames Bottomley <JBottomley@Parallels.com>2013-01-29 18:48:53 -0500
commit70233ac51b027f20d990f02e647cb195b7b644ce (patch)
treef65ad07fec000cf4884ef3fc544765bc28cd8109
parent4415e44518b0b6f73456ef28fc4f932e07a01280 (diff)
[SCSI] ipr: Fix sparse error in ipr driver
This patch fixes the following sparse error: CHECK drivers/scsi/ipr.c spinlock.h:147:9: warning: context imbalance in 'ipr_reset_reload' - unexpected unlock 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>
-rw-r--r--drivers/scsi/ipr.c69
1 files changed, 17 insertions, 52 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 17aea2d1ec7a..8fa79b83f2d3 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -2553,36 +2553,6 @@ static void ipr_oper_timeout(struct ipr_cmnd *ipr_cmd)
2553} 2553}
2554 2554
2555/** 2555/**
2556 * ipr_reset_reload - Reset/Reload the IOA
2557 * @ioa_cfg: ioa config struct
2558 * @shutdown_type: shutdown type
2559 *
2560 * This function resets the adapter and re-initializes it.
2561 * This function assumes that all new host commands have been stopped.
2562 * Return value:
2563 * SUCCESS / FAILED
2564 **/
2565static int ipr_reset_reload(struct ipr_ioa_cfg *ioa_cfg,
2566 enum ipr_shutdown_type shutdown_type)
2567{
2568 if (!ioa_cfg->in_reset_reload)
2569 ipr_initiate_ioa_reset(ioa_cfg, shutdown_type);
2570
2571 spin_unlock_irq(ioa_cfg->host->host_lock);
2572 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
2573 spin_lock_irq(ioa_cfg->host->host_lock);
2574
2575 /* If we got hit with a host reset while we were already resetting
2576 the adapter for some reason, and the reset failed. */
2577 if (ioa_cfg->hrrq[IPR_INIT_HRRQ].ioa_is_dead) {
2578 ipr_trace;
2579 return FAILED;
2580 }
2581
2582 return SUCCESS;
2583}
2584
2585/**
2586 * ipr_find_ses_entry - Find matching SES in SES table 2556 * ipr_find_ses_entry - Find matching SES in SES table
2587 * @res: resource entry struct of SES 2557 * @res: resource entry struct of SES
2588 * 2558 *
@@ -4797,22 +4767,18 @@ static int ipr_slave_alloc(struct scsi_device *sdev)
4797 return rc; 4767 return rc;
4798} 4768}
4799 4769
4800/** 4770static int ipr_eh_host_reset(struct scsi_cmnd *cmd)
4801 * ipr_eh_host_reset - Reset the host adapter
4802 * @scsi_cmd: scsi command struct
4803 *
4804 * Return value:
4805 * SUCCESS / FAILED
4806 **/
4807static int __ipr_eh_host_reset(struct scsi_cmnd *scsi_cmd)
4808{ 4771{
4809 struct ipr_ioa_cfg *ioa_cfg; 4772 struct ipr_ioa_cfg *ioa_cfg;
4810 int rc; 4773 unsigned long lock_flags = 0;
4774 int rc = SUCCESS;
4811 4775
4812 ENTER; 4776 ENTER;
4813 ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata; 4777 ioa_cfg = (struct ipr_ioa_cfg *) cmd->device->host->hostdata;
4778 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
4814 4779
4815 if (!ioa_cfg->in_reset_reload) { 4780 if (!ioa_cfg->in_reset_reload) {
4781 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_ABBREV);
4816 dev_err(&ioa_cfg->pdev->dev, 4782 dev_err(&ioa_cfg->pdev->dev,
4817 "Adapter being reset as a result of error recovery.\n"); 4783 "Adapter being reset as a result of error recovery.\n");
4818 4784
@@ -4820,20 +4786,19 @@ static int __ipr_eh_host_reset(struct scsi_cmnd *scsi_cmd)
4820 ioa_cfg->sdt_state = GET_DUMP; 4786 ioa_cfg->sdt_state = GET_DUMP;
4821 } 4787 }
4822 4788
4823 rc = ipr_reset_reload(ioa_cfg, IPR_SHUTDOWN_ABBREV); 4789 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
4824 4790 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
4825 LEAVE; 4791 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
4826 return rc;
4827}
4828
4829static int ipr_eh_host_reset(struct scsi_cmnd *cmd)
4830{
4831 int rc;
4832 4792
4833 spin_lock_irq(cmd->device->host->host_lock); 4793 /* If we got hit with a host reset while we were already resetting
4834 rc = __ipr_eh_host_reset(cmd); 4794 the adapter for some reason, and the reset failed. */
4835 spin_unlock_irq(cmd->device->host->host_lock); 4795 if (ioa_cfg->hrrq[IPR_INIT_HRRQ].ioa_is_dead) {
4796 ipr_trace;
4797 rc = FAILED;
4798 }
4836 4799
4800 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
4801 LEAVE;
4837 return rc; 4802 return rc;
4838} 4803}
4839 4804