All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Douglas Anderson <dianders@chromium.org>,
	Tsai Sung-Fu <danielsftsai@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] genirq: Retain disable depth across irq shutdown/startup
Date: Wed, 14 May 2025 13:16:35 -0700	[thread overview]
Message-ID: <aCT6I5dhx5-xluOo@google.com> (raw)
In-Reply-To: <877c2jk5ka.ffs@tglx>

Hi Thomas,

On Wed, May 14, 2025 at 09:35:49AM +0200, Thomas Gleixner wrote:
> On Tue, May 13 2025 at 15:42, Brian Norris wrote:
> > @@ -272,7 +272,9 @@ int irq_startup(struct irq_desc *desc, bool resend, bool force)
> >  	const struct cpumask *aff = irq_data_get_affinity_mask(d);
> >  	int ret = 0;
> >  
> > -	desc->depth = 0;
> > +	desc->depth--;
> > +	if (desc->depth)
> > +		return 0;
> 
> This breaks a
> 
>      request_irq()
>      disable_irq()
>      free_irq()
>      request_irq()
> 
> sequence.

Ah, thanks for the callout. I factored that into another unit test in
v2.

> So the only case where the disable depth needs to be preserved is for
> managed interrupts in the hotunplug -> shutdown -> hotplug -> startup
> scenario. Making that explicit avoids chasing all other places and
> sprinkle desc->depth = 1 into them. Something like the uncompiled below
> should do the trick.

Seems reasonable, and it works for me. I've incorporated that in v2,
although I'm not sure how the attribution should work there.

Thanks,
Brian

      reply	other threads:[~2025-05-14 20:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13 22:42 [PATCH 0/2] genirq: Retain disable-depth across irq_{shutdown,startup}() Brian Norris
2025-05-13 22:42 ` [PATCH 1/2] genirq: Add kunit tests for depth counts Brian Norris
2025-05-14 15:16   ` kernel test robot
2025-05-14 15:27   ` kernel test robot
2025-05-14 18:05   ` kernel test robot
2025-05-13 22:42 ` [PATCH 2/2] genirq: Retain disable depth across irq shutdown/startup Brian Norris
2025-05-14  7:35   ` Thomas Gleixner
2025-05-14 20:16     ` Brian Norris [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=aCT6I5dhx5-xluOo@google.com \
    --to=briannorris@chromium.org \
    --cc=danielsftsai@google.com \
    --cc=dianders@chromium.org \
    --cc=linux-kernel@vger.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.