Skip to content
Commit ff176a4e authored by Richard Röjfors's avatar Richard Röjfors Committed by Greg Kroah-Hartman
Browse files

usb: pch_udc: Fix setup transfers with data out



This patch fixes an issue where the driver does not handle out data in
setup transactions.

The per endpoint cached status register is cleared in the
pch_udc_svc_control_out function. When there is out data available the
function pch_udc_svc_data_out is called which tries to pick it up the
status, which now is cleared to 0. When the status is 0, the function
doesn't start reading the data from the FIFO.

There is a second bug in all this, pch_udc_svc_data_out takes the
endpoint number (0 for EP0), while pch_udc_svc_control_out passes the
endpoint index (1 for EP0). Effectively pch_udc_svc_data_out picks up
the wrong internal ep structure.

This patch makes sure to put back the cached status and pass the
endpoint number rather than index when calling pch_udc_svc_data_out.

Signed-off-by: default avatarRichard Röjfors <richard.rojfors@pelagicore.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 49e20834
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment