Return-Path: Received: from mail-bn1bn0109.outbound.protection.outlook.com ([157.56.110.109]:12288 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753848AbbJWByV (ORCPT ); Thu, 22 Oct 2015 21:54:21 -0400 From: Peter Chen To: CC: , Li Jun , , Peter Chen Subject: [PATCH 4/5] usb: chipidea: debug: disable usb irq while role switch Date: Fri, 23 Oct 2015 09:52:53 +0800 Message-ID: <1445565174-14179-5-git-send-email-peter.chen@freescale.com> In-Reply-To: <1445565174-14179-1-git-send-email-peter.chen@freescale.com> References: <1445565174-14179-1-git-send-email-peter.chen@freescale.com> MIME-Version: 1.0 Content-Type: text/plain Sender: stable-owner@vger.kernel.org List-ID: From: Li Jun Since the ci->role will be set after the host role start is complete, there will be nobody cared irq during start host if usb irq enabled. This error can be reproduced on i.mx6 sololite EVK board by: 1. disable otg id irq(IDIE) and disable all real otg properties of usbotg1 in dts. 2. boot up the board with ID cable and usb device connected. 3. echo gadget > /sys/kernel/debug/ci_hdrc.0/role 4. echo host > /sys/kernel/debug/ci_hdrc.0/role 5. irq 212: nobody cared. Cc: # v3.10+ Signed-off-by: Li Jun Signed-off-by: Peter Chen --- drivers/usb/chipidea/debug.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c index 080b7be..58c8485 100644 --- a/drivers/usb/chipidea/debug.c +++ b/drivers/usb/chipidea/debug.c @@ -322,8 +322,10 @@ static ssize_t ci_role_write(struct file *file, const char __user *ubuf, return -EINVAL; pm_runtime_get_sync(ci->dev); + disable_irq(ci->irq); ci_role_stop(ci); ret = ci_role_start(ci, role); + enable_irq(ci->irq); pm_runtime_put_sync(ci->dev); return ret ? ret : count; -- 1.9.1