linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: daniel.lezcano@linaro.org (Daniel Lezcano)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/6] clocksource: clksrc-of: Do not drop unheld reference on device node
Date: Tue, 10 Dec 2013 20:16:09 +0100	[thread overview]
Message-ID: <1386702972-25565-3-git-send-email-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <1386702972-25565-1-git-send-email-daniel.lezcano@linaro.org>

From: Thierry Reding <thierry.reding@gmail.com>

When booting a recent kernel on ARM with OF_DYNAMIC enabled, the kernel
warns about the following:

	[    0.000000] ERROR: Bad of_node_put() on /timer at 50004600
	[    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.12.0-rc5-next-20131017-00077-gedfd827-dirty #406
	[    0.000000] [<c0015b68>] (unwind_backtrace+0x0/0xf4) from [<c00117e4>] (show_stack+0x10/0x14)
	[    0.000000] [<c00117e4>] (show_stack+0x10/0x14) from [<c055f734>] (dump_stack+0x9c/0xc8)
	[    0.000000] [<c055f734>] (dump_stack+0x9c/0xc8) from [<c03b47d4>] (of_node_release+0x90/0x9c)
	[    0.000000] [<c03b47d4>] (of_node_release+0x90/0x9c) from [<c03b5084>] (of_find_matching_node_and_match+0x78/0xb4)
	[    0.000000] [<c03b5084>] (of_find_matching_node_and_match+0x78/0xb4) from [<c07887c8>] (clocksource_of_init+0x60/0x70)
	[    0.000000] [<c07887c8>] (clocksource_of_init+0x60/0x70) from [<c076e99c>] (start_kernel+0x1f4/0x33c)
	[    0.000000] [<c076e99c>] (start_kernel+0x1f4/0x33c) from [<80008074>] (0x80008074)

This is caused by clocksource_of_init() dropping a reference on the
device node that it never took. The reference taken by the loop is
implicitly dropped on subsequent iterations. See the implementation of
and the comment on top of the of_find_matching_node_and_match()
function for reference (no pun intended).

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 drivers/clocksource/clksrc-of.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/clocksource/clksrc-of.c b/drivers/clocksource/clksrc-of.c
index 35639cf4..b9ddd9e 100644
--- a/drivers/clocksource/clksrc-of.c
+++ b/drivers/clocksource/clksrc-of.c
@@ -35,6 +35,5 @@ void __init clocksource_of_init(void)
 
 		init_func = match->data;
 		init_func(np);
-		of_node_put(np);
 	}
 }
-- 
1.7.9.5

  parent reply	other threads:[~2013-12-10 19:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-10 19:13 [GIT PULL RESEND2] clocksource/clockevents fixes for 3.13 Daniel Lezcano
2013-12-10 19:16 ` [PATCH 1/6] clocksource: time-efm32: Select CLKSRC_MMIO Daniel Lezcano
2013-12-10 19:16   ` [PATCH 2/6] clocksource: armada-370-xp: Register sched_clock after the counter reset Daniel Lezcano
2013-12-10 19:16   ` Daniel Lezcano [this message]
2013-12-10 19:16   ` [PATCH 4/6] clocksource: sunxi: Stop timer from ticking before enabling interrupts Daniel Lezcano
2013-12-10 19:16   ` [PATCH 5/6] clocksource: dw_apb_timer_of: Fix read_sched_clock Daniel Lezcano
2013-12-10 19:16   ` [PATCH 6/6] clocksource: dw_apb_timer_of: Fix support for dts binding "snps, dw-apb-timer" Daniel Lezcano
2013-12-11  5:00     ` Baruch Siach
2013-12-11 14:00       ` Daniel Lezcano
2013-12-10 19:48 ` [GIT PULL RESEND2] clocksource/clockevents fixes for 3.13 Ingo Molnar
2013-12-11 14:02   ` Daniel Lezcano
2013-12-11 14:05     ` Ingo Molnar

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=1386702972-25565-3-git-send-email-daniel.lezcano@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --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).