提交 960a30e7 编写于 作者: S Stephen M. Cameron 提交者: James Bottomley

[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: NStephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
上级 745a7a25
...@@ -326,7 +326,7 @@ static ssize_t host_show_transport_mode(struct device *dev, ...@@ -326,7 +326,7 @@ static ssize_t host_show_transport_mode(struct device *dev,
h = shost_to_hba(shost); h = shost_to_hba(shost);
return snprintf(buf, 20, "%s\n", return snprintf(buf, 20, "%s\n",
h->transMethod == CFGTBL_Trans_Performant ? h->transMethod & CFGTBL_Trans_Performant ?
"performant" : "simple"); "performant" : "simple");
} }
...@@ -340,7 +340,7 @@ static inline u32 next_command(struct ctlr_info *h) ...@@ -340,7 +340,7 @@ static inline u32 next_command(struct ctlr_info *h)
{ {
u32 a; u32 a;
if (unlikely(h->transMethod != CFGTBL_Trans_Performant)) if (unlikely(!(h->transMethod & CFGTBL_Trans_Performant)))
return h->access.command_completed(h); return h->access.command_completed(h);
if ((*(h->reply_pool_head) & 1) == (h->reply_pool_wraparound)) { if ((*(h->reply_pool_head) & 1) == (h->reply_pool_wraparound)) {
...@@ -364,7 +364,7 @@ static inline u32 next_command(struct ctlr_info *h) ...@@ -364,7 +364,7 @@ static inline u32 next_command(struct ctlr_info *h)
*/ */
static void set_performant_mode(struct ctlr_info *h, struct CommandList *c) static void set_performant_mode(struct ctlr_info *h, struct CommandList *c)
{ {
if (likely(h->transMethod == CFGTBL_Trans_Performant)) if (likely(h->transMethod & CFGTBL_Trans_Performant))
c->busaddr |= 1 | (h->blockFetchTable[c->Header.SGList] << 1); c->busaddr |= 1 | (h->blockFetchTable[c->Header.SGList] << 1);
} }
...@@ -2924,7 +2924,7 @@ static inline u32 hpsa_tag_discard_error_bits(struct ctlr_info *h, u32 tag) ...@@ -2924,7 +2924,7 @@ static inline u32 hpsa_tag_discard_error_bits(struct ctlr_info *h, u32 tag)
{ {
#define HPSA_PERF_ERROR_BITS ((1 << DIRECT_LOOKUP_SHIFT) - 1) #define HPSA_PERF_ERROR_BITS ((1 << DIRECT_LOOKUP_SHIFT) - 1)
#define HPSA_SIMPLE_ERROR_BITS 0x03 #define HPSA_SIMPLE_ERROR_BITS 0x03
if (unlikely(h->transMethod != CFGTBL_Trans_Performant)) if (unlikely(!(h->transMethod & CFGTBL_Trans_Performant)))
return tag & ~HPSA_SIMPLE_ERROR_BITS; return tag & ~HPSA_SIMPLE_ERROR_BITS;
return tag & ~HPSA_PERF_ERROR_BITS; return tag & ~HPSA_PERF_ERROR_BITS;
} }
...@@ -3640,6 +3640,7 @@ static int __devinit hpsa_enter_simple_mode(struct ctlr_info *h) ...@@ -3640,6 +3640,7 @@ static int __devinit hpsa_enter_simple_mode(struct ctlr_info *h)
"unable to get board into simple mode\n"); "unable to get board into simple mode\n");
return -ENODEV; return -ENODEV;
} }
h->transMethod = CFGTBL_Trans_Simple;
return 0; return 0;
} }
...@@ -4025,7 +4026,8 @@ static void calc_bucket_map(int bucket[], int num_buckets, ...@@ -4025,7 +4026,8 @@ static void calc_bucket_map(int bucket[], int num_buckets,
} }
} }
static __devinit void hpsa_enter_performant_mode(struct ctlr_info *h) static __devinit void hpsa_enter_performant_mode(struct ctlr_info *h,
u32 use_short_tags)
{ {
int i; int i;
unsigned long register_value; unsigned long register_value;
...@@ -4073,7 +4075,7 @@ static __devinit void hpsa_enter_performant_mode(struct ctlr_info *h) ...@@ -4073,7 +4075,7 @@ static __devinit void hpsa_enter_performant_mode(struct ctlr_info *h)
writel(0, &h->transtable->RepQCtrAddrHigh32); writel(0, &h->transtable->RepQCtrAddrHigh32);
writel(h->reply_pool_dhandle, &h->transtable->RepQAddr0Low32); writel(h->reply_pool_dhandle, &h->transtable->RepQAddr0Low32);
writel(0, &h->transtable->RepQAddr0High32); writel(0, &h->transtable->RepQAddr0High32);
writel(CFGTBL_Trans_Performant, writel(CFGTBL_Trans_Performant | use_short_tags,
&(h->cfgtable->HostWrite.TransportRequest)); &(h->cfgtable->HostWrite.TransportRequest));
writel(CFGTBL_ChangeReq, h->vaddr + SA5_DOORBELL); writel(CFGTBL_ChangeReq, h->vaddr + SA5_DOORBELL);
hpsa_wait_for_mode_change_ack(h); hpsa_wait_for_mode_change_ack(h);
...@@ -4083,6 +4085,9 @@ static __devinit void hpsa_enter_performant_mode(struct ctlr_info *h) ...@@ -4083,6 +4085,9 @@ static __devinit void hpsa_enter_performant_mode(struct ctlr_info *h)
" performant mode\n"); " performant mode\n");
return; return;
} }
/* Change the access methods to the performant access methods */
h->access = SA5_performant_access;
h->transMethod = CFGTBL_Trans_Performant;
} }
static __devinit void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h) 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,11 +4116,8 @@ static __devinit void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h)
|| (h->blockFetchTable == NULL)) || (h->blockFetchTable == NULL))
goto clean_up; goto clean_up;
hpsa_enter_performant_mode(h); hpsa_enter_performant_mode(h,
trans_support & CFGTBL_Trans_use_short_tags);
/* Change the access methods to the performant access methods */
h->access = SA5_performant_access;
h->transMethod = CFGTBL_Trans_Performant;
return; return;
......
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
#define CFGTBL_Trans_Simple 0x00000002l #define CFGTBL_Trans_Simple 0x00000002l
#define CFGTBL_Trans_Performant 0x00000004l #define CFGTBL_Trans_Performant 0x00000004l
#define CFGTBL_Trans_use_short_tags 0x20000000l
#define CFGTBL_BusType_Ultra2 0x00000001l #define CFGTBL_BusType_Ultra2 0x00000001l
#define CFGTBL_BusType_Ultra3 0x00000002l #define CFGTBL_BusType_Ultra3 0x00000002l
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册