All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gaël PORTAY" <gael.portay@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: Boris BREZILLON <boris.brezillon@free-electrons.com>,
	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org,
	Nicolas FERRE <nicolas.ferre@atmel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Alexandre Belloni <alexandre.belloni@free-electrons.com>
Subject: Re: [PATCH 3/3] ARM: at91/tclib: mask interruptions at shutdown and probe
Date: Wed, 27 Aug 2014 17:27:32 +0200	[thread overview]
Message-ID: <CAHs7_Bb2Qu8asq_48Q=G9ZviOqZnVZPAaAgqbrfSHhOAD_QFHQ@mail.gmail.com> (raw)
In-Reply-To: <20140820073111.GH13793@ulmo>

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

  parent reply	other threads:[~2014-08-27 15:27 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-19 22:07 [PATCH 0/3] ARM: at91/tclib: fix segmentation fault Gaël PORTAY
2014-08-19 22:07 ` Gaël PORTAY
2014-08-19 22:07 ` [PATCH 1/3] ARM: at91/tclib: prefer using of devm_* functions Gaël PORTAY
2014-08-19 22:07   ` Gaël PORTAY
2014-08-20  8:19   ` Boris BREZILLON
2014-08-20  8:19     ` Boris BREZILLON
2014-08-19 22:07 ` [PATCH 2/3] ARM: at91/tclib: move initialization from alloc to probe Gaël PORTAY
2014-08-19 22:07   ` Gaël PORTAY
2014-08-20  7:39   ` Thierry Reding
2014-08-20  7:39     ` Thierry Reding
2014-08-20  8:16   ` Boris BREZILLON
2014-08-20  8:16     ` Boris BREZILLON
2014-08-19 22:07 ` [PATCH 3/3] ARM: at91/tclib: mask interruptions at shutdown and probe Gaël PORTAY
2014-08-19 22:07   ` Gaël PORTAY
2014-08-19 22:11   ` Jean-Christophe PLAGNIOL-VILLARD
2014-08-19 22:11     ` Jean-Christophe PLAGNIOL-VILLARD
2014-08-19 23:01     ` Boris BREZILLON
2014-08-19 23:01       ` Boris BREZILLON
2014-08-20  7:31       ` Thierry Reding
2014-08-20  7:31         ` Thierry Reding
2014-08-20  8:14         ` Boris BREZILLON
2014-08-20  8:14           ` Boris BREZILLON
2014-08-20  8:28           ` Thierry Reding
2014-08-20  8:28             ` Thierry Reding
2014-08-20  9:06             ` Boris BREZILLON
2014-08-20  9:06               ` Boris BREZILLON
2014-08-20  9:48               ` Thierry Reding
2014-08-20  9:48                 ` Thierry Reding
2014-08-20 10:07                 ` Boris BREZILLON
2014-08-20 10:07                   ` Boris BREZILLON
2014-08-27 15:27         ` Gaël PORTAY [this message]
2014-08-21  3:32   ` Arnd Bergmann
2014-08-21  3:32     ` Arnd Bergmann
2014-08-21  9:43     ` Gaël PORTAY

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHs7_Bb2Qu8asq_48Q=G9ZviOqZnVZPAaAgqbrfSHhOAD_QFHQ@mail.gmail.com' \
    --to=gael.portay@gmail.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=arnd@arndb.de \
    --cc=boris.brezillon@free-electrons.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=tglx@linutronix.de \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.