Skip to content

v2 fix for the VLI TRB cache bug#4768

Merged
pelwell merged 3 commits intoraspberrypi:rpi-5.10.yfrom
P33M:vli_fix_2
Dec 14, 2021
Merged

v2 fix for the VLI TRB cache bug#4768
pelwell merged 3 commits intoraspberrypi:rpi-5.10.yfrom
P33M:vli_fix_2

Conversation

@P33M
Copy link
Copy Markdown
Contributor

@P33M P33M commented Dec 14, 2021

#4685

Soak tested overnight and seems OK. This is probably a bit unwieldy to keep as a downstream patch for long, though it did apply with a few fixups to 5.15.

P33M added 3 commits December 13, 2021 16:30
In anticipation of adjusting the number of utilised TRBs in a ring
segment, add trbs_per_seg to struct xhci_ring and use this instead
of a compile-time define.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
The VL805 fetches up to 4 transfer TRBs at a time. TRB reads don't cross
a 64B boundary, and if a TRB is fetched and is not on a 64B boundary,
the read is sized up to the next 64B boundary.

However the VL805 implements a readahead prefetch for TRBs on a transfer
ring. This fetches the next 64B after any TRB read has happened. Near
the end of a ring segment, the prefetcher can read the first 64B of the
next page in physical memory and this is where the behaviour causes a
bug.

The controller does not tag reads with which endpoint they are for, so
if the start of the next page is a ring segment used by a victim
endpoint, and the victim endpoint is about to fetch TRBs from the start
of the segment, the victim endpoint will read from the prefetched data
and not perform a read to main memory. If the data is stale, the ring
cycle state bit may not be correct and the endpoint will silently halt.

Adjust trbs_per_seg for transfer rings allocated for this controller.

See raspberrypi#4685

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
@popcornmix
Copy link
Copy Markdown
Collaborator

Can it alsa be sent upstream?
A PR for 5.15 too would be useful if it requires fixups.

@pelwell pelwell merged commit 20f6415 into raspberrypi:rpi-5.10.y Dec 14, 2021
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Dec 17, 2021
kernel: ASoC:ma120x0p: Increase maximum sample rate to 192KHz
See: ASoC:ma120x0p: Increase maximum sample rate to 192KHz

kernel: Add cam0 parameter to image sensor overlays
See: Add cam0 parameter to image sensor overlays

kernel: drm/vc4: Fix build without DRM_VC4_HDMI_CEC
See: raspberrypi/linux#4771

kernel: v2 fix for the VLI TRB cache bug
See: raspberrypi/linux#4768

kernel: ARM: dts: Create bcm2711-rpi-cm4s.dts
See: raspberrypi/linux#4761

kernel: vc4/drm: Ignore vc4_hdmi->output_enabled for allowing audio
See: raspberrypi/linux#4759

kernel: media: imx219: Advertise embedded data node on media pad 1
See: raspberrypi/linux#4758
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Dec 17, 2021
kernel: ASoC:ma120x0p: Increase maximum sample rate to 192KHz
See: ASoC:ma120x0p: Increase maximum sample rate to 192KHz

kernel: Add cam0 parameter to image sensor overlays
See: Add cam0 parameter to image sensor overlays

kernel: drm/vc4: Fix build without DRM_VC4_HDMI_CEC
See: raspberrypi/linux#4771

kernel: v2 fix for the VLI TRB cache bug
See: raspberrypi/linux#4768

kernel: ARM: dts: Create bcm2711-rpi-cm4s.dts
See: raspberrypi/linux#4761

kernel: vc4/drm: Ignore vc4_hdmi->output_enabled for allowing audio
See: raspberrypi/linux#4759

kernel: media: imx219: Advertise embedded data node on media pad 1
See: raspberrypi/linux#4758
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.

3 participants