From patchwork Sat Aug 22 13:20:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 43306 X-Patchwork-Delegate: khilman@deeprootsystems.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 n7MDKfe9005958 for ; Sat, 22 Aug 2009 13:20:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754508AbZHVNUf (ORCPT ); Sat, 22 Aug 2009 09:20:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754312AbZHVNUe (ORCPT ); Sat, 22 Aug 2009 09:20:34 -0400 Received: from mail-pz0-f194.google.com ([209.85.222.194]:33736 "EHLO mail-pz0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754201AbZHVNUd (ORCPT ); Sat, 22 Aug 2009 09:20:33 -0400 Received: by pzk32 with SMTP id 32so283908pzk.33 for ; Sat, 22 Aug 2009 06:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=5OMln3+NvaPeTjxK8IcDPb99Epprg4Dzhdmal0WQhDg=; b=voEgLMsJm/wi4APl5TwLYR9xUhxmK7m13YdOOsQedes+hPhCg6URapcYOgnE5m9084 n+0uYUMEXfwYRGmt6PGXia0K4AIq73frpZGyHo6ZXFoQSdbgKJMYP/+MpeKM2SbAINPS fyzE2uPTlrzd5UsPkhcOcDYM2L0AnMUKNfFo4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=tw+Munyqfdyt38Z6JzH62XrgIuD2V8mo6wWazL102yEoaZuHsRE2Ss08+0vhacs+rM 1tNNvFhzs520U+M6+xUovQqQnu2LD+Id9yevMuNn4P7D92WnsVrfsE1BV1+Ru1eLvrKi Q8cbBZ4pkF/d589tHbz0pf36V9uLAGUzZ+z1s= Received: by 10.114.214.3 with SMTP id m3mr3532778wag.205.1250947235479; Sat, 22 Aug 2009 06:20:35 -0700 (PDT) Received: from localhost ([119.139.170.39]) by mx.google.com with ESMTPS id m30sm4063642wag.7.2009.08.22.06.20.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 22 Aug 2009 06:20:35 -0700 (PDT) From: tom.leiming@gmail.com To: khilman@deeprootsystems.com, peterz@infradead.org Cc: linux-omap@vger.kernel.org, arm-kernel@lists.infradead.org, linux-embedded@vger.kernel.org, linux@arm.linux.org.uk, Ming Lei Subject: [PATCH] OMAP3:PM: fix lockdep warning caused by omap3_pm_init Date: Sat, 22 Aug 2009 21:20:26 +0800 Message-Id: <1250947226-2371-1-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 1.6.0.GIT Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Ming Lei This patch uses kmalloc(size,GFP_ATOMIC) instead of kmalloc(size,GFP_KERNEL) to allocate memory for instance of struct power_state in pwrdms_setup(), since it may be called by pwrdm_for_each() with irq disabled. It is a easy fix for the following lockdep warning caused by kmalloc(size,GFP_KERNEL) in pwrdms_setup(): Power Management for TI OMAP3. ------------[ cut here ]------------ WARNING: at kernel/lockdep.c:2282 lockdep_trace_alloc+0xe8/0xfc() Modules linked in: [] (unwind_backtrace+0x0/0xec) from [] (warn_slowpath_common+0x48/0x60) [] (warn_slowpath_common+0x48/0x60) from [] (lockdep_trace_alloc+0xe8/0xfc) [] (lockdep_trace_alloc+0xe8/0xfc) from [] (kmem_cache_alloc+0x28/0x178) [] (kmem_cache_alloc+0x28/0x178) from [] (pwrdms_setup+0x30/0xf8) [] (pwrdms_setup+0x30/0xf8) from [] (pwrdm_for_each+0x64/0x84) [] (pwrdm_for_each+0x64/0x84) from [] (omap3_pm_init+0x3f4/0x5ac) [] (omap3_pm_init+0x3f4/0x5ac) from [] (do_one_initcall+0x30/0x1d4) [] (do_one_initcall+0x30/0x1d4) from [] (kernel_init+0xa4/0x118) [] (kernel_init+0xa4/0x118) from [] (kernel_thread_exit+0x0/0x8) ---[ end trace 1e06f8d97dc5a19b ]--- --- This patch is against linux-2.6.31-rc7. Signed-off-by: Ming Lei --- arch/arm/mach-omap2/pm34xx.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 488d595..d67b781 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -665,7 +665,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm) if (!pwrdm->pwrsts) return 0; - pwrst = kmalloc(sizeof(struct power_state), GFP_KERNEL); + pwrst = kmalloc(sizeof(struct power_state), GFP_ATOMIC); if (!pwrst) return -ENOMEM; pwrst->pwrdm = pwrdm;