mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dinh Nguyen <dinguyen@kernel.org>
To: Alexey Sheplyakov <asheplyakov@basealt.ru>, linux-kernel@vger.kernel.org
Cc: "Vadim V . Vlasov" <vadim.vlasov@elpitech.ru>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] drivers/clocksource/dw_apb_timer_of: fixed probe failure
Date: Mon, 6 Dec 2021 09:25:45 -0600	[thread overview]
Message-ID: <b6ac9148-81cf-a1e7-3c18-c9ff9ca3694e@kernel.org> (raw)
In-Reply-To: <20211109153401.157491-1-asheplyakov@basealt.ru>



On 11/9/21 9:34 AM, Alexey Sheplyakov wrote:
> The driver refuses to probe with -EINVAL since the commit
> 5d9814df0aec ("clocksource/drivers/dw_apb_timer_of: Add error handling if no clock available").
> 
> Before the driver used to probe successfully if either
> "clock-freq" or "clock-frequency" properties has been specified
> in the device tree.
> 
> That commit changed
> 
> if (A && B)
> 	panic("No clock nor clock-frequency property");
> 
> into
> 
> if (!A && !B)
> 	return 0;
> 
> That's a bug: the reverse of `A && B` is '!A || !B', not '!A && !B'
> 
> Signed-off-by: Vadim V. Vlasov <vadim.vlasov@elpitech.ru>
> Signed-off-by: Alexey Sheplyakov <asheplyakov@basealt.ru>
> Fixes: 5d9814df0aec56a6 ("clocksource/drivers/dw_apb_timer_of: Add error handling if no clock available").
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: Dinh Nguyen <dinguyen@kernel.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Vadim V. Vlasov <vadim.vlasov@elpitech.ru>
> ---
>   drivers/clocksource/dw_apb_timer_of.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clocksource/dw_apb_timer_of.c b/drivers/clocksource/dw_apb_timer_of.c
> index 3819ef5b7098..3245eb0c602d 100644
> --- a/drivers/clocksource/dw_apb_timer_of.c
> +++ b/drivers/clocksource/dw_apb_timer_of.c
> @@ -47,7 +47,7 @@ static int __init timer_get_base_and_rate(struct device_node *np,
>   			pr_warn("pclk for %pOFn is present, but could not be activated\n",
>   				np);
>   
> -	if (!of_property_read_u32(np, "clock-freq", rate) &&
> +	if (!of_property_read_u32(np, "clock-freq", rate) ||
>   	    !of_property_read_u32(np, "clock-frequency", rate))
>   		return 0;
>   
> 

Acked-by: Dinh Nguyen <dinguyen@kernel.org>

  reply	other threads:[~2021-12-06 15:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-09 15:34 Alexey Sheplyakov
2021-12-06 15:25 ` Dinh Nguyen [this message]
2021-12-06 15:39 ` Daniel Lezcano
2021-12-11 13:05 ` [tip: timers/urgent] clocksource/drivers/dw_apb_timer_of: Fix " tip-bot2 for Alexey Sheplyakov

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=b6ac9148-81cf-a1e7-3c18-c9ff9ca3694e@kernel.org \
    --to=dinguyen@kernel.org \
    --cc=asheplyakov@basealt.ru \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=vadim.vlasov@elpitech.ru \
    /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

all inboxes | Powered by JetHome®