diff options
author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2010-07-19 14:46:01 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-08-07 12:52:11 -0400 |
commit | 0f8a6a1e7b7162a51daee7df28f1b898da1a4165 (patch) | |
tree | dccfec7d8d744e17d1d9a21e7be63c75de33e7a1 | |
parent | fe3b7527dbf1e717ccb3492bb2d84481ca7be6f9 (diff) |
cciss: factor out cciss_wait_for_mode_change_ack()
cciss: factor out cciss_wait_for_mode_change_ack()
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
-rw-r--r-- | drivers/block/cciss.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 37bc091041a0..ee7cfde8a145 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -3816,9 +3816,22 @@ static void calc_bucket_map(int bucket[], int num_buckets, | |||
3816 | } | 3816 | } |
3817 | } | 3817 | } |
3818 | 3818 | ||
3819 | static void __devinit cciss_wait_for_mode_change_ack(ctlr_info_t *h) | ||
3820 | { | ||
3821 | int i; | ||
3822 | |||
3823 | /* under certain very rare conditions, this can take awhile. | ||
3824 | * (e.g.: hot replace a failed 144GB drive in a RAID 5 set right | ||
3825 | * as we enter this code.) */ | ||
3826 | for (i = 0; i < MAX_CONFIG_WAIT; i++) { | ||
3827 | if (!(readl(h->vaddr + SA5_DOORBELL) & CFGTBL_ChangeReq)) | ||
3828 | break; | ||
3829 | msleep(10); | ||
3830 | } | ||
3831 | } | ||
3832 | |||
3819 | static void __devinit cciss_put_controller_into_performant_mode(ctlr_info_t *h) | 3833 | static void __devinit cciss_put_controller_into_performant_mode(ctlr_info_t *h) |
3820 | { | 3834 | { |
3821 | int l = 0; | ||
3822 | __u32 trans_support; | 3835 | __u32 trans_support; |
3823 | __u32 trans_offset; | 3836 | __u32 trans_offset; |
3824 | /* | 3837 | /* |
@@ -3895,17 +3908,7 @@ static void __devinit cciss_put_controller_into_performant_mode(ctlr_info_t *h) | |||
3895 | 3908 | ||
3896 | h->transMethod = CFGTBL_Trans_Performant; | 3909 | h->transMethod = CFGTBL_Trans_Performant; |
3897 | writel(CFGTBL_ChangeReq, h->vaddr + SA5_DOORBELL); | 3910 | writel(CFGTBL_ChangeReq, h->vaddr + SA5_DOORBELL); |
3898 | /* under certain very rare conditions, this can take awhile. | 3911 | cciss_wait_for_mode_change_ack(h); |
3899 | * (e.g.: hot replace a failed 144GB drive in a RAID 5 set right | ||
3900 | * as we enter this code.) */ | ||
3901 | for (l = 0; l < MAX_CONFIG_WAIT; l++) { | ||
3902 | register_value = readl(h->vaddr + SA5_DOORBELL); | ||
3903 | if (!(register_value & CFGTBL_ChangeReq)) | ||
3904 | break; | ||
3905 | /* delay and try again */ | ||
3906 | set_current_state(TASK_INTERRUPTIBLE); | ||
3907 | schedule_timeout(10); | ||
3908 | } | ||
3909 | register_value = readl(&(h->cfgtable->TransportActive)); | 3912 | register_value = readl(&(h->cfgtable->TransportActive)); |
3910 | if (!(register_value & CFGTBL_Trans_Performant)) { | 3913 | if (!(register_value & CFGTBL_Trans_Performant)) { |
3911 | printk(KERN_WARNING "cciss: unable to get board into" | 3914 | printk(KERN_WARNING "cciss: unable to get board into" |