Skip to content

xhci: Use more event ring segment table entries #3147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2019

Conversation

P33M
Copy link
Contributor

@P33M P33M commented Aug 13, 2019

Users have reported log spam created by "Event Ring Full" xHC event
TRBs. These are caused by interrupt latency in conjunction with a very
busy set of devices on the bus. The errors are benign, but throughput
will suffer as the xHC will pause processing of transfers until the
event ring is drained by the kernel. Expand the number of event TRB slots
available by increasing the number of event ring segments in the ERST.

Controllers have a hardware-defined limit as to the number of ERST
entries they can process, so make the actual number in use
min(ERST_MAX_SEGS, hw_max).

Signed-off-by: Jonathan Bell [email protected]

val |= ERST_NUM_SEGS;
val2 = readl(&xhci->ir_set->erst_size);
val2 &= ERST_SIZE_MASK;
val2 |= val;
xhci_dbg_trace(xhci, trace_xhci_dbg_init,
"// Write ERST size = %i to ir_set 0 (some bits preserved)",
val);
Copy link
Contributor

@pelwell pelwell Aug 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The swapping of val and val2 (just to use them in order?) is a bit gratuitous, and it breaks/non-obviously-fixes this debug output.

Copy link
Contributor Author

@P33M P33M Aug 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits 31:16 are RsvdP (reserved, preserve anyway) but this now truncates the register if any of the reserved bits are used. Debug should use val2 - will fix

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And swap val and val2? Plz?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

k

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx

@P33M P33M force-pushed the xhci-event-rings branch from 480d87b to d8693fc Compare August 13, 2019 15:42
Users have reported log spam created by "Event Ring Full" xHC event
TRBs. These are caused by interrupt latency in conjunction with a very
busy set of devices on the bus. The errors are benign, but throughput
will suffer as the xHC will pause processing of transfers until the
event ring is drained by the kernel. Expand the number of event TRB slots
available by increasing the number of event ring segments in the ERST.

Controllers have a hardware-defined limit as to the number of ERST
entries they can process, so make the actual number in use
min(ERST_MAX_SEGS, hw_max).

Signed-off-by: Jonathan Bell <[email protected]>
@P33M P33M force-pushed the xhci-event-rings branch from d8693fc to c9be4ee Compare August 13, 2019 15:49
@pelwell pelwell merged commit 5f945aa into raspberrypi:rpi-4.19.y Aug 13, 2019
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Aug 16, 2019
kernel: configs: Enable building the DS28E17 driver module
See: raspberrypi/linux#3141

kernel: ARM: dts: bcm2711-rpi-4-b: I2C aliases and pulls
See: https://www.raspberrypi.org/forums/posting.php?mode=reply&f=107&t=248439

kernel: xhci: Use more event ring segment table entries
See: raspberrypi/linux#3147

kernel: dwc_otg: use align_buf for small IN control transfers
See: raspberrypi/linux#3150
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Aug 16, 2019
kernel: configs: Enable building the DS28E17 driver module
See: raspberrypi/linux#3141

kernel: ARM: dts: bcm2711-rpi-4-b: I2C aliases and pulls
See: https://www.raspberrypi.org/forums/posting.php?mode=reply&f=107&t=248439

kernel: xhci: Use more event ring segment table entries
See: raspberrypi/linux#3147

kernel: dwc_otg: use align_buf for small IN control transfers
See: raspberrypi/linux#3150
@l1k
Copy link
Contributor

l1k commented Sep 12, 2023

Just a heads-up: I've upstreamed this commit, it is now queued for v6.7-rc1 and can hence be omitted when you update your tree to that kernel version.

https://git.kernel.org/mnyman/xhci/c/26a23e0dd061

Thanks!

@popcornmix
Copy link
Collaborator

@l1k that's good to hear. I'll drop this commit when the upstream version appears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants