From 5cb2ff0cdd60aef07c592a9d09349b5993fdf9b4 Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Thu, 19 Sep 2013 11:50:18 +0200 Subject: [PATCH] usb: gadget: s3c-hsotg: fix s3c_hsotg_write_fifo function for dedicated fifo mode In s3c_hsotg_write_fifo function PTxFEmp/NPTxFEmp interrupts are enabled only in shared-fifo mode. In dedicated-fifo mode they should not be used (when enabled then cause interrupt storm). Signed-off-by: Robert Baldyga Signed-off-by: Kyungmin Park Signed-off-by: Felipe Balbi --- drivers/usb/gadget/s3c-hsotg.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 4faf5e7..bb17385 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c @@ -563,9 +563,11 @@ static int s3c_hsotg_write_fifo(struct s3c_hsotg *hsotg, if (to_write > max_transfer) { to_write = max_transfer; - s3c_hsotg_en_gsint(hsotg, - periodic ? GINTSTS_PTxFEmp : - GINTSTS_NPTxFEmp); + /* it's needed only when we do not use dedicated fifos */ + if (!hsotg->dedicated_fifos) + s3c_hsotg_en_gsint(hsotg, + periodic ? GINTSTS_PTxFEmp : + GINTSTS_NPTxFEmp); } /* see if we can write data */ @@ -590,9 +592,11 @@ static int s3c_hsotg_write_fifo(struct s3c_hsotg *hsotg, * is more room left. */ - s3c_hsotg_en_gsint(hsotg, - periodic ? GINTSTS_PTxFEmp : - GINTSTS_NPTxFEmp); + /* it's needed only when we do not use dedicated fifos */ + if (!hsotg->dedicated_fifos) + s3c_hsotg_en_gsint(hsotg, + periodic ? GINTSTS_PTxFEmp : + GINTSTS_NPTxFEmp); } dev_dbg(hsotg->dev, "write %d/%d, can_write %d, done %d\n", -- 2.7.4