linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Valentin Schneider <valentin.schneider@arm.com>
To: Marc Zyngier <maz@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Jason Cooper <jason@lakedaemon.net>
Subject: Re: [RFC PATCH] irqchip/gic: Implement irq_chip->irq_retrigger()
Date: Fri, 10 Jul 2020 18:08:01 +0100	[thread overview]
Message-ID: <jhjr1tjl2mm.mognet@arm.com> (raw)
In-Reply-To: <87tuyfxria.wl-maz@kernel.org>


On 10/07/20 17:29, Marc Zyngier wrote:
> On Fri, 10 Jul 2020 15:56:42 +0100,
> Valentin Schneider <valentin.schneider@arm.com> wrote:

[...]

>> Implement irq_chip.irq_retrigger() for both GICs.
>
> Although I am very grateful for the whole documentation, I'd rather
> have a slightly more condensed changelog that documents the
> implementation of the retrigger callback! ;-)
>

Hah, indeed! I was relatively unsure about that whole thing, hence why I
sent it as RFC with a wall of text attached. I'll probably strip out the
GIC doc snippets for the "actual" changelog, and talk about the *contents*
of the patch some more.

>>
>> Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
>> ---
>>  drivers/irqchip/irq-gic-v3.c | 7 +++++++
>>  drivers/irqchip/irq-gic.c    | 6 ++++++
>>  2 files changed, 13 insertions(+)
>>
>> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
>> index cc46bc2d634b..c025e8b51464 100644
>> --- a/drivers/irqchip/irq-gic-v3.c
>> +++ b/drivers/irqchip/irq-gic-v3.c
>> @@ -1207,6 +1207,11 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
>>  #define gic_smp_init()		do { } while(0)
>>  #endif
>>
>> +static int gic_retrigger(struct irq_data *data)
>> +{
>> +	return gic_irq_set_irqchip_state(data, IRQCHIP_STATE_PENDING, true);
>
> If I'm not mistaken, check_irq_resend() requires a non-zero return
> value if the retrigger has succeeded. So something like
>
>       return !gic_irq_set_irqchip_state(data, IRQCHIP_STATE_PENDING, true);
>
> would be more appropriate.
>

Aye, you're right. And while we're at it, we probably still don't want to
fallback to irq_sw_resend() if the retrigger fails, so we should add some
irqd_set_handle_enforce_irqctx() somewhere in the GICs or plainly deselect
CONFIG_HARDIRQS_SW_RESEND.

I'm not very familiar with LPIs just yet, but seeing as they too use
handle_fasteoi_irq() and can't get retriggered, I'd rather play it safe.


This brings me to another point: while this boots just
fine, I didn't get to test out IRQs marked with IRQS_PENDING. IIUC
enable_irq_wake() should give me a decent trail - I see serial_core making
use of it. I'll go give suspend a try.

> Otherwise, looks good.
>

Thanks for having a look!

> Thanks,
>
>       M.

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

      reply	other threads:[~2020-07-10 17:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 14:56 [RFC PATCH] irqchip/gic: Implement irq_chip->irq_retrigger() Valentin Schneider
2020-07-10 16:29 ` Marc Zyngier
2020-07-10 17:08   ` Valentin Schneider [this message]

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=jhjr1tjl2mm.mognet@arm.com \
    --to=valentin.schneider@arm.com \
    --cc=Lorenzo.Pieralisi@arm.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@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 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).