@@ -231,7 +231,7 @@ static const struct block_device_operations cciss_fops = {
231231 */
232232static 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
31843187static 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 ;
0 commit comments