All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Stephen Boyd <swboyd@chromium.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Lina Iyer <ilina@codeaurora.org>
Subject: Re: [PATCH v2] genirq: Respect IRQCHIP_SKIP_SET_WAKE in irq_chip_set_wake_parent()
Date: Tue, 26 Mar 2019 11:11:56 +0000	[thread overview]
Message-ID: <f53f4556-72f1-051b-0dbe-f1789521233e@arm.com> (raw)
In-Reply-To: <20190325181026.247796-1-swboyd@chromium.org>

Hi Stephen,

On 25/03/2019 18:10, Stephen Boyd wrote:
> This function returns an error if a child irqchip calls
> irq_chip_set_wake_parent() but its parent irqchip has the
> IRQCHIP_SKIP_SET_WAKE flag set. Let's return 0 for success here instead
> because there isn't anything to do.
> 
> This keeps the behavior consistent with how set_irq_wake_real() is
> implemented. That function returns 0 when the irqchip has the
> IRQCHIP_SKIP_SET_WAKE flag set. It doesn't attempt to walk the chain of
> parents and set irq wake on any chips that don't have the flag set
> either. If the intent is to call the .irq_set_wake() callback of the
> parent irqchip, then we expect irqchip implementations to omit the
> IRQCHIP_SKIP_SET_WAKE flag and implement an .irq_set_wake() function
> that calls irq_chip_set_wake_parent().
> 
> This fixes a problem on my Qualcomm sdm845 device where I can't set wake
> on any GPIO interrupts after I apply work in progress wakeup irq patches
> to the GPIO driver. The chain of chips looks like this:
> 
>  ARM GIC (skip) -> QCOM PDC (skip) -> QCOM GPIO

