diff options
author | Robert Elliott <elliott@hp.com> | 2015-01-23 17:44:56 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2015-02-02 12:57:44 -0500 |
commit | 007e7aa9b37d570fc5917522a6f6bcca14264632 (patch) | |
tree | 409e0e473cc001fb438c96a2ed38436cf2b65101 /drivers/scsi | |
parent | 8ebc92483211f49ee5f072d2e51de3e70ca05fc1 (diff) |
hpsa: shorten the wait for the CISS doorbell mode change ack
Shorten the wait for the CISS configuration table doorbell mode
change acknowledgment from 300-600 s to 20 s, which is the value
specified in the CISS specification that should be honored by
all controllers.
Wait using interruptible msleep() rather than uninterruptible
usleep_range(), which triggers rt_sched timeout errors if the
wait is long.
Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/hpsa.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index a92653a18bd2..89744a152427 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -60,8 +60,11 @@ | |||
60 | #define DRIVER_NAME "HP HPSA Driver (v " HPSA_DRIVER_VERSION ")" | 60 | #define DRIVER_NAME "HP HPSA Driver (v " HPSA_DRIVER_VERSION ")" |
61 | #define HPSA "hpsa" | 61 | #define HPSA "hpsa" |
62 | 62 | ||
63 | /* How long to wait (in milliseconds) for board to go into simple mode */ | 63 | /* How long to wait for CISS doorbell communication */ |
64 | #define MAX_CONFIG_WAIT 30000 | 64 | #define CLEAR_EVENT_WAIT_INTERVAL 20 /* ms for each msleep() call */ |
65 | #define MODE_CHANGE_WAIT_INTERVAL 10 /* ms for each msleep() call */ | ||
66 | #define MAX_CLEAR_EVENT_WAIT 30000 /* times 20 ms = 600 s */ | ||
67 | #define MAX_MODE_CHANGE_WAIT 2000 /* times 10 ms = 20 s */ | ||
65 | #define MAX_IOCTL_CONFIG_WAIT 1000 | 68 | #define MAX_IOCTL_CONFIG_WAIT 1000 |
66 | 69 | ||
67 | /*define how many times we will try a command because of bus resets */ | 70 | /*define how many times we will try a command because of bus resets */ |
@@ -6194,14 +6197,14 @@ static void hpsa_wait_for_clear_event_notify_ack(struct ctlr_info *h) | |||
6194 | u32 doorbell_value; | 6197 | u32 doorbell_value; |
6195 | unsigned long flags; | 6198 | unsigned long flags; |
6196 | /* wait until the clear_event_notify bit 6 is cleared by controller. */ | 6199 | /* wait until the clear_event_notify bit 6 is cleared by controller. */ |
6197 | for (i = 0; i < MAX_CONFIG_WAIT; i++) { | 6200 | for (i = 0; i < MAX_CLEAR_EVENT_WAIT; i++) { |
6198 | spin_lock_irqsave(&h->lock, flags); | 6201 | spin_lock_irqsave(&h->lock, flags); |
6199 | doorbell_value = readl(h->vaddr + SA5_DOORBELL); | 6202 | doorbell_value = readl(h->vaddr + SA5_DOORBELL); |
6200 | spin_unlock_irqrestore(&h->lock, flags); | 6203 | spin_unlock_irqrestore(&h->lock, flags); |
6201 | if (!(doorbell_value & DOORBELL_CLEAR_EVENTS)) | 6204 | if (!(doorbell_value & DOORBELL_CLEAR_EVENTS)) |
6202 | break; | 6205 | break; |
6203 | /* delay and try again */ | 6206 | /* delay and try again */ |
6204 | msleep(20); | 6207 | msleep(CLEAR_EVENT_WAIT_INTERVAL); |
6205 | } | 6208 | } |
6206 | } | 6209 | } |
6207 | 6210 | ||
@@ -6215,14 +6218,14 @@ static void hpsa_wait_for_mode_change_ack(struct ctlr_info *h) | |||
6215 | * (e.g.: hot replace a failed 144GB drive in a RAID 5 set right | 6218 | * (e.g.: hot replace a failed 144GB drive in a RAID 5 set right |
6216 | * as we enter this code.) | 6219 | * as we enter this code.) |
6217 | */ | 6220 | */ |
6218 | for (i = 0; i < MAX_CONFIG_WAIT; i++) { | 6221 | for (i = 0; i < MAX_MODE_CHANGE_WAIT; i++) { |
6219 | spin_lock_irqsave(&h->lock, flags); | 6222 | spin_lock_irqsave(&h->lock, flags); |
6220 | doorbell_value = readl(h->vaddr + SA5_DOORBELL); | 6223 | doorbell_value = readl(h->vaddr + SA5_DOORBELL); |
6221 | spin_unlock_irqrestore(&h->lock, flags); | 6224 | spin_unlock_irqrestore(&h->lock, flags); |
6222 | if (!(doorbell_value & CFGTBL_ChangeReq)) | 6225 | if (!(doorbell_value & CFGTBL_ChangeReq)) |
6223 | break; | 6226 | break; |
6224 | /* delay and try again */ | 6227 | /* delay and try again */ |
6225 | usleep_range(10000, 20000); | 6228 | msleep(MODE_CHANGE_WAIT_INTERVAL); |
6226 | } | 6229 | } |
6227 | } | 6230 | } |
6228 | 6231 | ||