lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54B3D88C.80702@linaro.org>
Date:	Mon, 12 Jan 2015 15:22:04 +0100
From:	Daniel Lezcano <daniel.lezcano@...aro.org>
To:	Nicolas Ferre <nicolas.ferre@...el.com>,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
CC:	Boris BREZILLON <boris.brezillon@...e-electrons.com>,
	Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
	Maxime Ripard <maxime.ripard@...e-electrons.com>,
	sylvain.rochet@...secur.com, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] clocksource: timer-atmel-pit: don't suspend/resume if
 unused

On 01/12/2015 03:04 PM, Nicolas Ferre wrote:
> Le 18/12/2014 15:05, Nicolas Ferre a écrit :
>> From: Sylvain Rochet <sylvain.rochet@...secur.com>
>>
>> Waiting for PIT to stop counting takes a long time:
>>    1/(Master clock/prescaler/PIVR)
>> = 1/(133 MHz     /16       /2^20)
>> = 126 ms
>>
>> Up to 126 ms if master clock is set to 133 MHz, skipping suspend/resume
>> of the unused PIT device reduce (suspend time + resume time) from ~140 ms
>> to ~17 ms.
>>
>> Signed-off-by: Sylvain Rochet <sylvain.rochet@...secur.com>
>> [nicolas.ferre@...el.com: move to newer clocksource driver]
>> Signed-off-by: Nicolas Ferre <nicolas.ferre@...el.com>
>> Cc: Daniel Lezcano <daniel.lezcano@...aro.org>
>> ---
>> Hi Sylvain,
>>
>> I re-worked (and "Acked") your patch so it can be applied on the newer Mainline
>> kernels. Beware, I changed the "subject line" as well. The PIT driver moved
>> recently (3.18).
>>
>> Daniel,
>> Can you take this patch in your tree?
>
> Hi Daniel,
>
> Anything prevents this patch from being merged (aka ping ;-))?

[Cc'ed tglx].

Hi Nico,

thanks for the head up.

Nothing prevents it but I am wondering if this change shouldn't be in 
the generic framework (kernel/time/clocksource.c and 
kernel/time/clockevents.c), so all drivers will benefit this change ?


>> Thanks, bye.
>>    Nicolas.
>>
>>   drivers/clocksource/timer-atmel-pit.c | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/clocksource/timer-atmel-pit.c b/drivers/clocksource/timer-atmel-pit.c
>> index b5b4d4585c9a..5408bc7c68d8 100644
>> --- a/drivers/clocksource/timer-atmel-pit.c
>> +++ b/drivers/clocksource/timer-atmel-pit.c
>> @@ -123,6 +123,10 @@ static void at91sam926x_pit_suspend(struct clock_event_device *cedev)
>>   {
>>   	struct pit_data *data = clkevt_to_pit_data(cedev);
>>
>> +	/* Don't suspend PIT if unused */
>> +	if (cedev->mode == CLOCK_EVT_MODE_UNUSED)
>> +		return;
>> +
>>   	/* Disable timer */
>>   	pit_write(data->base, AT91_PIT_MR, 0);
>>   }
>> @@ -145,6 +149,10 @@ static void at91sam926x_pit_resume(struct clock_event_device *cedev)
>>   {
>>   	struct pit_data *data = clkevt_to_pit_data(cedev);
>>
>> +	/* Don't resume PIT if unused */
>> +	if (cedev->mode == CLOCK_EVT_MODE_UNUSED)
>> +		return;
>> +
>>   	at91sam926x_pit_reset(data);
>>   }
>>
>>
>
>


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