Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1187412 > unrolled thread

Re: [PATCH 1/3] clocksource: atmel-st: Remove irq handler when clock event is unused

Started byThomas Gleixner <tglx@linutronix.de>
First post2015-07-18 10:20 +0200
Last post2015-07-18 10:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 1/3] clocksource: atmel-st: Remove irq handler when clock  event is unused Thomas Gleixner <tglx@linutronix.de> - 2015-07-18 10:20 +0200

#1187412 — Re: [PATCH 1/3] clocksource: atmel-st: Remove irq handler when clock event is unused

FromThomas Gleixner <tglx@linutronix.de>
Date2015-07-18 10:20 +0200
SubjectRe: [PATCH 1/3] clocksource: atmel-st: Remove irq handler when clock event is unused
Message-ID<pNvvI-6Vg-3@gated-at.bofh.it>
On Fri, 17 Jul 2015, Alexandre Belloni wrote:
> +static int atmel_st_request_irq(struct clock_event_device *dev)
> +{
> +	int ret;
> +
> +	if (clockevent_state_periodic(dev) || clockevent_state_oneshot(dev))
> +		return 0;
> +
> +	ret = request_irq(irq, at91rm9200_timer_interrupt,
> +			  IRQF_SHARED | IRQF_TIMER | IRQF_IRQPOLL,
> +			  "at91_tick", regmap_st);
> +	if (ret) {
> +		pr_alert("Unable to setup IRQ\n");
> +		return ret;
> +	}
> +
>  	return 0;
>  }
>  
>  static int clkevt32k_set_oneshot(struct clock_event_device *dev)
>  {
> +	int ret;
> +
>  	clkdev32k_disable_and_flush_irq();
>  
>  	/*
>  	 * ALM for oneshot irqs, set by next_event()
>  	 * before 32 seconds have passed.
>  	 */
> +	ret = atmel_st_request_irq(dev);

You cannot call request_irq() from interrupt disabled context. It
works during early boot because might_sleep() is not active then, but
if that happens during normal runtime it wont work.

Thanks,

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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web