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] [day] [month] [year] [list]
Message-Id: <BB6D8A98-942B-4B2E-A668-5D47DDC0DBF7@jcrosoft.com>
Date:	Fri, 20 Dec 2013 19:35:22 +0800
From:	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@...osoft.com>
To:	Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc:	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@...osoft.com>,
	"<linux-arm-kernel@...ts.infradead.org> mailing list" 
	<linux-arm-kernel@...ts.infradead.org>,
	Linux Kernel list <linux-kernel@...r.kernel.org>,
	Andrew Victor <linux@...im.org.za>,
	Nicolas FERRE <nicolas.ferre@...el.com>,
	Daniel Lezcano <daniel.lezcano@...aro.org>,
	Sami Pietikäinen <Sami.Pietikainen@...ice.com>,
	tglx@...utronix.de, Benedikt Spranger <b.spranger@...utronix.de>
Subject: Re: [PATCH 1/2] ARM: AT91: PIT: Remove irq handler when clock event is unused

ACK
On Dec 20, 2013, at 6:45 PM, Sebastian Andrzej Siewior <bigeasy@...utronix.de> wrote:

> From: Benedikt Spranger <b.spranger@...utronix.de>
> 
> Setup and remove the interrupt handler in clock event mode selection.
> This avoids calling the (shared) interrupt handler when the device is
> not used.
> 
> Signed-off-by: Benedikt Spranger <b.spranger@...utronix.de>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> [bigeasy: redo the patch with NR_IRQS_LEGACY which is probably required since
> commit 8fe82a55 ("ARM: at91: sparse irq support") which is included since v3.6.
> Patch based on what Sami Pietikäinen <Sami.Pietikainen@...ice.com> suggested].
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> ---
> arch/arm/mach-at91/at91rm9200_time.c  | 1 +
> arch/arm/mach-at91/at91sam926x_time.c | 5 ++++-
> 2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
> index bc7b363..fd34d55 100644
> --- a/arch/arm/mach-at91/at91rm9200_time.c
> +++ b/arch/arm/mach-at91/at91rm9200_time.c
> @@ -134,6 +134,7 @@ clkevt32k_mode(enum clock_event_mode mode, struct clock_event_device *dev)
> 		break;
> 	case CLOCK_EVT_MODE_SHUTDOWN:
> 	case CLOCK_EVT_MODE_UNUSED:
> +		remove_irq(NR_IRQS_LEGACY + AT91_ID_SYS, &at91rm9200_timer_irq);

I’m a fan of copy and paste NR_IRQS_LEGACY + AT91_ID_SYS but ok

Best Regards,
J.
> 	case CLOCK_EVT_MODE_RESUME:
> 		irqmask = 0;
> 		break;
> diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c
> index bb39232..1c4c487 100644
> --- a/arch/arm/mach-at91/at91sam926x_time.c
> +++ b/arch/arm/mach-at91/at91sam926x_time.c
> @@ -77,7 +77,7 @@ static struct clocksource pit_clk = {
> 	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
> };
> 
> -
> +static struct irqaction at91sam926x_pit_irq;
> /*
>  * Clockevent device:  interrupts every 1/HZ (== pit_cycles * MCK/16)
>  */
> @@ -86,6 +86,8 @@ pit_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
> {
> 	switch (mode) {
> 	case CLOCK_EVT_MODE_PERIODIC:
> +		/* Set up irq handler */
> +		setup_irq(at91sam926x_pit_irq.irq, &at91sam926x_pit_irq);
> 		/* update clocksource counter */
> 		pit_cnt += pit_cycle * PIT_PICNT(pit_read(AT91_PIT_PIVR));
> 		pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN
> @@ -98,6 +100,7 @@ pit_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
> 	case CLOCK_EVT_MODE_UNUSED:
> 		/* disable irq, leaving the clocksource active */
> 		pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);
> +		remove_irq(at91sam926x_pit_irq.irq, &at91sam926x_pit_irq);
> 		break;
> 	case CLOCK_EVT_MODE_RESUME:
> 		break;
> -- 
> 1.8.5.1
> 

--
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