From patchwork Wed Feb 4 00:01:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kim kyuwon X-Patchwork-Id: 5312 X-Patchwork-Delegate: me@felipebalbi.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n1401ld6016025 for ; Wed, 4 Feb 2009 00:01:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751277AbZBDABp (ORCPT ); Tue, 3 Feb 2009 19:01:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751598AbZBDABp (ORCPT ); Tue, 3 Feb 2009 19:01:45 -0500 Received: from wf-out-1314.google.com ([209.85.200.172]:1968 "EHLO wf-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751046AbZBDABo (ORCPT ); Tue, 3 Feb 2009 19:01:44 -0500 Received: by wf-out-1314.google.com with SMTP id 27so2521934wfd.4 for ; Tue, 03 Feb 2009 16:01:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=j6q+6DHAM0WoX6Udyzo6k0eh+sRkdGvmmury9WJJflQ=; b=x+F80mDLDG9f8INxicuLCf2lCS8sTN2rkB8jYONlgIxPUobrKTh+8biywR232/7VDl v2Hp1mRtH0OPO+dwz3S+4fMKrfLPcs3hc3CS/cu4qf84BdgK2Km0MnTIDsZb7hwISGfy 6MdmWSLigVe9VFhwypoZQyU0BLyawFYXO1ohU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Ksr4N9wDo86T0Vw0QjSc4bDVYhgTQYlT99Gawn/+KLIpTrcGs6jwDGkjts7uM0T6rr QA9r7EYhiNus9AVx21/ThEn3B9LlZoEML/BP917/lIakrAx6dINhyQspvZNDzk99wRHL zVsX8pOxzSMCymlItTNDdjEyq33waQMiJrRlk= MIME-Version: 1.0 Received: by 10.142.135.16 with SMTP id i16mr464795wfd.192.1233705703866; Tue, 03 Feb 2009 16:01:43 -0800 (PST) In-Reply-To: <4d34a0a70901310021l6f42b34es24ca320e44c51ae6@mail.gmail.com> References: <4d34a0a70901310021l6f42b34es24ca320e44c51ae6@mail.gmail.com> Date: Wed, 4 Feb 2009 09:01:43 +0900 Message-ID: <4d34a0a70902031601r5c8c3424l4cd399193142e612@mail.gmail.com> Subject: [PATCH] ARM: OMAP: Disable USB interrupt in the musb_resume() function From: Kim Kyuwon To: linux-usb@vger.kernel.org Cc: linux-omap@vger.kernel.org, David Brownell , me@felipebalbi.com, =?EUC-KR?B?seix1L/4?= Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org USB should be suspended with interrupt disabled[1]. If USB is suspended with interrupt enabled and connected to host PC, a kernel panic would occur When it wakes up. Because, after the arch_suspend_enable_irqs() function is called in the suspend_enter() function, USB Interrupt handler is called, even though USB controller is still not resumed! All devices are resumed after the device_resume() is called. [1] /Documentation/power/devices.txt: 412 line Signed-off-by: Kim Kyuwon --- drivers/usb/musb/musb_core.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) * the system up quickly enough to respond ... @@ -2184,6 +2186,8 @@ static int musb_resume(struct platform_device *pdev) else clk_enable(musb->clock); + enable_irq(musb->nIrq); + /* for static cmos like DaVinci, register values were preserved * unless for some reason the whole soc powered down and we're * not treating that as a whole-system restart (e.g. swsusp) -- Kim Kyuwon -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 2cc34fa..0dfe15e 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -2151,6 +2151,8 @@ static int musb_suspend(struct platform_device *pdev, pm_message_t message) spin_lock_irqsave(&musb->lock, flags); + disable_irq(musb->nIrq); + if (is_peripheral_active(musb)) { /* FIXME force disconnect unless we know USB will wake