Commit 0f8a6a1e authored by Stephen M. Cameron's avatar Stephen M. Cameron Committed by Jens Axboe

cciss: factor out cciss_wait_for_mode_change_ack()

cciss: factor out cciss_wait_for_mode_change_ack()
Signed-off-by: default avatarStephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
parent fe3b7527
...@@ -3816,9 +3816,22 @@ static void calc_bucket_map(int bucket[], int num_buckets, ...@@ -3816,9 +3816,22 @@ static void calc_bucket_map(int bucket[], int num_buckets,
} }
} }
static void __devinit cciss_wait_for_mode_change_ack(ctlr_info_t *h)
{
int i;
/* under certain very rare conditions, this can take awhile.
* (e.g.: hot replace a failed 144GB drive in a RAID 5 set right
* as we enter this code.) */
for (i = 0; i < MAX_CONFIG_WAIT; i++) {
if (!(readl(h->vaddr + SA5_DOORBELL) & CFGTBL_ChangeReq))
break;
msleep(10);
}
}
static void __devinit cciss_put_controller_into_performant_mode(ctlr_info_t *h) static void __devinit cciss_put_controller_into_performant_mode(ctlr_info_t *h)
{ {
int l = 0;
__u32 trans_support; __u32 trans_support;
__u32 trans_offset; __u32 trans_offset;
/* /*
...@@ -3895,17 +3908,7 @@ static void __devinit cciss_put_controller_into_performant_mode(ctlr_info_t *h) ...@@ -3895,17 +3908,7 @@ static void __devinit cciss_put_controller_into_performant_mode(ctlr_info_t *h)
h->transMethod = CFGTBL_Trans_Performant; h->transMethod = CFGTBL_Trans_Performant;
writel(CFGTBL_ChangeReq, h->vaddr + SA5_DOORBELL); writel(CFGTBL_ChangeReq, h->vaddr + SA5_DOORBELL);
/* under certain very rare conditions, this can take awhile. cciss_wait_for_mode_change_ack(h);
* (e.g.: hot replace a failed 144GB drive in a RAID 5 set right
* as we enter this code.) */
for (l = 0; l < MAX_CONFIG_WAIT; l++) {
register_value = readl(h->vaddr + SA5_DOORBELL);
if (!(register_value & CFGTBL_ChangeReq))
break;
/* delay and try again */
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(10);
}
register_value = readl(&(h->cfgtable->TransportActive)); register_value = readl(&(h->cfgtable->TransportActive));
if (!(register_value & CFGTBL_Trans_Performant)) { if (!(register_value & CFGTBL_Trans_Performant)) {
printk(KERN_WARNING "cciss: unable to get board into" printk(KERN_WARNING "cciss: unable to get board into"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment