Skip to content

Commit 6599b6a

Browse files
matnymangregkh
authored andcommitted
xhci: Fix incorrect stream context type macro
The stream contex type (SCT) bitfield is used both in the stream context data structure, and in the 'Set TR Dequeue pointer' command TRB. In both cases it uses bits 3:1 The SCT_FOR_TRB(p) macro used to set the stream context type (SCT) field for the 'Set TR Dequeue pointer' command TRB incorrectly shifts the value 1 bit left before masking the three bits. Fix this by first masking and rshifting, just like the similar SCT_FOR_CTX(p) macro does This issue has not been visibile as the lost bit 3 is only used with secondary stream arrays (SSA). Xhci driver currently only supports using a primary stream array with Linear stream addressing. Fixes: 95241db ("xhci: Set SCT field for Set TR dequeue on streams") Cc: [email protected] Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5189df7 commit 6599b6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/host/xhci.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ enum xhci_setup_dev {
10011001
/* Set TR Dequeue Pointer command TRB fields, 6.4.3.9 */
10021002
#define TRB_TO_STREAM_ID(p) ((((p) & (0xffff << 16)) >> 16))
10031003
#define STREAM_ID_FOR_TRB(p) ((((p)) & 0xffff) << 16)
1004-
#define SCT_FOR_TRB(p) (((p) << 1) & 0x7)
1004+
#define SCT_FOR_TRB(p) (((p) & 0x7) << 1)
10051005

10061006
/* Link TRB specific fields */
10071007
#define TRB_TC (1<<1)

0 commit comments

Comments
 (0)