1480c1480,1486
< // Prioritize same rank accesses that can issue B2B
---
> // if we have multiple ranks and all
> // waiting packets are accessing a rank which was previously active
> // then bank_mask_same_rank will be set to a value while bank_mask will
> // remain 0. In this case, the function should return the value of
> // bank_mask_same_rank.
> // else if waiting packets access a rank which was previously active and
> // other ranks, prioritize same rank accesses that can issue B2B
1488,1489c1494,1495
< if (!switched_cmd_type && same_rank_match &&
< min_act_at_same_rank <= min_cmd_at) {
---
> if ((bank_mask == 0) || (!switched_cmd_type && same_rank_match &&
> min_act_at_same_rank <= min_cmd_at)) {