Skip to content
Snippets Groups Projects
Commit b272c879 authored by Simon Holesch's avatar Simon Holesch Committed by Mattijs Korpershoek
Browse files

usb: ci: Fix gadget reinit


The ChipIdea device controller wasn't properly cleaned up when disabled.
So enabling it again left it in a broken state. The problem occurred for
example when the host unbinds the driver and binds it again.

During the first setup, when the out request is queued, the endpoint is
primed (`epprime`). If the endpoint is then disabled, it stayed primed
with the initial buffer. So after the endpoint is re-enabled, the device
controller and device driver were out of sync: the new out request was
in the driver queue head, yet not submitted, but the "complete" function
was still called, since the endpoint was primed with the old buffer.

With the fastboot function this error led to the (rather confusing)
error message "buffer overflow".

Fixed by clearing the primed buffers with the `epflush` (`ENDPTFLUSH`)
register.

Signed-off-by: default avatarSimon Holesch <simon@holesch.de>
Reviewed-by: default avatarMarek Vasut <marex@denx.de>
Reviewed-by: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20231120002024.32865-1-simon@holesch.de


Signed-off-by: default avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
parent 24ca49b3
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment