All of lore.kernel.org
 help / color / mirror / Atom feed
From: santosh shilimkar <santosh.shilimkar@oracle.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: Santosh Shilimkar <ssantosh@kernel.org>,
	linux-gpio@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH resend 2/2] [RFC] genirq: Set IRQCHIP_SKIP_SET_WAKE for no_irq_chip and dummy_irq_chip
Date: Mon, 12 Jan 2015 08:37:29 -0800	[thread overview]
Message-ID: <54B3F849.30001@oracle.com> (raw)
In-Reply-To: <1421078671-5920-2-git-send-email-geert+renesas@glider.be>

On 1/12/2015 8:04 AM, Geert Uytterhoeven wrote:
> If no_irq_chip or dummy_irq_chip are used for wake up (e.g. gpio-keys
> with a simple GPIO controller), the following warning is printed on
> resume from s2ram:
>
>      WANING: CPU: 0 PID: 1046 at kernel/irq/manage.c:537 irq_set_irq_wake+0x9c/0xf8()
>      Unbalanced IRQ 113 wake disable
>
> This happens because no_irq_chip and dummy_irq_chip do not implement
> irq_chip.irq_set_wake(), causing set_irq_wake_real() to return -ENXIO,
> and irq_set_irq_wake() to reset the wake_depth to zero.
>
> Set IRQCHIP_SKIP_SET_WAKE to indicate that irq_chip.irq_set_wake() is
> not implemented.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> Alternatively, can't we remove IRQCHIP_SKIP_SET_WAKE, and just check for
> the presence of irq_chip.irq_set_wake()?
> I'll be happy to send a patch to do that instead...
>
> Is there anything that relies on this -ENXIO error code?
> All irq_chip implementations that set IRQCHIP_SKIP_SET_WAKE do not
> implement irq_chip.irq_set_wake(). There are probably more of them that
> forgot to set IRQCHIP_SKIP_SET_WAKE though.
> Am I missing something?
> Commit 60f96b41f71d2a13 ("genirq: Add IRQCHIP_SKIP_SET_WAKE flag")
> doesn't explain why adding the flag was chosen.
>
The flag was added to avoid dummy irq_set_wake() implementation
as described in the commit.

------------------
commit 60f96b41f71d2a13d1c0a457b8b77958f77142d1
Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
Date:   Fri Sep 9 13:59:35 2011 +0530

     genirq: Add IRQCHIP_SKIP_SET_WAKE flag

     Some irq chips need the irq_set_wake() functionality, but do not
     require a irq_set_wake() callback. Instead of forcing an empty
     callback to be implemented add a flag which notes this fact. Check for
     the flag in set_irq_wake_real() and return success when set.

     Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
     Cc: Thomas Gleixner <tglx@linutronix.de>
------------------

Here is the relevant thread.
http://lists.infradead.org/pipermail/linux-arm-kernel/2011-September/064590.html

As you can read from thread, the idea is to handle the need at
genirq level. Either with a flag or a dummy function.

Hope this helps.

Regards,
Santosh

WARNING: multiple messages have this Message-ID (diff)
From: santosh shilimkar <santosh.shilimkar@oracle.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: Santosh Shilimkar <ssantosh@kernel.org>,
	linux-gpio@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH resend 2/2] [RFC] genirq: Set IRQCHIP_SKIP_SET_WAKE for no_irq_chip and dummy_irq_chip
Date: Mon, 12 Jan 2015 16:37:29 +0000	[thread overview]
Message-ID: <54B3F849.30001@oracle.com> (raw)
In-Reply-To: <1421078671-5920-2-git-send-email-geert+renesas@glider.be>

On 1/12/2015 8:04 AM, Geert Uytterhoeven wrote:
> If no_irq_chip or dummy_irq_chip are used for wake up (e.g. gpio-keys
> with a simple GPIO controller), the following warning is printed on
> resume from s2ram:
>
>      WANING: CPU: 0 PID: 1046 at kernel/irq/manage.c:537 irq_set_irq_wake+0x9c/0xf8()
>      Unbalanced IRQ 113 wake disable
>
> This happens because no_irq_chip and dummy_irq_chip do not implement
> irq_chip.irq_set_wake(), causing set_irq_wake_real() to return -ENXIO,
> and irq_set_irq_wake() to reset the wake_depth to zero.
>
> Set IRQCHIP_SKIP_SET_WAKE to indicate that irq_chip.irq_set_wake() is
> not implemented.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> Alternatively, can't we remove IRQCHIP_SKIP_SET_WAKE, and just check for
> the presence of irq_chip.irq_set_wake()?
> I'll be happy to send a patch to do that instead...
>
> Is there anything that relies on this -ENXIO error code?
> All irq_chip implementations that set IRQCHIP_SKIP_SET_WAKE do not
> implement irq_chip.irq_set_wake(). There are probably more of them that
> forgot to set IRQCHIP_SKIP_SET_WAKE though.
> Am I missing something?
> Commit 60f96b41f71d2a13 ("genirq: Add IRQCHIP_SKIP_SET_WAKE flag")
> doesn't explain why adding the flag was chosen.
>
The flag was added to avoid dummy irq_set_wake() implementation
as described in the commit.

------------------
commit 60f96b41f71d2a13d1c0a457b8b77958f77142d1
Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
Date:   Fri Sep 9 13:59:35 2011 +0530

     genirq: Add IRQCHIP_SKIP_SET_WAKE flag

     Some irq chips need the irq_set_wake() functionality, but do not
     require a irq_set_wake() callback. Instead of forcing an empty
     callback to be implemented add a flag which notes this fact. Check for
     the flag in set_irq_wake_real() and return success when set.

     Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
     Cc: Thomas Gleixner <tglx@linutronix.de>
------------------

Here is the relevant thread.
http://lists.infradead.org/pipermail/linux-arm-kernel/2011-September/064590.html

As you can read from thread, the idea is to handle the need at
genirq level. Either with a flag or a dummy function.

Hope this helps.

Regards,
Santosh


  reply	other threads:[~2015-01-12 16:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-12 16:04 [PATCH resend 1/2] gpio: pcf857x: Propagate wake-up setting to parent irq controller Geert Uytterhoeven
2015-01-12 16:04 ` Geert Uytterhoeven
2015-01-12 16:04 ` [PATCH resend 2/2] [RFC] genirq: Set IRQCHIP_SKIP_SET_WAKE for no_irq_chip and dummy_irq_chip Geert Uytterhoeven
2015-01-12 16:04   ` Geert Uytterhoeven
2015-01-12 16:37   ` santosh shilimkar [this message]
2015-01-12 16:37     ` santosh shilimkar
2015-01-12 17:32     ` Geert Uytterhoeven
2015-01-12 17:32       ` Geert Uytterhoeven

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=54B3F849.30001@oracle.com \
    --to=santosh.shilimkar@oracle.com \
    --cc=geert+renesas@glider.be \
    --cc=gnurou@gmail.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=ssantosh@kernel.org \
    --cc=tglx@linutronix.de \
    /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.