From patchwork Thu Feb 26 08:27:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kim kyuwon X-Patchwork-Id: 8900 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 n1Q8RoFA031889 for ; Thu, 26 Feb 2009 08:27:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751259AbZBZI1u (ORCPT ); Thu, 26 Feb 2009 03:27:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751344AbZBZI1u (ORCPT ); Thu, 26 Feb 2009 03:27:50 -0500 Received: from rv-out-0506.google.com ([209.85.198.239]:5377 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751259AbZBZI1t (ORCPT ); Thu, 26 Feb 2009 03:27:49 -0500 Received: by rv-out-0506.google.com with SMTP id g37so440024rvb.1 for ; Thu, 26 Feb 2009 00:27:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=bb3L6kS0d9MUEoVSEQ//EDtMVgl0RHpCsgJMqDR9KoM=; b=IsE61tESyrtywRY+KacoZ2IOZ4V+iqcQIgZ1xsvu+QkrLjTU9rsWqceQPxwcRzLsXH sBqD7NcNeyEbBXaRM7misij1xl4i6uA0zsS967hD0u8FS2cxKqFitKpptvH+FeGIK2Ld nNB5+TFYLCNw08HXzRjW9M6zMEgb1fK0L1O6A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=vyf+rRbV2fLBYduev12clCX8PqdJRY1ada5PX0euJlWRqyZ8OxC+HXc9zIChLtVr0u NTG0Cqpdj/fU24NhGE3vAAOa8gKuOBkYIT5/0hQlHOaKs5v9zKEkq2Z/A5Ru12GtXe1+ rUlWFTlJqppIZvlBMJNyNCMEBhZdb392z6vkE= MIME-Version: 1.0 Received: by 10.142.48.14 with SMTP id v14mr542169wfv.227.1235636867325; Thu, 26 Feb 2009 00:27:47 -0800 (PST) Date: Thu, 26 Feb 2009 17:27:47 +0900 Message-ID: <4d34a0a70902260027g686a2480qb6b6e00b8d5e8b7b@mail.gmail.com> Subject: [RESEND][PATCH 1/2] usb: musb: fix the possible panic while resuming From: Kim Kyuwon To: "linux-usb@vger.kernel.org" Cc: "me@felipebalbi.com" , OMAP , David Brownell , Minkyu Kang , =?EUC-KR?B?udqw5rnO?= Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org While waking up, musb can cause a kernel panic. This patch is fixing it by enabling the clock in the resume_early method. Signed-off-by: Kim Kyuwon --- drivers/usb/musb/musb_core.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) else @@ -2188,7 +2185,6 @@ static int musb_resume(struct platform_device *pdev) * unless for some reason the whole soc powered down and we're * not treating that as a whole-system restart (e.g. swsusp) */ - spin_unlock_irqrestore(&musb->lock, flags); return 0; } @@ -2206,7 +2202,7 @@ static struct platform_driver musb_driver = { .remove = __devexit_p(musb_remove), .shutdown = musb_shutdown, .suspend = musb_suspend, - .resume = musb_resume, + .resume_early = musb_resume_early, }; /*-------------------------------------------------------------------------*/ diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 2cc34fa..6de2cb2 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -2169,16 +2169,13 @@ static int musb_suspend(struct platform_device *pdev, pm_message_t message) return 0; } -static int musb_resume(struct platform_device *pdev) +static int musb_resume_early(struct platform_device *pdev) { - unsigned long flags; struct musb *musb = dev_to_musb(&pdev->dev); if (!musb->clock) return 0; - spin_lock_irqsave(&musb->lock, flags); - if (musb->set_clock) musb->set_clock(musb->clock, 1);