linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: bryan.wu@canonical.com (Bryan Wu)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/18] led-triggers: use atomic kzalloc during led trigger registering
Date: Wed, 10 Aug 2011 20:05:35 +0800	[thread overview]
Message-ID: <1312977952-2272-2-git-send-email-bryan.wu@canonical.com> (raw)
In-Reply-To: <1312977952-2272-1-git-send-email-bryan.wu@canonical.com>

kzalloc might cause sleep and will generate some warning detected by lockdep,
when call led_trigger_register_simple on each cpu cores in SMP. This patch fix
this.

[    1.999938] ------------[ cut here ]------------
[    2.004791] WARNING: at kernel/lockdep.c:2664 lockdep_trace_alloc+0xd8/0xf0()
[    2.012298] Modules linked in:
[    2.015563] [<c001b0cc>] (unwind_backtrace+0x0/0xf0) from [<c0052408>] (warn_slowpath_common+0x4c/0x64)
[    2.025451] [<c0052408>] (warn_slowpath_common+0x4c/0x64) from [<c005243c>] (warn_slowpath_null+0x1c/0x24)
[    2.035583] [<c005243c>] (warn_slowpath_null+0x1c/0x24) from [<c008be28>] (lockdep_trace_alloc+0xd8/0xf0)
[    2.045684] [<c008be28>] (lockdep_trace_alloc+0xd8/0xf0) from [<c00feeb4>] (kmem_cache_alloc_trace+0x2c/0x148)
[    2.056213] [<c00feeb4>] (kmem_cache_alloc_trace+0x2c/0x148) from [<c03770a0>] (led_trigger_register_simple+0x20/0x74)
[    2.067474] [<c03770a0>] (led_trigger_register_simple+0x20/0x74) from [<c0627a30>] (ledtrig_cpu_register+0x4c/0x8c)
[    2.078460] [<c0627a30>] (ledtrig_cpu_register+0x4c/0x8c) from [<c0094ca4>] (generic_smp_call_function_single_interrupt+0xcc/0x138)
[    2.090911] [<c0094ca4>] (generic_smp_call_function_single_interrupt+0xcc/0x138) from [<c0008408>] (do_IPI+0xb0/0x128)
[    2.102172] [<c0008408>] (do_IPI+0xb0/0x128) from [<c045921c>] (__irq_svc+0x3c/0x100)
[    2.110412] Exception stack(0xc07adf70 to 0xc07adfb8)
[    2.115722] df60:                                     c07c80f8 0000fb45 00000000 c07c80f8
[    2.124328] df80: c07ac000 c0837be4 c0464b64 c07c9d8c 00000000 411fc092 00000000 00000000
[    2.132934] dfa0: c0649760 c07adfb8 c07c5c58 c0014d50 20000013 ffffffff
[    2.139892] [<c045921c>] (__irq_svc+0x3c/0x100) from [<c0014d50>] (default_idle+0x30/0x38)
[    2.148590] [<c0014d50>] (default_idle+0x30/0x38) from [<c0014f74>] (cpu_idle+0xb4/0xf4)
[    2.157135] [<c0014f74>] (cpu_idle+0xb4/0xf4) from [<c0602778>] (start_kernel+0x2a8/0x2fc)
[    2.165832] [<c0602778>] (start_kernel+0x2a8/0x2fc) from [<80008040>] (0x80008040)
[    2.173797] ---[ end trace 97549d21d8dad3f5 ]---

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
 drivers/leds/led-triggers.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
index 4bebae7..9a9c78d 100644
--- a/drivers/leds/led-triggers.c
+++ b/drivers/leds/led-triggers.c
@@ -256,7 +256,7 @@ void led_trigger_register_simple(const char *name, struct led_trigger **tp)
 	struct led_trigger *trigger;
 	int err;
 
-	trigger = kzalloc(sizeof(struct led_trigger), GFP_KERNEL);
+	trigger = kzalloc(sizeof(struct led_trigger), GFP_ATOMIC);
 
 	if (trigger) {
 		trigger->name = name;
-- 
1.7.5

  reply	other threads:[~2011-08-10 12:05 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-10 12:05 [PATCH v3 00/18] Introduce a led trigger for CPU activity and consolidate LED driver in ARM Bryan Wu
2011-08-10 12:05 ` Bryan Wu [this message]
2011-08-10 12:05 ` [PATCH 02/18] led-triggers: create a trigger for CPU activity Bryan Wu
2011-08-10 13:06   ` Jamie Iles
2011-08-10 13:11     ` Jochen Friedrich
2011-08-10 12:05 ` [PATCH 03/18] arm: at91: convert old leds drivers to gpio_led and led_trigger drivers Bryan Wu
2011-08-10 12:05 ` [PATCH 04/18] mach-realview and mach-versatile: retire custom LED code Bryan Wu
2011-08-10 12:05 ` [PATCH 05/18] mach-ks8695: remove leds driver, since nobody use it Bryan Wu
2011-08-10 12:05 ` [PATCH 06/18] mach-shark: retire custom LED code Bryan Wu
2011-08-10 12:05 ` [PATCH 07/18] mach-orion5x: convert custom LED code to gpio_led and LED CPU trigger Bryan Wu
2011-08-10 12:05 ` [PATCH 08/18] mach-integrator: move CM_CTRL to header file for accessing by other functions Bryan Wu
2011-08-10 12:05 ` [PATCH 09/18] mach-integrator: retire custom LED code Bryan Wu
2011-08-10 12:05 ` [PATCH 10/18] mach-clps711x: retire custom LED code of P720T machine Bryan Wu
2011-08-10 12:05 ` [PATCH 11/18] mach-ebsa110: retire custom LED code Bryan Wu
2011-08-10 12:05 ` [PATCH 12/18] mach-footbridge: " Bryan Wu
2011-08-10 12:05 ` [PATCH 13/18] mach-pxa: " Bryan Wu
2011-08-10 12:05 ` [PATCH 14/18] plat-samsung: remove including old leds event API header file Bryan Wu
2011-08-10 12:05 ` [PATCH 15/18] mach-pnx4008: " Bryan Wu
2011-08-10 12:05 ` [PATCH 16/18] mach-omap1: retire custom LED code Bryan Wu
2011-08-10 12:05 ` [PATCH 17/18] mach-sa1100: " Bryan Wu
2011-08-15 11:19   ` Jochen Friedrich
2011-08-17 11:07     ` Bryan Wu
2011-08-10 12:05 ` [PATCH 18/18] ARM: use new LEDS CPU trigger stub to replace old one Bryan Wu
  -- strict thread matches above, loose matches on Subject: below --
2011-08-26  9:03 [PATCH v4 00/18] Introduce a led trigger for CPU activity and consolidate LED driver in ARM Bryan Wu
2011-08-26  9:03 ` [PATCH 01/18] led-triggers: use atomic kzalloc during led trigger registering Bryan Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1312977952-2272-2-git-send-email-bryan.wu@canonical.com \
    --to=bryan.wu@canonical.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).