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 /include/linux/gpio | |
| 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 'include/linux/gpio')
| -rw-r--r-- | include/linux/gpio/driver.h | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 55e672592fa9..7258cd676df4 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h | |||
| @@ -66,9 +66,10 @@ struct gpio_irq_chip { | |||
| 66 | /** | 66 | /** |
| 67 | * @lock_key: | 67 | * @lock_key: |
| 68 | * | 68 | * |
| 69 | * Per GPIO IRQ chip lockdep class. | 69 | * Per GPIO IRQ chip lockdep classes. |
| 70 | */ | 70 | */ |
| 71 | struct lock_class_key *lock_key; | 71 | struct lock_class_key *lock_key; |
| 72 | struct lock_class_key *request_key; | ||
| 72 | 73 | ||
| 73 | /** | 74 | /** |
| 74 | * @parent_handler: | 75 | * @parent_handler: |
| @@ -323,7 +324,8 @@ extern const char *gpiochip_is_requested(struct gpio_chip *chip, | |||
| 323 | 324 | ||
| 324 | /* add/remove chips */ | 325 | /* add/remove chips */ |
| 325 | extern int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, | 326 | extern int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, |
| 326 | struct lock_class_key *lock_key); | 327 | struct lock_class_key *lock_key, |
| 328 | struct lock_class_key *request_key); | ||
| 327 | 329 | ||
| 328 | /** | 330 | /** |
| 329 | * gpiochip_add_data() - register a gpio_chip | 331 | * gpiochip_add_data() - register a gpio_chip |
| @@ -350,11 +352,13 @@ extern int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, | |||
| 350 | */ | 352 | */ |
| 351 | #ifdef CONFIG_LOCKDEP | 353 | #ifdef CONFIG_LOCKDEP |
| 352 | #define gpiochip_add_data(chip, data) ({ \ | 354 | #define gpiochip_add_data(chip, data) ({ \ |
| 353 | static struct lock_class_key key; \ | 355 | static struct lock_class_key lock_key; \ |
| 354 | gpiochip_add_data_with_key(chip, data, &key); \ | 356 | static struct lock_class_key request_key; \ |
| 357 | gpiochip_add_data_with_key(chip, data, &lock_key, \ | ||
| 358 | &request_key); \ | ||
| 355 | }) | 359 | }) |
| 356 | #else | 360 | #else |
| 357 | #define gpiochip_add_data(chip, data) gpiochip_add_data_with_key(chip, data, NULL) | 361 | #define gpiochip_add_data(chip, data) gpiochip_add_data_with_key(chip, data, NULL, NULL) |
| 358 | #endif | 362 | #endif |
| 359 | 363 | ||
| 360 | static inline int gpiochip_add(struct gpio_chip *chip) | 364 | static inline int gpiochip_add(struct gpio_chip *chip) |
| @@ -429,7 +433,8 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gpiochip, | |||
| 429 | irq_flow_handler_t handler, | 433 | irq_flow_handler_t handler, |
| 430 | unsigned int type, | 434 | unsigned int type, |
| 431 | bool threaded, | 435 | bool threaded, |
| 432 | struct lock_class_key *lock_key); | 436 | struct lock_class_key *lock_key, |
| 437 | struct lock_class_key *request_key); | ||
| 433 | 438 | ||
| 434 | #ifdef CONFIG_LOCKDEP | 439 | #ifdef CONFIG_LOCKDEP |
| 435 | 440 | ||
| @@ -445,10 +450,12 @@ static inline int gpiochip_irqchip_add(struct gpio_chip *gpiochip, | |||
| 445 | irq_flow_handler_t handler, | 450 | irq_flow_handler_t handler, |
| 446 | unsigned int type) | 451 | unsigned int type) |
| 447 | { | 452 | { |
| 448 | static struct lock_class_key key; | 453 | static struct lock_class_key lock_key; |
| 454 | static struct lock_class_key request_key; | ||
| 449 | 455 | ||
| 450 | return gpiochip_irqchip_add_key(gpiochip, irqchip, first_irq, | 456 | return gpiochip_irqchip_add_key(gpiochip, irqchip, first_irq, |
| 451 | handler, type, false, &key); | 457 | handler, type, false, |
| 458 | &lock_key, &request_key); | ||
| 452 | } | 459 | } |
| 453 | 460 | ||
| 454 | static inline int gpiochip_irqchip_add_nested(struct gpio_chip *gpiochip, | 461 | static inline int gpiochip_irqchip_add_nested(struct gpio_chip *gpiochip, |
| @@ -458,10 +465,12 @@ static inline int gpiochip_irqchip_add_nested(struct gpio_chip *gpiochip, | |||
| 458 | unsigned int type) | 465 | unsigned int type) |
| 459 | { | 466 | { |
| 460 | 467 | ||
| 461 | static struct lock_class_key key; | 468 | static struct lock_class_key lock_key; |
| 469 | static struct lock_class_key request_key; | ||
| 462 | 470 | ||
| 463 | return gpiochip_irqchip_add_key(gpiochip, irqchip, first_irq, | 471 | return gpiochip_irqchip_add_key(gpiochip, irqchip, first_irq, |
| 464 | handler, type, true, &key); | 472 | handler, type, true, |
| 473 | &lock_key, &request_key); | ||
| 465 | } | 474 | } |
| 466 | #else | 475 | #else |
| 467 | static inline int gpiochip_irqchip_add(struct gpio_chip *gpiochip, | 476 | static inline int gpiochip_irqchip_add(struct gpio_chip *gpiochip, |
| @@ -471,7 +480,7 @@ static inline int gpiochip_irqchip_add(struct gpio_chip *gpiochip, | |||
| 471 | unsigned int type) | 480 | unsigned int type) |
| 472 | { | 481 | { |
| 473 | return gpiochip_irqchip_add_key(gpiochip, irqchip, first_irq, | 482 | return gpiochip_irqchip_add_key(gpiochip, irqchip, first_irq, |
| 474 | handler, type, false, NULL); | 483 | handler, type, false, NULL, NULL); |
| 475 | } | 484 | } |
| 476 | 485 | ||
| 477 | static inline int gpiochip_irqchip_add_nested(struct gpio_chip *gpiochip, | 486 | static inline int gpiochip_irqchip_add_nested(struct gpio_chip *gpiochip, |
| @@ -481,7 +490,7 @@ static inline int gpiochip_irqchip_add_nested(struct gpio_chip *gpiochip, | |||
| 481 | unsigned int type) | 490 | unsigned int type) |
| 482 | { | 491 | { |
| 483 | return gpiochip_irqchip_add_key(gpiochip, irqchip, first_irq, | 492 | return gpiochip_irqchip_add_key(gpiochip, irqchip, first_irq, |
| 484 | handler, type, true, NULL); | 493 | handler, type, true, NULL, NULL); |
| 485 | } | 494 | } |
| 486 | #endif /* CONFIG_LOCKDEP */ | 495 | #endif /* CONFIG_LOCKDEP */ |
| 487 | 496 | ||
