Fix possible deadlocks for i8255 GPIO drivers
Subsystems (3)
cover Fix possible deadlocks for i8255 GPIO drivers
The 104-dio-48e and 104-idi-48 drivers leverage regmap-irq to handle IRQ. The default regmap locking utilizes spinlocks but this can result in deadlocks for IRQ chips when running -rt kernels [0]. Enable use_raw_spinlock for the regmap_config of these drivers to prevent such.
[0] https://lore.kernel.org/all/1466065537-82027-1-git-send-email-mika.westerberg@linux.intel.com/
William Breathitt Gray (2):
gpio: 104-dio-48e: Enable use_raw_spinlock for dio48e_regmap_config
gpio: 104-idi-48: Enable use_raw_spinlock for idi48_regmap_config
drivers/gpio/gpio-104-dio-48e.c | 1 + drivers/gpio/gpio-104-idi-48.c | 1 + 2 files changed, 2 insertions(+)
base-commit: d49765b5f4320a402fbc4ed5edfd73d87640f27c
Signature · 1 line
2.39.2
PATCH 1/2 gpio: 104-dio-48e: Enable use_raw_spinlock for dio48e_regmap_config
The dio48e regmap can be used in an interrupt context by regmap-irq. To prevent a deadlock, enable use_raw_spinlock for dio48e_regmap_config.
--- drivers/gpio/gpio-104-dio-48e.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpio-104-dio-48e.c +1 -0
@@ -86,6 +86,7 @@ static const struct regmap_config dio48e_regmap_config = { .volatile_table = &dio48e_volatile_table, .precious_table = &dio48e_precious_table, .cache_type = REGCACHE_FLAT, + .use_raw_spinlock = true, };/* only bit 3 on each respective Port C supports interrupts */
Signature · 1 line
2.39.2
PATCH 2/2 gpio: 104-idi-48: Enable use_raw_spinlock for idi48_regmap_config
In reply to William Breathitt GrayThe idi48 regmap can be used in an interrupt context by regmap-irq. To prevent a deadlock, enable use_raw_spinlock for idi48_regmap_config.
--- drivers/gpio/gpio-104-idi-48.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpio-104-idi-48.c +1 -0
@@ -81,6 +81,7 @@ static const struct regmap_config idi48_regmap_config = { .wr_table = &idi_48_wr_table, .rd_table = &idi_48_rd_table, .precious_table = &idi_48_precious_table, + .use_raw_spinlock = true, };#define IDI48_NGPIO 48
Signature · 1 line
2.39.2
Quoted 6 lines · William Breathitt Gray
The 104-dio-48e and 104-idi-48 drivers leverage regmap-irq to handle IRQ. The default regmap locking utilizes spinlocks but this can result in deadlocks for IRQ chips when running -rt kernels [0]. Enable
use_raw_spinlockfor theregmap_configof these drivers to prevent such.[0] https://lore.kernel.org/all/1466065537-82027-1-git-send-email-mika.westerberg@linux.intel.com/
This looks reasonable.
Yours,
Linus Walleij
Quoted 12 lines · William Breathitt Gray
The 104-dio-48e and 104-idi-48 drivers leverage regmap-irq to handle IRQ. The default regmap locking utilizes spinlocks but this can result in deadlocks for IRQ chips when running -rt kernels [0]. Enable
use_raw_spinlockfor theregmap_configof these drivers to prevent such.[0] https://lore.kernel.org/all/1466065537-82027-1-git-send-email-mika.westerberg@linux.intel.com/
William Breathitt Gray (2):
gpio: 104-dio-48e: Enableuse_raw_spinlockfordio48e_regmap_config
gpio: 104-idi-48: Enableuse_raw_spinlockforidi48_regmap_config
Quoted 9 lines
drivers/gpio/gpio-104-dio-48e.c | 1 + drivers/gpio/gpio-104-idi-48.c | 1 + 2 files changed, 2 insertions(+)base-commit:
d49765b5f4320a402fbc4ed5edfd73d87640f27c--
2.39.2
Both queued for fixes.
Bart