From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] clocksource: arm_arch_timer: discard unavailable timers correctly
Date: Tue, 16 Sep 2014 17:01:04 -0700 [thread overview]
Message-ID: <20140917000104.GA10233@codeaurora.org> (raw)
In-Reply-To: <1410911445-19067-1-git-send-email-sudeep.holla@arm.com>
On 09/17, Sudeep Holla wrote:
> Currently we wait until both nodes are probed if we have two timers
> without checking if the device is actually available. This might
device node is actually available?
> result in non-functional system as no timer gets registered.
>
> This patch adds the check for the availablity of the timer device
> so that unavailable timers are discarded correctly.
>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
Looks mostly ok. Comment below could be a follow up I guess.
> drivers/clocksource/arm_arch_timer.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> index 5163ec1..4d025ad 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -622,11 +622,15 @@ static void __init arch_timer_common_init(void)
>
> /* Wait until both nodes are probed if we have two timers */
> if ((arch_timers_present & mask) != mask) {
> - if (of_find_matching_node(NULL, arch_timer_mem_of_match) &&
> - !(arch_timers_present & ARCH_MEM_TIMER))
> + struct device_node *dn;
> +
> + dn = of_find_matching_node(NULL, arch_timer_mem_of_match);
> + if (dn && of_device_is_available(dn) &&
> + !(arch_timers_present & ARCH_MEM_TIMER))
> return;
> - if (of_find_matching_node(NULL, arch_timer_of_match) &&
> - !(arch_timers_present & ARCH_CP15_TIMER))
> + dn = of_find_matching_node(NULL, arch_timer_of_match);
> + if (dn && of_device_is_available(dn) &&
> + !(arch_timers_present & ARCH_CP15_TIMER))
> return;
Where's the of_node_put()?
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
WARNING: multiple messages have this Message-ID (diff)
From: Stephen Boyd <sboyd@codeaurora.org>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>,
Mark Rutland <mark.rutland@arm.com>
Subject: Re: [PATCH] clocksource: arm_arch_timer: discard unavailable timers correctly
Date: Tue, 16 Sep 2014 17:01:04 -0700 [thread overview]
Message-ID: <20140917000104.GA10233@codeaurora.org> (raw)
In-Reply-To: <1410911445-19067-1-git-send-email-sudeep.holla@arm.com>
On 09/17, Sudeep Holla wrote:
> Currently we wait until both nodes are probed if we have two timers
> without checking if the device is actually available. This might
device node is actually available?
> result in non-functional system as no timer gets registered.
>
> This patch adds the check for the availablity of the timer device
> so that unavailable timers are discarded correctly.
>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
Looks mostly ok. Comment below could be a follow up I guess.
> drivers/clocksource/arm_arch_timer.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> index 5163ec1..4d025ad 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -622,11 +622,15 @@ static void __init arch_timer_common_init(void)
>
> /* Wait until both nodes are probed if we have two timers */
> if ((arch_timers_present & mask) != mask) {
> - if (of_find_matching_node(NULL, arch_timer_mem_of_match) &&
> - !(arch_timers_present & ARCH_MEM_TIMER))
> + struct device_node *dn;
> +
> + dn = of_find_matching_node(NULL, arch_timer_mem_of_match);
> + if (dn && of_device_is_available(dn) &&
> + !(arch_timers_present & ARCH_MEM_TIMER))
> return;
> - if (of_find_matching_node(NULL, arch_timer_of_match) &&
> - !(arch_timers_present & ARCH_CP15_TIMER))
> + dn = of_find_matching_node(NULL, arch_timer_of_match);
> + if (dn && of_device_is_available(dn) &&
> + !(arch_timers_present & ARCH_CP15_TIMER))
> return;
Where's the of_node_put()?
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
next prev parent reply other threads:[~2014-09-17 0:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-16 23:50 [PATCH] clocksource: arm_arch_timer: discard unavailable timers correctly Sudeep Holla
2014-09-16 23:50 ` Sudeep Holla
2014-09-17 0:01 ` Stephen Boyd [this message]
2014-09-17 0:01 ` Stephen Boyd
2014-09-17 19:39 ` [PATCH v2] " Sudeep Holla
2014-09-17 19:39 ` Sudeep Holla
2014-09-17 19:51 ` Stephen Boyd
2014-09-17 19:51 ` Stephen Boyd
2014-09-24 15:16 ` Sudeep Holla
2014-09-24 15:16 ` Sudeep Holla
2014-09-24 15:48 ` Mark Rutland
2014-09-24 15:48 ` Mark Rutland
2014-09-24 15:55 ` Sudeep Holla
2014-09-24 15:55 ` Sudeep Holla
2014-09-24 16:23 ` [PATCH v3] " Sudeep Holla
2014-09-24 16:23 ` Sudeep Holla
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=20140917000104.GA10233@codeaurora.org \
--to=sboyd@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.