nit: the parenting chain is actually built the other way around (we
don't express the 'child' relationship). This doesn't change anything to
the patch, but would make the reasoning a but easier to understand.

> 
> The GPIO controller is a child of the QCOM PDC irqchip which is a child
> of the ARM GIC irqchip. The QCOM PDC irqchip has the
> IRQCHIP_SKIP_SET_WAKE flag set, and so does the grandparent ARM GIC.
> 
> The GPIO driver doesn't know if the parent needs to set wake or not, so
> it unconditionally calls irq_chip_set_wake_parent() causing this
> function to return a failure because the parent irqchip (PDC) doesn't
> have the .irq_set_wake() callback set. Returning 0 instead makes
> everything work and irqs from the GPIO controller can be configured for
> wakeup.
> 
> Cc: Lina Iyer <ilina@codeaurora.org>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>

Fixes: 08b55e2a9208e ("genirq: Add irqchip_set_wake_parent")
Acked-by: Marc Zyngier <marc.zyngier@arm.com>

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <marc.zyngier@arm.com>
To: Stephen Boyd <swboyd@chromium.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org,
	Lina Iyer <ilina@codeaurora.org>
Subject: Re: [PATCH v2] genirq: Respect IRQCHIP_SKIP_SET_WAKE in irq_chip_set_wake_parent()
Date: Tue, 26 Mar 2019 11:11:56 +0000	[thread overview]
Message-ID: <f53f4556-72f1-051b-0dbe-f1789521233e@arm.com> (raw)
In-Reply-To: <20190325181026.247796-1-swboyd@chromium.org>

Hi Stephen,

On 25/03/2019 18:10, Stephen Boyd wrote:
> This function returns an error if a child irqchip calls
> irq_chip_set_wake_parent() but its parent irqchip has the
> IRQCHIP_SKIP_SET_WAKE flag set. Let's return 0 for success here instead
> because there isn't anything to do.
> 
> This keeps the behavior consistent with how set_irq_wake_real() is
> implemented. That function returns 0 when the irqchip has the
> IRQCHIP_SKIP_SET_WAKE flag set. It doesn't attempt to walk the chain of
> parents and set irq wake on any chips that don't have the flag set
> either. If the intent is to call the .irq_set_wake() callback of the
> parent irqchip, then we expect irqchip implementations to omit the
> IRQCHIP_SKIP_SET_WAKE flag and implement an .irq_set_wake() function
> that calls irq_chip_set_wake_parent().
> 
> This fixes a problem on my Qualcomm sdm845 device where I can't set wake
> on any GPIO interrupts after I apply work in progress wakeup irq patches
> to the GPIO driver. The chain of chips looks like this:
> 
>  ARM GIC (skip) -> QCOM PDC (skip) -> QCOM GPIO

nit: the parenting chain is actually built the other way around (we
don't express the 'child' relationship). This doesn't change anything to
the patch, but would make the reasoning a but easier to understand.

> 
> The GPIO controller is a child of the QCOM PDC irqchip which is a child
> of the ARM GIC irqchip. The QCOM PDC irqchip has the
> IRQCHIP_SKIP_SET_WAKE flag set, and so does the grandparent ARM GIC.
> 
> The GPIO driver doesn't know if the parent needs to set wake or not, so
> it unconditionally calls irq_chip_set_wake_parent() causing this
> function to return a failure because the parent irqchip (PDC) doesn't
> have the .irq_set_wake() callback set. Returning 0 instead makes
> everything work and irqs from the GPIO controller can be configured for
> wakeup.
> 
> Cc: Lina Iyer <ilina@codeaurora.org>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>

Fixes: 08b55e2a9208e ("genirq: Add irqchip_set_wake_parent")
Acked-by: Marc Zyngier <marc.zyngier@arm.com>

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <marc.zyngier@arm.com>
To: Stephen Boyd <swboyd@chromium.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Lina Iyer <ilina@codeaurora.org>
Subject: Re: [PATCH v2] genirq: Respect IRQCHIP_SKIP_SET_WAKE in irq_chip_set_wake_parent()
Date: Tue, 26 Mar 2019 11:11:56 +0000	[thread overview]
Message-ID: <f53f4556-72f1-051b-0dbe-f1789521233e@arm.com> (raw)
In-Reply-To: <20190325181026.247796-1-swboyd@chromium.org>

Hi Stephen,

On 25/03/2019 18:10, Stephen Boyd wrote:
> This function returns an error if a child irqchip calls
> irq_chip_set_wake_parent() but its parent irqchip has the
> IRQCHIP_SKIP_SET_WAKE flag set. Let's return 0 for success here instead
> because there isn't anything to do.
> 
> This keeps the behavior consistent with how set_irq_wake_real() is
> implemented. That function returns 0 when the irqchip has the
> IRQCHIP_SKIP_SET_WAKE flag set. It doesn't attempt to walk the chain of
> parents and set irq wake on any chips that don't have the flag set
> either. If the intent is to call the .irq_set_wake() callback of the
> parent irqchip, then we expect irqchip implementations to omit the
> IRQCHIP_SKIP_SET_WAKE flag and implement an .irq_set_wake() function
> that calls irq_chip_set_wake_parent().
> 
> This fixes a problem on my Qualcomm sdm845 device where I can't set wake
> on any GPIO interrupts after I apply work in progress wakeup irq patches
> to the GPIO driver. The chain of chips looks like this:
> 
>  ARM GIC (skip) -> QCOM PDC (skip) -> QCOM GPIO

nit: the parenting chain is actually built the other way around (we
don't express the 'child' relationship). This doesn't change anything to
the patch, but would make the reasoning a but easier to understand.

> 
> The GPIO controller is a child of the QCOM PDC irqchip which is a child
> of the ARM GIC irqchip. The QCOM PDC irqchip has the
> IRQCHIP_SKIP_SET_WAKE flag set, and so does the grandparent ARM GIC.
> 
> The GPIO driver doesn't know if the parent needs to set wake or not, so
> it unconditionally calls irq_chip_set_wake_parent() causing this
> function to return a failure because the parent irqchip (PDC) doesn't
> have the .irq_set_wake() callback set. Returning 0 instead makes
> everything work and irqs from the GPIO controller can be configured for
> wakeup.
> 
> Cc: Lina Iyer <ilina@codeaurora.org>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>

Fixes: 08b55e2a9208e ("genirq: Add irqchip_set_wake_parent")
Acked-by: Marc Zyngier <marc.zyngier@arm.com>

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-03-26 11:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-25 18:10 [PATCH v2] genirq: Respect IRQCHIP_SKIP_SET_WAKE in irq_chip_set_wake_parent() Stephen Boyd
2019-03-25 18:10 ` Stephen Boyd
2019-03-26 11:11 ` Marc Zyngier [this message]
2019-03-26 11:11   ` Marc Zyngier
2019-03-26 11:11   ` Marc Zyngier
2019-03-26 16:58   ` Stephen Boyd
2019-03-26 16:58     ` Stephen Boyd
2019-04-05 15:46 ` [tip:irq/urgent] " tip-bot for Stephen Boyd

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=f53f4556-72f1-051b-0dbe-f1789521233e@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=ilina@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swboyd@chromium.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.