diff options
author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2011-01-06 15:48:24 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-01-24 12:30:26 -0500 |
commit | 6eaf46fdc719991a3ccda1e14b274e9adb515978 (patch) | |
tree | 00d372c09bdf41e513e2b7fcf3259386df0e27c9 /drivers/scsi/hpsa.c | |
parent | 25c1e56a04e60af2414f8d81eda0fd10b8e7b961 (diff) |
[SCSI] hpsa: take the adapter lock in hpsa_wait_for_mode_change_ack
Need to take the lock while accessing the register to check to
see if config table changes have taken effect.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r-- | drivers/scsi/hpsa.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 5b9cd41d9320..4fb62c2aac05 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -3553,13 +3553,18 @@ static inline void hpsa_p600_dma_prefetch_quirk(struct ctlr_info *h) | |||
3553 | static void __devinit hpsa_wait_for_mode_change_ack(struct ctlr_info *h) | 3553 | static void __devinit hpsa_wait_for_mode_change_ack(struct ctlr_info *h) |
3554 | { | 3554 | { |
3555 | int i; | 3555 | int i; |
3556 | u32 doorbell_value; | ||
3557 | unsigned long flags; | ||
3556 | 3558 | ||
3557 | /* under certain very rare conditions, this can take awhile. | 3559 | /* under certain very rare conditions, this can take awhile. |
3558 | * (e.g.: hot replace a failed 144GB drive in a RAID 5 set right | 3560 | * (e.g.: hot replace a failed 144GB drive in a RAID 5 set right |
3559 | * as we enter this code.) | 3561 | * as we enter this code.) |
3560 | */ | 3562 | */ |
3561 | for (i = 0; i < MAX_CONFIG_WAIT; i++) { | 3563 | for (i = 0; i < MAX_CONFIG_WAIT; i++) { |
3562 | if (!(readl(h->vaddr + SA5_DOORBELL) & CFGTBL_ChangeReq)) | 3564 | spin_lock_irqsave(&h->lock, flags); |
3565 | doorbell_value = readl(h->vaddr + SA5_DOORBELL); | ||
3566 | spin_unlock_irqrestore(&h->lock, flags); | ||
3567 | if (!doorbell_value & CFGTBL_ChangeReq) | ||
3563 | break; | 3568 | break; |
3564 | /* delay and try again */ | 3569 | /* delay and try again */ |
3565 | msleep(10); | 3570 | msleep(10); |
@@ -3731,6 +3736,8 @@ static int __devinit hpsa_init_one(struct pci_dev *pdev, | |||
3731 | h->busy_initializing = 1; | 3736 | h->busy_initializing = 1; |
3732 | INIT_HLIST_HEAD(&h->cmpQ); | 3737 | INIT_HLIST_HEAD(&h->cmpQ); |
3733 | INIT_HLIST_HEAD(&h->reqQ); | 3738 | INIT_HLIST_HEAD(&h->reqQ); |
3739 | spin_lock_init(&h->lock); | ||
3740 | spin_lock_init(&h->scan_lock); | ||
3734 | rc = hpsa_pci_init(h); | 3741 | rc = hpsa_pci_init(h); |
3735 | if (rc != 0) | 3742 | if (rc != 0) |
3736 | goto clean1; | 3743 | goto clean1; |
@@ -3790,8 +3797,6 @@ static int __devinit hpsa_init_one(struct pci_dev *pdev, | |||
3790 | } | 3797 | } |
3791 | if (hpsa_allocate_sg_chain_blocks(h)) | 3798 | if (hpsa_allocate_sg_chain_blocks(h)) |
3792 | goto clean4; | 3799 | goto clean4; |
3793 | spin_lock_init(&h->lock); | ||
3794 | spin_lock_init(&h->scan_lock); | ||
3795 | init_waitqueue_head(&h->scan_wait_queue); | 3800 | init_waitqueue_head(&h->scan_wait_queue); |
3796 | h->scan_finished = 1; /* no scan currently in progress */ | 3801 | h->scan_finished = 1; /* no scan currently in progress */ |
3797 | 3802 | ||