Re: [PATCH 3/3] ARM: at91/tclib: mask interruptions at shutdown and probe

Gaël PORTAY
2014-08-27T15:27:32Z

[-- Attachment #1: Type: text/plain, Size: 1306 bytes --]

On 20 August 2014 09:31, Thierry Reding <thierry.reding@gmail.com> wrote:

> Wouldn't a more proper fix be to only enable the IRQ (setup_irq()) once
> everything has properly been set up? That's certainly how all other
> drivers are doing this. Generally I think it's best to assume that an
> interrupt can fire at any point after it's been enabled, so everything
> should be set up prior to enabling it.
>

I think we cannot move the IRQ request after the clock registration...

I did not find any clockevents_DEconfig_and_UNregister function... so if the
IRQ request fails, it will not be possible to unregister from the clock
events.

It would be preferable to leave the IRQ request before the clock
registration, is not it ?

> Also, does anyone know why this driver uses setup_irq() rather than the
> more idiomatic request_irq()?
>

I took care of that...

By the way, if case of request failure, would it be cleaner to process a
clk_disable_unprepare(t2_clk) before returning ?

clkevt.clkevt.cpumask = cpumask_of(0);

ret = request_irq(irq, ch2_irq, IRQF_TIMER, "tc_clkevt", &clkevt);
if (ret) {
+ clk_disable_unprepare(t2_clk);
return ret;
}

clockevents_config_and_register(&clkevt.clkevt, 32768, 1, 0xffff);

Gaël

[-- Attachment #2: Type: text/html, Size: 1948 bytes --]