Skip to content

Fix for #4685 - #4755

Merged
pelwell merged 2 commits into
raspberrypi:rpi-5.10.yfrom
P33M:rpi-5.10.y
Dec 3, 2021
Merged

pelwell merged 2 commits into
raspberrypi:rpi-5.10.yfrom
P33M:rpi-5.10.y

Conversation

@P33M

@P33M P33M commented Dec 3, 2021

Copy link
Copy Markdown
Contributor

I don't have exactly the same hardware setup as the linked issue, but my equivalent testcase (Asix dongle with a modified interrupt endpoint interval) no longer fails with this patch applied.

While the failure was only seen when a bulk IN and interrupt IN endpoint were both active, there's no proof that the same thing can't occur with combinations of bulk IN and some other periodic endpoint type, so applying the segment restriction globally hedges against other random breakages.

P33M added 2 commits December 3, 2021 14:42
Don't calculate space based on the number of TRBs in the current segment,
as it's OK to wrap to the start (and flip the cycle state bit).

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
…lers

Certain transfer ring access patterns can cause the controller to hang
fetching TRBs for a USB2.0 endpoint.

- If two USB2.0 endpoints are active at once and
- Both endpoints are traversing a Link TRB where the following segment
  has a lower page address and
- One of the endpoints is a Bulk IN and
- The other endpoint is an Interrupt IN

Then the Interrupt IN endpoint can end up not getting polled.
It is unclear what the precise failure mode is, as the controller seems to
haphazardly and repeatedly fetch TRBs for both endpoints but does not
advance the Interrupt endpoint transfer.

As a workaround, add a quirk that initially constrains all USB2.0 transfer
rings to a single segment in size. If for any reason a device driver queues
up enough outstanding transfers to fill the ring segment, then the ring
will be expanded. This has not been seen to occur with UMS or UVC drivers,
which aggressively queue buffers.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
@pelwell
pelwell merged commit a1d0f80 into raspberrypi:rpi-5.10.y Dec 3, 2021
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Dec 3, 2021
See: raspberrypi/linux#4755

kernel: DPI panel configuration
See: raspberrypi/linux#4753

kernel: KMS 7" DSI panel and touchscreen fixes
See: raspberrypi/linux#4750

kernel: drm/vc4: Hold pm_runtime for vc4
See: raspberrypi/linux#4706
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Dec 3, 2021
See: raspberrypi/linux#4755

kernel: DPI panel configuration
See: raspberrypi/linux#4753

kernel: KMS 7" DSI panel and touchscreen fixes
See: raspberrypi/linux#4750

kernel: drm/vc4: Hold pm_runtime for vc4
See: raspberrypi/linux#4706
@P33M

P33M commented Dec 7, 2021

Copy link
Copy Markdown
Contributor Author

#4685

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.

2 participants