Commit 93f599f2 authored by Robert Baldyga's avatar Robert Baldyga Committed by Felipe Balbi

usb: gadget: s3c-hsotg: fix spinlock locking

This patch adds missing spinlock locking in s3c_hsotg_complete_setup function,
and unlocking for gadget setup call.
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 af9f51c5
...@@ -1245,7 +1245,9 @@ static void s3c_hsotg_process_control(struct s3c_hsotg *hsotg, ...@@ -1245,7 +1245,9 @@ static void s3c_hsotg_process_control(struct s3c_hsotg *hsotg,
/* as a fallback, try delivering it to the driver to deal with */ /* as a fallback, try delivering it to the driver to deal with */
if (ret == 0 && hsotg->driver) { if (ret == 0 && hsotg->driver) {
spin_unlock(&hsotg->lock);
ret = hsotg->driver->setup(&hsotg->gadget, ctrl); ret = hsotg->driver->setup(&hsotg->gadget, ctrl);
spin_lock(&hsotg->lock);
if (ret < 0) if (ret < 0)
dev_dbg(hsotg->dev, "driver->setup() ret %d\n", ret); dev_dbg(hsotg->dev, "driver->setup() ret %d\n", ret);
} }
...@@ -1308,10 +1310,12 @@ static void s3c_hsotg_complete_setup(struct usb_ep *ep, ...@@ -1308,10 +1310,12 @@ static void s3c_hsotg_complete_setup(struct usb_ep *ep,
return; return;
} }
spin_lock(&hsotg->lock);
if (req->actual == 0) if (req->actual == 0)
s3c_hsotg_enqueue_setup(hsotg); s3c_hsotg_enqueue_setup(hsotg);
else else
s3c_hsotg_process_control(hsotg, req->buf); s3c_hsotg_process_control(hsotg, req->buf);
spin_unlock(&hsotg->lock);
} }
/** /**
......
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