Re: [patch 2.6.25-rc3] lockdep: add spin_lock_irq_nested()
From: David Brownell
Date: Mon Feb 25 2008 - 17:33:50 EST
> So I'm think that the reason this only _changes_ the false
> recursion notification ...
Whoops, it's because of the following typo:
> --- a/arch/arm/plat-omap/gpio.c 2008-02-24 19:02:32.000000000 -0800
> +++ b/arch/arm/plat-omap/gpio.c 2008-02-25 10:54:29.000000000 -0800
> @@ -1332,6 +1332,28 @@ static struct clk *gpio_fclks[OMAP34XX_N
> static struct clk *gpio_iclks[OMAP34XX_NR_GPIOS];
> #endif
>
> +#ifdef CONFIG_LOCKDEP
> +
> +/* tell lockdep that this IRQ's locks and its parent's locks are in
> + * different categories, so that it won't detect false recursion.
> + */
> +static struct lock_class_key gpio_lock_class;
> +
> +static inline void mark_gpio_locking(unsigned gpio_irq)
> +{
> + lockdep_set_class(&irq_desc[gpio_irq].lock, &gpio_lock_class);
> +}
> +
> +#else
> +
> +static inline void mark_gpio_locking(unsigned gpio_irq)
> +{
> + /* NOP */
> +}
> +
> +#endif
> +
> +
> static int __init _omap_gpio_init(void)
> {
> int i;
> @@ -1532,6 +1554,7 @@ static int __init _omap_gpio_init(void)
> set_irq_chip(j, &gpio_irq_chip);
> set_irq_handler(j, handle_simple_irq);
> set_irq_flags(j, IRQF_VALID);
> + mark_gpio_locking(i);
should be mark_gpio_locking(j).
That's an off-by-one error in ASCII or QWERTY (adjacency), and
in terms of typefaces it's a few pixels. Sigh.
Since that seems to behave, I'll send along a couple patches
like this ... unless you say this isn't really, after all, the
right way to address this problem. Note that neither IRQ has
ever been triggered at this point ... I'll move the marking up
a bit to ensure the lock has never been taken either.
- Dave
> }
> set_irq_chained_handler(bank->irq, gpio_irq_handler);
> set_irq_data(bank->irq, bank);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/