diff options
author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2011-02-15 16:33:03 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-02-18 13:33:52 -0500 |
commit | 960a30e7a73affcc441b9ceaff3b1b9e73e99c1f (patch) | |
tree | 8c584d8d7bd0e9c38be58f6e34dec094d105094b /drivers/scsi/hpsa.c | |
parent | 745a7a25bc0f6dc77db72656b7bc8d17b6ee8e53 (diff) |
[SCSI] hpsa: Inform controller we are using 32-bit tags.
Controller will transfer only 32-bits on completion if it
knows we are only using 32-bit tags. Also, some newer controllers
apparently (and erroneously) require that we only use 32-bit tags,
and that we inform the controller of this.
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 | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 563d439c2f46..a778cb1fd8bc 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -326,7 +326,7 @@ static ssize_t host_show_transport_mode(struct device *dev, | |||
326 | 326 | ||
327 | h = shost_to_hba(shost); | 327 | h = shost_to_hba(shost); |
328 | return snprintf(buf, 20, "%s\n", | 328 | return snprintf(buf, 20, "%s\n", |
329 | h->transMethod == CFGTBL_Trans_Performant ? | 329 | h->transMethod & CFGTBL_Trans_Performant ? |
330 | "performant" : "simple"); | 330 | "performant" : "simple"); |
331 | } | 331 | } |
332 | 332 | ||
@@ -340,7 +340,7 @@ static inline u32 next_command(struct ctlr_info *h) | |||
340 | { | 340 | { |
341 | u32 a; | 341 | u32 a; |
342 | 342 | ||
343 | if (unlikely(h->transMethod != CFGTBL_Trans_Performant)) | 343 | if (unlikely(!(h->transMethod & CFGTBL_Trans_Performant))) |
344 | return h->access.command_completed(h); | 344 | return h->access.command_completed(h); |
345 | 345 | ||
346 | if ((*(h->reply_pool_head) & 1) == (h->reply_pool_wraparound)) { | 346 | if ((*(h->reply_pool_head) & 1) == (h->reply_pool_wraparound)) { |
@@ -364,7 +364,7 @@ static inline u32 next_command(struct ctlr_info *h) | |||
364 | */ | 364 | */ |
365 | static void set_performant_mode(struct ctlr_info *h, struct CommandList *c) | 365 | static void set_performant_mode(struct ctlr_info *h, struct CommandList *c) |
366 | { | 366 | { |
367 | if (likely(h->transMethod == CFGTBL_Trans_Performant)) | 367 | if (likely(h->transMethod & CFGTBL_Trans_Performant)) |
368 | c->busaddr |= 1 | (h->blockFetchTable[c->Header.SGList] << 1); | 368 | c->busaddr |= 1 | (h->blockFetchTable[c->Header.SGList] << 1); |
369 | } | 369 | } |
370 | 370 | ||
@@ -2924,7 +2924,7 @@ static inline u32 hpsa_tag_discard_error_bits(struct ctlr_info *h, u32 tag) | |||
2924 | { | 2924 | { |
2925 | #define HPSA_PERF_ERROR_BITS ((1 << DIRECT_LOOKUP_SHIFT) - 1) | 2925 | #define HPSA_PERF_ERROR_BITS ((1 << DIRECT_LOOKUP_SHIFT) - 1) |
2926 | #define HPSA_SIMPLE_ERROR_BITS 0x03 | 2926 | #define HPSA_SIMPLE_ERROR_BITS 0x03 |
2927 | if (unlikely(h->transMethod != CFGTBL_Trans_Performant)) | 2927 | if (unlikely(!(h->transMethod & CFGTBL_Trans_Performant))) |
2928 | return tag & ~HPSA_SIMPLE_ERROR_BITS; | 2928 | return tag & ~HPSA_SIMPLE_ERROR_BITS; |
2929 | return tag & ~HPSA_PERF_ERROR_BITS; | 2929 | return tag & ~HPSA_PERF_ERROR_BITS; |
2930 | } | 2930 | } |
@@ -3640,6 +3640,7 @@ static int __devinit hpsa_enter_simple_mode(struct ctlr_info *h) | |||
3640 | "unable to get board into simple mode\n"); | 3640 | "unable to get board into simple mode\n"); |
3641 | return -ENODEV; | 3641 | return -ENODEV; |
3642 | } | 3642 | } |
3643 | h->transMethod = CFGTBL_Trans_Simple; | ||
3643 | return 0; | 3644 | return 0; |
3644 | } | 3645 | } |
3645 | 3646 | ||
@@ -4025,7 +4026,8 @@ static void calc_bucket_map(int bucket[], int num_buckets, | |||
4025 | } | 4026 | } |
4026 | } | 4027 | } |
4027 | 4028 | ||
4028 | static __devinit void hpsa_enter_performant_mode(struct ctlr_info *h) | 4029 | static __devinit void hpsa_enter_performant_mode(struct ctlr_info *h, |
4030 | u32 use_short_tags) | ||
4029 | { | 4031 | { |
4030 | int i; | 4032 | int i; |
4031 | unsigned long register_value; | 4033 | unsigned long register_value; |
@@ -4073,7 +4075,7 @@ static __devinit void hpsa_enter_performant_mode(struct ctlr_info *h) | |||
4073 | writel(0, &h->transtable->RepQCtrAddrHigh32); | 4075 | writel(0, &h->transtable->RepQCtrAddrHigh32); |
4074 | writel(h->reply_pool_dhandle, &h->transtable->RepQAddr0Low32); | 4076 | writel(h->reply_pool_dhandle, &h->transtable->RepQAddr0Low32); |
4075 | writel(0, &h->transtable->RepQAddr0High32); | 4077 | writel(0, &h->transtable->RepQAddr0High32); |
4076 | writel(CFGTBL_Trans_Performant, | 4078 | writel(CFGTBL_Trans_Performant | use_short_tags, |
4077 | &(h->cfgtable->HostWrite.TransportRequest)); | 4079 | &(h->cfgtable->HostWrite.TransportRequest)); |
4078 | writel(CFGTBL_ChangeReq, h->vaddr + SA5_DOORBELL); | 4080 | writel(CFGTBL_ChangeReq, h->vaddr + SA5_DOORBELL); |
4079 | hpsa_wait_for_mode_change_ack(h); | 4081 | hpsa_wait_for_mode_change_ack(h); |
@@ -4083,6 +4085,9 @@ static __devinit void hpsa_enter_performant_mode(struct ctlr_info *h) | |||
4083 | " performant mode\n"); | 4085 | " performant mode\n"); |
4084 | return; | 4086 | return; |
4085 | } | 4087 | } |
4088 | /* Change the access methods to the performant access methods */ | ||
4089 | h->access = SA5_performant_access; | ||
4090 | h->transMethod = CFGTBL_Trans_Performant; | ||
4086 | } | 4091 | } |
4087 | 4092 | ||
4088 | static __devinit void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h) | 4093 | static __devinit void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h) |
@@ -4111,11 +4116,8 @@ static __devinit void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h) | |||
4111 | || (h->blockFetchTable == NULL)) | 4116 | || (h->blockFetchTable == NULL)) |
4112 | goto clean_up; | 4117 | goto clean_up; |
4113 | 4118 | ||
4114 | hpsa_enter_performant_mode(h); | 4119 | hpsa_enter_performant_mode(h, |
4115 | 4120 | trans_support & CFGTBL_Trans_use_short_tags); | |
4116 | /* Change the access methods to the performant access methods */ | ||
4117 | h->access = SA5_performant_access; | ||
4118 | h->transMethod = CFGTBL_Trans_Performant; | ||
4119 | 4121 | ||
4120 | return; | 4122 | return; |
4121 | 4123 | ||