Commit bd9ef7bf authored by Robert Baldyga's avatar Robert Baldyga Committed by Felipe Balbi

usb: gadget: s3c-hsotg: fix clear feature ENDPOINT_HALT

All requests for endpoint are completed when it was halted and the halt was
cleared by CLEAR_FEATURE, but not when new state is same as previous.
Signed-off-by: default avatarRobert Baldyga <r.baldyga@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent a18ed7b0
...@@ -1115,6 +1115,7 @@ static int s3c_hsotg_process_req_feature(struct s3c_hsotg *hsotg, ...@@ -1115,6 +1115,7 @@ static int s3c_hsotg_process_req_feature(struct s3c_hsotg *hsotg,
bool set = (ctrl->bRequest == USB_REQ_SET_FEATURE); bool set = (ctrl->bRequest == USB_REQ_SET_FEATURE);
struct s3c_hsotg_ep *ep; struct s3c_hsotg_ep *ep;
int ret; int ret;
bool halted;
dev_dbg(hsotg->dev, "%s: %s_FEATURE\n", dev_dbg(hsotg->dev, "%s: %s_FEATURE\n",
__func__, set ? "SET" : "CLEAR"); __func__, set ? "SET" : "CLEAR");
...@@ -1129,6 +1130,8 @@ static int s3c_hsotg_process_req_feature(struct s3c_hsotg *hsotg, ...@@ -1129,6 +1130,8 @@ static int s3c_hsotg_process_req_feature(struct s3c_hsotg *hsotg,
switch (le16_to_cpu(ctrl->wValue)) { switch (le16_to_cpu(ctrl->wValue)) {
case USB_ENDPOINT_HALT: case USB_ENDPOINT_HALT:
halted = ep->halted;
s3c_hsotg_ep_sethalt(&ep->ep, set); s3c_hsotg_ep_sethalt(&ep->ep, set);
ret = s3c_hsotg_send_reply(hsotg, ep0, NULL, 0); ret = s3c_hsotg_send_reply(hsotg, ep0, NULL, 0);
...@@ -1138,7 +1141,12 @@ static int s3c_hsotg_process_req_feature(struct s3c_hsotg *hsotg, ...@@ -1138,7 +1141,12 @@ static int s3c_hsotg_process_req_feature(struct s3c_hsotg *hsotg,
return ret; return ret;
} }
if (!set) { /*
* we have to complete all requests for ep if it was
* halted, and the halt was cleared by CLEAR_FEATURE
*/
if (!set && halted) {
/* /*
* If we have request in progress, * If we have request in progress,
* then complete it * then complete it
......
Markdown is supported
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