linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Valentine <valentine.barshak@cogentembedded.com>,
	Magnus Damm <magnus.damm@gmail.com>,
	Alexandre Courbot <gnurou@gmail.com>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Axel Haslam <ahaslam@baylibre.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-sh@vger.kernel.org" <linux-sh@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpio: rcar: Check for irq_set_irq_wake() failures
Date: Tue, 12 May 2015 10:07:54 +0200	[thread overview]
Message-ID: <CAMuHMdX2zaRhZh20e-TMkMeES6Ftaez1vcdcnAimVczW6L7gsQ@mail.gmail.com> (raw)
In-Reply-To: <CACRpkdaDEr7Lw8u5tAC-som5W-WM4-Wfqena4Ftd4KFdEA2-Yg@mail.gmail.com>

On Tue, May 12, 2015 at 9:55 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, May 4, 2015 at 4:09 PM, Geert Uytterhoeven
> <geert+renesas@glider.be> wrote:
>> If an interrupt controller doesn't support wake-up configuration, trying
>> to deconfigure wake-up will cause a warning:
>>
>>     WARNING: CPU: 1 PID: 1341 at kernel/irq/manage.c:540 irq_set_irq_wake+0x9c/0xf8()
>>     Unbalanced IRQ 26 wake disable
>>
>> To fix this, refrain from any further parent interrupt controller
>> (de)configuration if irq_set_irq_wake() failed.
>>
>> Fixes: ab82fa7da4dce5c7 ("gpio: rcar: Prevent module clock disable when wake-up is enabled")
>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> ---
>> This is an alternative for:
>>   - calling "gic_set_irqchip_flags(IRQCHIP_SKIP_SET_WAKE)" from the
>>     platform code, OR

Which is hacky, considering the below.

>>   - setting "gic_chip.flags = IRQCHIP_SKIP_SET_WAKE" in the GIC driver
>>     code.

Which was rejected by Marc, as the hardware doesn't support it.

> This should be moved to the commit message I think.

So that's why I put it below the "---".

>> -       irq_set_irq_wake(p->irq_parent, on);
>> +       int error;
>> +
>> +       if (p->irq_parent) {
>> +               error = irq_set_irq_wake(p->irq_parent, on);
>> +               if (error) {
>> +                       dev_dbg(&p->pdev->dev,
>> +                               "irq %u doesn't support irq_set_wake\n",
>> +                               p->irq_parent);
>> +                       p->irq_parent = 0;
>> +               }
>> +       }
>
> Does the SH maintainers really like this... Warning
> appear once and is squelched.
>
> Isn't it better to make sure it doesn't happen or something.
>
> It looks hacky. Any other suggestions?

The first call to irq_set_irq_wake() (on = true) doesn't print a warning.
It returns an error code, to indicate that the operation is not supported.

Calling irq_set_irq_wake() again (on = false, during resume) would print
a warning, as it wouldn't match internal state ("Unbalanced IRQ 26 wake
disable"). That one is gone now.

> Also, please convert this driver to use GPIOLIB_IRQCHIP
> like everyone else.

What old branch are you looking at, that it doesn't have commit
c7f3c5d3ac2d6831 ("gpio: rcar: Switch to use gpiolib irqchip helpers")
yet ;-)?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2015-05-12  8:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-04 14:09 [PATCH] gpio: rcar: Check for irq_set_irq_wake() failures Geert Uytterhoeven
2015-05-12  7:55 ` Linus Walleij
2015-05-12  8:07   ` Geert Uytterhoeven [this message]
2015-05-12 10:36     ` Linus Walleij

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=CAMuHMdX2zaRhZh20e-TMkMeES6Ftaez1vcdcnAimVczW6L7gsQ@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=ahaslam@baylibre.com \
    --cc=geert+renesas@glider.be \
    --cc=gnurou@gmail.com \
    --cc=hisashi.nakamura.ak@renesas.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=marc.zyngier@arm.com \
    --cc=valentine.barshak@cogentembedded.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).