Skip to content

Commit 3525f55

Browse files
bebarinoLinus Walleij
authored andcommitted
pinctrl: msm: Silence recursive lockdep warning
If a driver calls enable_irq_wake() on a gpio turned interrupt from the msm pinctrl driver we'll get a lockdep warning like so: ============================================= [ INFO: possible recursive locking detected ] 3.14.0-rc3 #2 Not tainted --------------------------------------------- modprobe/52 is trying to acquire lock: (&irq_desc_lock_class){-.....}, at: [<c026aea0>] __irq_get_desc_lock+0x48/0x88 but task is already holding lock: (&irq_desc_lock_class){-.....}, at: [<c026aea0>] __irq_get_desc_lock+0x48/0x88 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&irq_desc_lock_class); lock(&irq_desc_lock_class); *** DEADLOCK *** May be due to missing lock nesting notation 4 locks held by modprobe/52: #0: (&__lockdep_no_validate__){......}, at: [<c04f2864>] __driver_attach+0x48/0x98 #1: (&__lockdep_no_validate__){......}, at: [<c04f2874>] __driver_attach+0x58/0x98 #2: (&irq_desc_lock_class){-.....}, at: [<c026aea0>] __irq_get_desc_lock+0x48/0x88 #3: (&(&pctrl->lock)->rlock){......}, at: [<c04bb4b8>] msm_gpio_irq_set_wake+0x20/0xa8 Silence it by putting the gpios into their own lock class. Signed-off-by: Stephen Boyd <[email protected]> Acked-by: Bjorn Andersson <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent 3c7d563 commit 3525f55

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/pinctrl/pinctrl-msm.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,12 @@ static void msm_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
884884
chained_irq_exit(chip, desc);
885885
}
886886

887+
/*
888+
* This lock class tells lockdep that GPIO irqs are in a different
889+
* category than their parents, so it won't report false recursion.
890+
*/
891+
static struct lock_class_key gpio_lock_class;
892+
887893
static int msm_gpio_init(struct msm_pinctrl *pctrl)
888894
{
889895
struct gpio_chip *chip;
@@ -922,6 +928,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
922928

923929
for (i = 0; i < chip->ngpio; i++) {
924930
irq = irq_create_mapping(pctrl->domain, i);
931+
irq_set_lockdep_class(irq, &gpio_lock_class);
925932
irq_set_chip_and_handler(irq, &msm_gpio_irq_chip, handle_edge_irq);
926933
irq_set_chip_data(irq, pctrl);
927934
}

0 commit comments

Comments
 (0)