[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a68ca8a5-77c6-4aac-f3b6-67edbf42a9bf@lechnology.com>
Date: Tue, 17 Dec 2019 11:01:28 -0600
From: David Lechner <david@...hnology.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Sekhar Nori <nsekhar@...com>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
Kevin Hilman <khilman@...nel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: Re: [PATCH 1/3] clocksource: davinci: work around a clocksource
problem on dm365 SoC
On 12/17/19 2:00 AM, Bartosz Golaszewski wrote:
> pon., 16 gru 2019 o 18:58 David Lechner <david@...hnology.com> napisaĆ(a):
>>
>>>
>>> +static unsigned int davinci_clocksource_tim32_mode;
>>
>> static unsigned bool davinci_clocksource_initialized;
>>
>>> +
>>> static struct davinci_clockevent *
>>> to_davinci_clockevent(struct clock_event_device *clockevent)
>>> {
>>> @@ -94,7 +96,7 @@ static void davinci_tim12_shutdown(void __iomem *base)
>>> * halves. In this case TIM34 runs in periodic mode and we must
>>> * not modify it.
>>> */
>>> - tcr |= DAVINCI_TIMER_ENAMODE_PERIODIC <<
>>> + tcr |= davinci_clocksource_tim32_mode <<
>>> DAVINCI_TIMER_ENAMODE_SHIFT_TIM34;
>>
>> if (davinci_clocksource_initialized)
>> tcr |= DAVINCI_TIMER_ENAMODE_PERIODIC <<
>> DAVINCI_TIMER_ENAMODE_SHIFT_TIM34;
>
> I thought about doing this initially, but then figured this code would
> be called a lot, so why not avoid branching and just store the right
> value? Alternatively we can do:
>
> if (likely(davinci_clocksource_initialized)
> ....
>
Unless there is a measurable performance difference, I think it
would be better with if/likely.
Powered by blists - more mailing lists