diff options
author | Robert Baldyga <r.baldyga@samsung.com> | 2013-09-19 11:50:19 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-10-15 08:43:25 -0500 |
commit | afcf4169a41ef02d3f833f4eccac11038bd2b39c (patch) | |
tree | b05fd76c63478e06f3072dd074b792b594901bf2 /drivers/usb/gadget | |
parent | 5cb2ff0cdd60aef07c592a9d09349b5993fdf9b4 (diff) | |
download | linux-stable-afcf4169a41ef02d3f833f4eccac11038bd2b39c.tar.gz linux-stable-afcf4169a41ef02d3f833f4eccac11038bd2b39c.tar.bz2 linux-stable-afcf4169a41ef02d3f833f4eccac11038bd2b39c.zip |
usb: gadget: s3c-hsotg: fix endpoint interrupts handling
When s3c_hsotg_trytx is called for ep without enqueued request, interrupts
for this ep are disabled, to prevent interrupt flooding. Interrupts are
enabled when new request for this ep is starting.
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/s3c-hsotg.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index bb173852ae4c..30cead183d50 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c @@ -841,6 +841,9 @@ static void s3c_hsotg_start_req(struct s3c_hsotg *hsotg, dev_dbg(hsotg->dev, "%s: DxEPCTL=0x%08x\n", __func__, readl(hsotg->regs + epctrl_reg)); + + /* enable ep interrupts */ + s3c_hsotg_ctrl_epint(hsotg, hs_ep->index, hs_ep->dir_in, 1); } /** @@ -1814,8 +1817,16 @@ static int s3c_hsotg_trytx(struct s3c_hsotg *hsotg, { struct s3c_hsotg_req *hs_req = hs_ep->req; - if (!hs_ep->dir_in || !hs_req) + if (!hs_ep->dir_in || !hs_req) { + /** + * if request is not enqueued, we disable interrupts + * for endpoints, excepting ep0 + */ + if (hs_ep->index != 0) + s3c_hsotg_ctrl_epint(hsotg, hs_ep->index, + hs_ep->dir_in, 0); return 0; + } if (hs_req->req.actual < hs_req->req.length) { dev_dbg(hsotg->dev, "trying to write more for ep%d\n", |