diff options
author | Andrew Lunn <andrew@lunn.ch> | 2017-12-02 12:11:04 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-12-28 06:26:35 -0500 |
commit | 39c3fd58952d7599d367c84c1330b785d91d6088 (patch) | |
tree | 156853f464f0148928514478abf3aeca86e30397 /drivers | |
parent | beacbc68ac3e23821a681adb30b45dc55b17488d (diff) |
kernel/irq: Extend lockdep class for request mutex
The IRQ code already has support for lockdep class for the lock mutex
in an interrupt descriptor. Extend this to add a second class for the
request mutex in the descriptor. Not having a class is resulting in
false positive splats in some code paths.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: linus.walleij@linaro.org
Cc: grygorii.strashko@ti.com
Cc: f.fainelli@gmail.com
Link: https://lkml.kernel.org/r/1512234664-21555-1-git-send-email-andrew@lunn.ch
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpio/gpio-bcm-kona.c | 3 | ||||
-rw-r--r-- | drivers/gpio/gpio-brcmstb.c | 4 | ||||
-rw-r--r-- | drivers/gpio/gpio-tegra.c | 4 | ||||
-rw-r--r-- | drivers/gpio/gpiolib.c | 27 | ||||
-rw-r--r-- | drivers/irqchip/irq-renesas-intc-irqpin.c | 6 | ||||
-rw-r--r-- | drivers/mfd/arizona-irq.c | 4 | ||||
-rw-r--r-- | drivers/pinctrl/pinctrl-single.c | 5 |
7 files changed, 38 insertions, 15 deletions
diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c index dfcf56ee3c61..76861a00bb92 100644 --- a/drivers/gpio/gpio-bcm-kona.c +++ b/drivers/gpio/gpio-bcm-kona.c | |||
@@ -522,6 +522,7 @@ static struct of_device_id const bcm_kona_gpio_of_match[] = { | |||
522 | * category than their parents, so it won't report false recursion. | 522 | * category than their parents, so it won't report false recursion. |
523 | */ | 523 | */ |
524 | static struct lock_class_key gpio_lock_class; | 524 | static struct lock_class_key gpio_lock_class; |
525 | static struct lock_class_key gpio_request_class; | ||
525 | 526 | ||
526 | static int bcm_kona_gpio_irq_map(struct irq_domain *d, unsigned int irq, | 527 | static int bcm_kona_gpio_irq_map(struct irq_domain *d, unsigned int irq, |
527 | irq_hw_number_t hwirq) | 528 | irq_hw_number_t hwirq) |
@@ -531,7 +532,7 @@ static int bcm_kona_gpio_irq_map(struct irq_domain *d, unsigned int irq, | |||
531 | ret = irq_set_chip_data(irq, d->host_data); | 532 | ret = irq_set_chip_data(irq, d->host_data); |
532 | if (ret < 0) | 533 | if (ret < 0) |
533 | return ret; | 534 | return ret; |
534 | irq_set_lockdep_class(irq, &gpio_lock_class); | 535 | irq_set_lockdep_class(irq, &gpio_lock_class, &gpio_request_class); |
535 | irq_set_chip_and_handler(irq, &bcm_gpio_irq_chip, handle_simple_irq); | 536 | irq_set_chip_and_handler(irq, &bcm_gpio_irq_chip, handle_simple_irq); |
536 | irq_set_noprobe(irq); | 537 | irq_set_noprobe(irq); |
537 | 538 | ||
diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c index 545d43a587b7..5b24801bffef 100644 --- a/drivers/gpio/gpio-brcmstb.c +++ b/drivers/gpio/gpio-brcmstb.c | |||
@@ -327,6 +327,7 @@ static struct brcmstb_gpio_bank *brcmstb_gpio_hwirq_to_bank( | |||
327 | * category than their parents, so it won't report false recursion. | 327 | * category than their parents, so it won't report false recursion. |
328 | */ | 328 | */ |
329 | static struct lock_class_key brcmstb_gpio_irq_lock_class; | 329 | static struct lock_class_key brcmstb_gpio_irq_lock_class; |
330 | static struct lock_class_key brcmstb_gpio_irq_request_class; | ||
330 | 331 | ||
331 | 332 | ||
332 | static int brcmstb_gpio_irq_map(struct irq_domain *d, unsigned int irq, | 333 | static int brcmstb_gpio_irq_map(struct irq_domain *d, unsigned int irq, |
@@ -346,7 +347,8 @@ static int brcmstb_gpio_irq_map(struct irq_domain *d, unsigned int irq, | |||
346 | ret = irq_set_chip_data(irq, &bank->gc); | 347 | ret = irq_set_chip_data(irq, &bank->gc); |
347 | if (ret < 0) | 348 | if (ret < 0) |
348 | return ret; | 349 | return ret; |
349 | irq_set_lockdep_class(irq, &brcmstb_gpio_irq_lock_class); | 350 | irq_set_lockdep_class(irq, &brcmstb_gpio_irq_lock_class, |
351 | &brcmstb_gpio_irq_lock_class); | ||
350 | irq_set_chip_and_handler(irq, &priv->irq_chip, handle_level_irq); | 352 | irq_set_chip_and_handler(irq, &priv->irq_chip, handle_level_irq); |
351 | irq_set_noprobe(irq); | 353 | irq_set_noprobe(irq); |
352 | return 0; | 354 | return 0; |
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 8db47f671708..02fa8fe2292a 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c | |||
@@ -565,6 +565,7 @@ static const struct dev_pm_ops tegra_gpio_pm_ops = { | |||
565 | * than their parents, so it won't report false recursion. | 565 | * than their parents, so it won't report false recursion. |
566 | */ | 566 | */ |
567 | static struct lock_class_key gpio_lock_class; | 567 | static struct lock_class_key gpio_lock_class; |
568 | static struct lock_class_key gpio_request_class; | ||
568 | 569 | ||
569 | static int tegra_gpio_probe(struct platform_device *pdev) | 570 | static int tegra_gpio_probe(struct platform_device *pdev) |
570 | { | 571 | { |
@@ -670,7 +671,8 @@ static int tegra_gpio_probe(struct platform_device *pdev) | |||
670 | 671 | ||
671 | bank = &tgi->bank_info[GPIO_BANK(gpio)]; | 672 | bank = &tgi->bank_info[GPIO_BANK(gpio)]; |
672 | 673 | ||
673 | irq_set_lockdep_class(irq, &gpio_lock_class); | 674 | irq_set_lockdep_class(irq, &gpio_lock_class, |
675 | &gpio_request_class); | ||
674 | irq_set_chip_data(irq, bank); | 676 | irq_set_chip_data(irq, bank); |
675 | irq_set_chip_and_handler(irq, &tgi->ic, handle_simple_irq); | 677 | irq_set_chip_and_handler(irq, &tgi->ic, handle_simple_irq); |
676 | } | 678 | } |
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index aad84a6306c4..44332b793718 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -73,7 +73,8 @@ LIST_HEAD(gpio_devices); | |||
73 | 73 | ||
74 | static void gpiochip_free_hogs(struct gpio_chip *chip); | 74 | static void gpiochip_free_hogs(struct gpio_chip *chip); |
75 | static int gpiochip_add_irqchip(struct gpio_chip *gpiochip, | 75 | static int gpiochip_add_irqchip(struct gpio_chip *gpiochip, |
76 | struct lock_class_key *key); | 76 | struct lock_class_key *lock_key, |
77 | struct lock_class_key *request_key); | ||
77 | static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip); | 78 | static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip); |
78 | static int gpiochip_irqchip_init_valid_mask(struct gpio_chip *gpiochip); | 79 | static int gpiochip_irqchip_init_valid_mask(struct gpio_chip *gpiochip); |
79 | static void gpiochip_irqchip_free_valid_mask(struct gpio_chip *gpiochip); | 80 | static void gpiochip_irqchip_free_valid_mask(struct gpio_chip *gpiochip); |
@@ -1100,7 +1101,8 @@ static void gpiochip_setup_devs(void) | |||
1100 | } | 1101 | } |
1101 | 1102 | ||
1102 | int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, | 1103 | int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, |
1103 | struct lock_class_key *key) | 1104 | struct lock_class_key *lock_key, |
1105 | struct lock_class_key *request_key) | ||
1104 | { | 1106 | { |
1105 | unsigned long flags; | 1107 | unsigned long flags; |
1106 | int status = 0; | 1108 | int status = 0; |
@@ -1246,7 +1248,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, | |||
1246 | if (status) | 1248 | if (status) |
1247 | goto err_remove_from_list; | 1249 | goto err_remove_from_list; |
1248 | 1250 | ||
1249 | status = gpiochip_add_irqchip(chip, key); | 1251 | status = gpiochip_add_irqchip(chip, lock_key, request_key); |
1250 | if (status) | 1252 | if (status) |
1251 | goto err_remove_chip; | 1253 | goto err_remove_chip; |
1252 | 1254 | ||
@@ -1632,7 +1634,7 @@ int gpiochip_irq_map(struct irq_domain *d, unsigned int irq, | |||
1632 | * This lock class tells lockdep that GPIO irqs are in a different | 1634 | * This lock class tells lockdep that GPIO irqs are in a different |
1633 | * category than their parents, so it won't report false recursion. | 1635 | * category than their parents, so it won't report false recursion. |
1634 | */ | 1636 | */ |
1635 | irq_set_lockdep_class(irq, chip->irq.lock_key); | 1637 | irq_set_lockdep_class(irq, chip->irq.lock_key, chip->irq.request_key); |
1636 | irq_set_chip_and_handler(irq, chip->irq.chip, chip->irq.handler); | 1638 | irq_set_chip_and_handler(irq, chip->irq.chip, chip->irq.handler); |
1637 | /* Chips that use nested thread handlers have them marked */ | 1639 | /* Chips that use nested thread handlers have them marked */ |
1638 | if (chip->irq.threaded) | 1640 | if (chip->irq.threaded) |
@@ -1712,10 +1714,12 @@ static int gpiochip_to_irq(struct gpio_chip *chip, unsigned offset) | |||
1712 | /** | 1714 | /** |
1713 | * gpiochip_add_irqchip() - adds an IRQ chip to a GPIO chip | 1715 | * gpiochip_add_irqchip() - adds an IRQ chip to a GPIO chip |
1714 | * @gpiochip: the GPIO chip to add the IRQ chip to | 1716 | * @gpiochip: the GPIO chip to add the IRQ chip to |
1715 | * @lock_key: lockdep class | 1717 | * @lock_key: lockdep class for IRQ lock |
1718 | * @request_key: lockdep class for IRQ request | ||
1716 | */ | 1719 | */ |
1717 | static int gpiochip_add_irqchip(struct gpio_chip *gpiochip, | 1720 | static int gpiochip_add_irqchip(struct gpio_chip *gpiochip, |
1718 | struct lock_class_key *lock_key) | 1721 | struct lock_class_key *lock_key, |
1722 | struct lock_class_key *request_key) | ||
1719 | { | 1723 | { |
1720 | struct irq_chip *irqchip = gpiochip->irq.chip; | 1724 | struct irq_chip *irqchip = gpiochip->irq.chip; |
1721 | const struct irq_domain_ops *ops; | 1725 | const struct irq_domain_ops *ops; |
@@ -1753,6 +1757,7 @@ static int gpiochip_add_irqchip(struct gpio_chip *gpiochip, | |||
1753 | gpiochip->to_irq = gpiochip_to_irq; | 1757 | gpiochip->to_irq = gpiochip_to_irq; |
1754 | gpiochip->irq.default_type = type; | 1758 | gpiochip->irq.default_type = type; |
1755 | gpiochip->irq.lock_key = lock_key; | 1759 | gpiochip->irq.lock_key = lock_key; |
1760 | gpiochip->irq.request_key = request_key; | ||
1756 | 1761 | ||
1757 | if (gpiochip->irq.domain_ops) | 1762 | if (gpiochip->irq.domain_ops) |
1758 | ops = gpiochip->irq.domain_ops; | 1763 | ops = gpiochip->irq.domain_ops; |
@@ -1850,7 +1855,8 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip) | |||
1850 | * @type: the default type for IRQs on this irqchip, pass IRQ_TYPE_NONE | 1855 | * @type: the default type for IRQs on this irqchip, pass IRQ_TYPE_NONE |
1851 | * to have the core avoid setting up any default type in the hardware. | 1856 | * to have the core avoid setting up any default type in the hardware. |
1852 | * @threaded: whether this irqchip uses a nested thread handler | 1857 | * @threaded: whether this irqchip uses a nested thread handler |
1853 | * @lock_key: lockdep class | 1858 | * @lock_key: lockdep class for IRQ lock |
1859 | * @request_key: lockdep class for IRQ request | ||
1854 | * | 1860 | * |
1855 | * This function closely associates a certain irqchip with a certain | 1861 | * This function closely associates a certain irqchip with a certain |
1856 | * gpiochip, providing an irq domain to translate the local IRQs to | 1862 | * gpiochip, providing an irq domain to translate the local IRQs to |
@@ -1872,7 +1878,8 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gpiochip, | |||
1872 | irq_flow_handler_t handler, | 1878 | irq_flow_handler_t handler, |
1873 | unsigned int type, | 1879 | unsigned int type, |
1874 | bool threaded, | 1880 | bool threaded, |
1875 | struct lock_class_key *lock_key) | 1881 | struct lock_class_key *lock_key, |
1882 | struct lock_class_key *request_key) | ||
1876 | { | 1883 | { |
1877 | struct device_node *of_node; | 1884 | struct device_node *of_node; |
1878 | 1885 | ||
@@ -1913,6 +1920,7 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gpiochip, | |||
1913 | gpiochip->irq.default_type = type; | 1920 | gpiochip->irq.default_type = type; |
1914 | gpiochip->to_irq = gpiochip_to_irq; | 1921 | gpiochip->to_irq = gpiochip_to_irq; |
1915 | gpiochip->irq.lock_key = lock_key; | 1922 | gpiochip->irq.lock_key = lock_key; |
1923 | gpiochip->irq.request_key = request_key; | ||
1916 | gpiochip->irq.domain = irq_domain_add_simple(of_node, | 1924 | gpiochip->irq.domain = irq_domain_add_simple(of_node, |
1917 | gpiochip->ngpio, first_irq, | 1925 | gpiochip->ngpio, first_irq, |
1918 | &gpiochip_domain_ops, gpiochip); | 1926 | &gpiochip_domain_ops, gpiochip); |
@@ -1940,7 +1948,8 @@ EXPORT_SYMBOL_GPL(gpiochip_irqchip_add_key); | |||
1940 | #else /* CONFIG_GPIOLIB_IRQCHIP */ | 1948 | #else /* CONFIG_GPIOLIB_IRQCHIP */ |
1941 | 1949 | ||
1942 | static inline int gpiochip_add_irqchip(struct gpio_chip *gpiochip, | 1950 | static inline int gpiochip_add_irqchip(struct gpio_chip *gpiochip, |
1943 | struct lock_class_key *key) | 1951 | struct lock_class_key *lock_key, |
1952 | struct lock_class_key *request_key) | ||
1944 | { | 1953 | { |
1945 | return 0; | 1954 | return 0; |
1946 | } | 1955 | } |
diff --git a/drivers/irqchip/irq-renesas-intc-irqpin.c b/drivers/irqchip/irq-renesas-intc-irqpin.c index 06f29cf5018a..cee59fe1321c 100644 --- a/drivers/irqchip/irq-renesas-intc-irqpin.c +++ b/drivers/irqchip/irq-renesas-intc-irqpin.c | |||
@@ -342,6 +342,9 @@ static irqreturn_t intc_irqpin_shared_irq_handler(int irq, void *dev_id) | |||
342 | */ | 342 | */ |
343 | static struct lock_class_key intc_irqpin_irq_lock_class; | 343 | static struct lock_class_key intc_irqpin_irq_lock_class; |
344 | 344 | ||
345 | /* And this is for the request mutex */ | ||
346 | static struct lock_class_key intc_irqpin_irq_request_class; | ||
347 | |||
345 | static int intc_irqpin_irq_domain_map(struct irq_domain *h, unsigned int virq, | 348 | static int intc_irqpin_irq_domain_map(struct irq_domain *h, unsigned int virq, |
346 | irq_hw_number_t hw) | 349 | irq_hw_number_t hw) |
347 | { | 350 | { |
@@ -352,7 +355,8 @@ static int intc_irqpin_irq_domain_map(struct irq_domain *h, unsigned int virq, | |||
352 | 355 | ||
353 | intc_irqpin_dbg(&p->irq[hw], "map"); | 356 | intc_irqpin_dbg(&p->irq[hw], "map"); |
354 | irq_set_chip_data(virq, h->host_data); | 357 | irq_set_chip_data(virq, h->host_data); |
355 | irq_set_lockdep_class(virq, &intc_irqpin_irq_lock_class); | 358 | irq_set_lockdep_class(virq, &intc_irqpin_irq_lock_class, |
359 | &intc_irqpin_irq_request_class); | ||
356 | irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq); | 360 | irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq); |
357 | return 0; | 361 | return 0; |
358 | } | 362 | } |
diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c index 09cf3699e354..a307832d7e45 100644 --- a/drivers/mfd/arizona-irq.c +++ b/drivers/mfd/arizona-irq.c | |||
@@ -184,6 +184,7 @@ static struct irq_chip arizona_irq_chip = { | |||
184 | }; | 184 | }; |
185 | 185 | ||
186 | static struct lock_class_key arizona_irq_lock_class; | 186 | static struct lock_class_key arizona_irq_lock_class; |
187 | static struct lock_class_key arizona_irq_request_class; | ||
187 | 188 | ||
188 | static int arizona_irq_map(struct irq_domain *h, unsigned int virq, | 189 | static int arizona_irq_map(struct irq_domain *h, unsigned int virq, |
189 | irq_hw_number_t hw) | 190 | irq_hw_number_t hw) |
@@ -191,7 +192,8 @@ static int arizona_irq_map(struct irq_domain *h, unsigned int virq, | |||
191 | struct arizona *data = h->host_data; | 192 | struct arizona *data = h->host_data; |
192 | 193 | ||
193 | irq_set_chip_data(virq, data); | 194 | irq_set_chip_data(virq, data); |
194 | irq_set_lockdep_class(virq, &arizona_irq_lock_class); | 195 | irq_set_lockdep_class(virq, &arizona_irq_lock_class, |
196 | &arizona_irq_request_class); | ||
195 | irq_set_chip_and_handler(virq, &arizona_irq_chip, handle_simple_irq); | 197 | irq_set_chip_and_handler(virq, &arizona_irq_chip, handle_simple_irq); |
196 | irq_set_nested_thread(virq, 1); | 198 | irq_set_nested_thread(virq, 1); |
197 | irq_set_noprobe(virq); | 199 | irq_set_noprobe(virq); |
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index e6cd8de793e2..3501491e5bfc 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c | |||
@@ -222,6 +222,9 @@ static enum pin_config_param pcs_bias[] = { | |||
222 | */ | 222 | */ |
223 | static struct lock_class_key pcs_lock_class; | 223 | static struct lock_class_key pcs_lock_class; |
224 | 224 | ||
225 | /* Class for the IRQ request mutex */ | ||
226 | static struct lock_class_key pcs_request_class; | ||
227 | |||
225 | /* | 228 | /* |
226 | * REVISIT: Reads and writes could eventually use regmap or something | 229 | * REVISIT: Reads and writes could eventually use regmap or something |
227 | * generic. But at least on omaps, some mux registers are performance | 230 | * generic. But at least on omaps, some mux registers are performance |
@@ -1486,7 +1489,7 @@ static int pcs_irqdomain_map(struct irq_domain *d, unsigned int irq, | |||
1486 | irq_set_chip_data(irq, pcs_soc); | 1489 | irq_set_chip_data(irq, pcs_soc); |
1487 | irq_set_chip_and_handler(irq, &pcs->chip, | 1490 | irq_set_chip_and_handler(irq, &pcs->chip, |
1488 | handle_level_irq); | 1491 | handle_level_irq); |
1489 | irq_set_lockdep_class(irq, &pcs_lock_class); | 1492 | irq_set_lockdep_class(irq, &pcs_lock_class, &pcs_request_class); |
1490 | irq_set_noprobe(irq); | 1493 | irq_set_noprobe(irq); |
1491 | 1494 | ||
1492 | return 0; | 1495 | return 0; |