[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdUkEpo4qPZe271H1=nBHRhKkKy5X70s9OSqxACxT3HJxw@mail.gmail.com>
Date: Tue, 8 Apr 2025 20:10:06 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>, Jiri Slaby <jirislaby@...nel.org>,
Andrew Lunn <andrew@...n.ch>, Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
Gregory Clement <gregory.clement@...tlin.com>, Uwe Kleine-König <ukleinek@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>, Bartosz Golaszewski <brgl@...ev.pl>,
Talel Shenhar <talel@...zon.com>, Nicolas Ferre <nicolas.ferre@...rochip.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>, Claudiu Beznea <claudiu.beznea@...on.dev>,
Florian Fainelli <florian.fainelli@...adcom.com>, Guo Ren <guoren@...nel.org>,
Herve Codina <herve.codina@...tlin.com>, Huacai Chen <chenhuacai@...nel.org>,
Jiaxun Yang <jiaxun.yang@...goat.com>, Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>, Chen-Yu Tsai <wens@...e.org>,
Jernej Skrabec <jernej.skrabec@...il.com>, Samuel Holland <samuel@...lland.org>
Subject: Re: [patch 2/7] genirq/generic-chip: Convert core code to lock guards
Hi Thomas,
On Thu, 13 Mar 2025 at 15:37, Thomas Gleixner <tglx@...utronix.de> wrote:
> Replace the irq_gc_lock/unlock() pairs with guards. There is no point to
> implement a guard wrapper for them as they just wrap around raw_spin_lock*().
>
> Switch the other lock instances in the core code to guards as well.
>
> Conversion was done with Coccinelle plus manual fixups.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Thanks for your patch, which is now commit 195298c3b11628a6
("genirq/generic-chip: Convert core code to lock guards") in
irqchip/irq/drivers.
> --- a/kernel/irq/generic-chip.c
> +++ b/kernel/irq/generic-chip.c
> @@ -340,9 +330,8 @@ int irq_domain_alloc_generic_chips(struc
> goto err;
> }
>
> - raw_spin_lock_irqsave(&gc_lock, flags);
> - list_add_tail(&gc->list, &gc_list);
> - raw_spin_unlock_irqrestore(&gc_lock, flags);
> + scoped_guard (raw_spinlock, &gc_lock)
> + list_add_tail(&gc->list, &gc_list);
> /* Calc pointer to the next generic chip */
> tmp += gc_sz;
> }
> @@ -459,7 +448,6 @@ int irq_map_generic_chip(struct irq_doma
> struct irq_chip_generic *gc;
> struct irq_chip_type *ct;
> struct irq_chip *chip;
> - unsigned long flags;
> int idx;
>
> gc = __irq_get_domain_generic_chip(d, hw_irq);
> @@ -479,9 +467,8 @@ int irq_map_generic_chip(struct irq_doma
>
> /* We only init the cache for the first mapping of a generic chip */
> if (!gc->installed) {
> - raw_spin_lock_irqsave(&gc->lock, flags);
> + guard(raw_spinlock_irq)(&gc->lock);
> irq_gc_init_mask_cache(gc, dgc->gc_flags);
> - raw_spin_unlock_irqrestore(&gc->lock, flags);
> }
>
> /* Mark the interrupt as installed */
These two conversions are wrong. I have sent a patch:
https://lore.kernel.org/514f94c5891c61ac0a4a7fdad113e75db1eea367.1744135467.git.geert+renesas@glider.be
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-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
Powered by blists - more mailing lists