Skip to content

Commit 0498cc2

Browse files
Stephen M. CameronJens Axboe
authored andcommitted
cciss: Inform controller we are using 32-bit tags.
Controller will DMA only 32-bits of the tag per command on completion if it knows we are only using 32-bit tags. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
1 parent 4a76504 commit 0498cc2

2 files changed

Lines changed: 16 additions & 10 deletions

File tree

‎drivers/block/cciss.c‎

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ static const struct block_device_operations cciss_fops = {
231231
*/
232232
static void set_performant_mode(ctlr_info_t *h, CommandList_struct *c)
233233
{
234-
if (likely(h->transMethod == CFGTBL_Trans_Performant))
234+
if (likely(h->transMethod & CFGTBL_Trans_Performant))
235235
c->busaddr |= 1 | (h->blockFetchTable[c->Header.SGList] << 1);
236236
}
237237

@@ -3175,10 +3175,13 @@ static inline u32 cciss_tag_to_index(u32 tag)
31753175
return tag >> DIRECT_LOOKUP_SHIFT;
31763176
}
31773177

3178-
static inline u32 cciss_tag_discard_error_bits(u32 tag)
3178+
static inline u32 cciss_tag_discard_error_bits(ctlr_info_t *h, u32 tag)
31793179
{
3180-
#define CCISS_ERROR_BITS 0x03
3181-
return tag & ~CCISS_ERROR_BITS;
3180+
#define CCISS_PERF_ERROR_BITS ((1 << DIRECT_LOOKUP_SHIFT) - 1)
3181+
#define CCISS_SIMPLE_ERROR_BITS 0x03
3182+
if (likely(h->transMethod & CFGTBL_Trans_Performant))
3183+
return tag & ~CCISS_PERF_ERROR_BITS;
3184+
return tag & ~CCISS_SIMPLE_ERROR_BITS;
31823185
}
31833186

31843187
static inline void cciss_mark_tag_indexed(u32 *tag)
@@ -3398,7 +3401,7 @@ static inline u32 next_command(ctlr_info_t *h)
33983401
{
33993402
u32 a;
34003403

3401-
if (unlikely(h->transMethod != CFGTBL_Trans_Performant))
3404+
if (unlikely(!(h->transMethod & CFGTBL_Trans_Performant)))
34023405
return h->access.command_completed(h);
34033406

34043407
if ((*(h->reply_pool_head) & 1) == (h->reply_pool_wraparound)) {
@@ -3436,9 +3439,9 @@ static inline u32 process_nonindexed_cmd(ctlr_info_t *h, u32 raw_tag)
34363439
CommandList_struct *c = NULL;
34373440
__u32 busaddr_masked, tag_masked;
34383441

3439-
tag_masked = cciss_tag_discard_error_bits(raw_tag);
3442+
tag_masked = cciss_tag_discard_error_bits(h, raw_tag);
34403443
list_for_each_entry(c, &h->cmpQ, list) {
3441-
busaddr_masked = cciss_tag_discard_error_bits(c->busaddr);
3444+
busaddr_masked = cciss_tag_discard_error_bits(h, c->busaddr);
34423445
if (busaddr_masked == tag_masked) {
34433446
finish_cmd(h, c, raw_tag);
34443447
return next_command(h);
@@ -3790,7 +3793,8 @@ static void __devinit cciss_wait_for_mode_change_ack(ctlr_info_t *h)
37903793
}
37913794
}
37923795

3793-
static __devinit void cciss_enter_performant_mode(ctlr_info_t *h)
3796+
static __devinit void cciss_enter_performant_mode(ctlr_info_t *h,
3797+
u32 use_short_tags)
37943798
{
37953799
/* This is a bit complicated. There are 8 registers on
37963800
* the controller which we write to to tell it 8 different
@@ -3845,7 +3849,7 @@ static __devinit void cciss_enter_performant_mode(ctlr_info_t *h)
38453849
writel(0, &h->transtable->RepQCtrAddrHigh32);
38463850
writel(h->reply_pool_dhandle, &h->transtable->RepQAddr0Low32);
38473851
writel(0, &h->transtable->RepQAddr0High32);
3848-
writel(CFGTBL_Trans_Performant,
3852+
writel(CFGTBL_Trans_Performant | use_short_tags,
38493853
&(h->cfgtable->HostWrite.TransportRequest));
38503854

38513855
writel(CFGTBL_ChangeReq, h->vaddr + SA5_DOORBELL);
@@ -3892,7 +3896,8 @@ static void __devinit cciss_put_controller_into_performant_mode(ctlr_info_t *h)
38923896
if ((h->reply_pool == NULL) || (h->blockFetchTable == NULL))
38933897
goto clean_up;
38943898

3895-
cciss_enter_performant_mode(h);
3899+
cciss_enter_performant_mode(h,
3900+
trans_support & CFGTBL_Trans_use_short_tags);
38963901

38973902
/* Change the access methods to the performant access methods */
38983903
h->access = SA5_performant_access;

‎drivers/block/cciss_cmd.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656

5757
#define CFGTBL_Trans_Simple 0x00000002l
5858
#define CFGTBL_Trans_Performant 0x00000004l
59+
#define CFGTBL_Trans_use_short_tags 0x20000000l
5960

6061
#define CFGTBL_BusType_Ultra2 0x00000001l
6162
#define CFGTBL_BusType_Ultra3 0x00000002l

0 commit comments

Comments
 (0)