aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ipr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/ipr.c')
-rw-r--r--drivers/scsi/ipr.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 2c7b77e833f9..f7af86f73d6b 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -2635,8 +2635,13 @@ static ssize_t ipr_store_diagnostics(struct class_device *class_dev,
2635 if (!capable(CAP_SYS_ADMIN)) 2635 if (!capable(CAP_SYS_ADMIN))
2636 return -EACCES; 2636 return -EACCES;
2637 2637
2638 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
2639 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); 2638 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2639 while(ioa_cfg->in_reset_reload) {
2640 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2641 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
2642 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2643 }
2644
2640 ioa_cfg->errors_logged = 0; 2645 ioa_cfg->errors_logged = 0;
2641 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NORMAL); 2646 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NORMAL);
2642 2647
@@ -2958,6 +2963,11 @@ static int ipr_update_ioa_ucode(struct ipr_ioa_cfg *ioa_cfg,
2958 unsigned long lock_flags; 2963 unsigned long lock_flags;
2959 2964
2960 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); 2965 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2966 while(ioa_cfg->in_reset_reload) {
2967 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2968 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
2969 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2970 }
2961 2971
2962 if (ioa_cfg->ucode_sglist) { 2972 if (ioa_cfg->ucode_sglist) {
2963 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 2973 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
@@ -7428,6 +7438,12 @@ static void __ipr_remove(struct pci_dev *pdev)
7428 ENTER; 7438 ENTER;
7429 7439
7430 spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags); 7440 spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags);
7441 while(ioa_cfg->in_reset_reload) {
7442 spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags);
7443 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
7444 spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags);
7445 }
7446
7431 ipr_initiate_ioa_bringdown(ioa_cfg, IPR_SHUTDOWN_NORMAL); 7447 ipr_initiate_ioa_bringdown(ioa_cfg, IPR_SHUTDOWN_NORMAL);
7432 7448
7433 spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags); 7449 spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags);
@@ -7551,6 +7567,12 @@ static void ipr_shutdown(struct pci_dev *pdev)
7551 unsigned long lock_flags = 0; 7567 unsigned long lock_flags = 0;
7552 7568
7553 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); 7569 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
7570 while(ioa_cfg->in_reset_reload) {
7571 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
7572 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
7573 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
7574 }
7575
7554 ipr_initiate_ioa_bringdown(ioa_cfg, IPR_SHUTDOWN_NORMAL); 7576 ipr_initiate_ioa_bringdown(ioa_cfg, IPR_SHUTDOWN_NORMAL);
7555 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 7577 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
7556 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload); 7578 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);