diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-04-09 18:17:43 -1000 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-04-09 18:17:43 -1000 |
commit | fa3b895da8e06d6e3dcf3e6941a3fd428343e3d7 (patch) | |
tree | 251dbd45b10536a157ff75e3835733c47a939e19 /include | |
parent | e1f700ebd6bea293abe3c7e2807b252018efde01 (diff) | |
parent | 5467801f1fcbdc46bc7298a84dbf3ca1ff2a7320 (diff) | |
download | lwn-fa3b895da8e06d6e3dcf3e6941a3fd428343e3d7.tar.gz lwn-fa3b895da8e06d6e3dcf3e6941a3fd428343e3d7.zip |
Merge tag 'gpio-fixes-for-v5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux
Pull gpio fix from Bartosz Golaszewski:
- fix a race condition with consumers accessing the fields of GPIO IRQ
chips before they're fully initialized
* tag 'gpio-fixes-for-v5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
gpio: Restrict usage of GPIO chip irq members before initialization
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/gpio/driver.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 98c93510640e..874aabd270c9 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -222,6 +222,15 @@ struct gpio_irq_chip { bool per_parent_data; /** + * @initialized: + * + * Flag to track GPIO chip irq member's initialization. + * This flag will make sure GPIO chip irq members are not used + * before they are initialized. + */ + bool initialized; + + /** * @init_hw: optional routine to initialize hardware before * an IRQ chip will be added. This is quite useful when * a particular driver wants to clear IRQ related registers |