Skip to contentSkip to conversation

gpio: pca953x: Fix GPIO resource leak on Intel Galileo Gen 2

PATCH In review Andy Shevchenko 5 participants 5 messages Jun 18, 2020 – Jun 22, 2020 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: pca953x: Fix GPIO resource leak on Intel Galileo Gen 2

When adding a quirk for IRQ on Intel Galileo Gen 2 the commit ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2") missed GPIO resource release. We can safely do this in the same quirk, since IRQ will be locked by GPIO framework when requested and unlocked on freeing.

Fixes ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2")
Cc Mika Westerberg <[email protected]>
---
 drivers/gpio/gpio-pca953x.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpio/gpio-pca953x.c +6 -1
index cea22fcc2a24..9c90cf3aac5a 100644
@@ -177,7 +177,12 @@ static int pca953x_acpi_get_irq(struct device *dev)
 	if (ret)
 		return ret;
 
-	return gpio_to_irq(pin);
+	ret = gpio_to_irq(pin);
+
+	/* When pin is used as an IRQ, no need to keep it requested */
+	gpio_free(pin);
+
+	return ret;
 }
 #endif
 
Signature · 1 line
2.27.0.rc2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Andy Shevchenko

When adding a quirk for IRQ on Intel Galileo Gen 2 the commit ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2") missed GPIO resource release. We can safely do this in the same quirk, since IRQ will be locked by GPIO framework when requested and unlocked on freeing.

Fixes ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2")
Cc Mika Westerberg <[email protected]>
Reviewed-by on v1 1/1
#2 lore raw
In reply to Andy Shevchenko
Quoted 8 lines · Andy Shevchenko

When adding a quirk for IRQ on Intel Galileo Gen 2 the commit ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2") missed GPIO resource release. We can safely do this in the same quirk, since IRQ will be locked by GPIO framework when requested and unlocked on freeing.

Fixes ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2")
Cc Mika Westerberg <[email protected]>

This seems to go on top of what Bartosz applied so I expect him to pick it up!

Yours,
Linus Walleij

#3 lore raw
Quoted 9 lines · Linus Walleij
Quoted 5 lines · Andy Shevchenko

When adding a quirk for IRQ on Intel Galileo Gen 2 the commit ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2") missed GPIO resource release. We can safely do this in the same quirk, since IRQ will be locked by GPIO framework when requested and unlocked on freeing.

Quoted 6 lines
Quoted 3 lines
Fixes ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2")
Cc Mika Westerberg <[email protected]>

This seems to go on top of what Bartosz applied so I expect him to pick it up!

Yes, that's what is expected.

Quoted 1 line

Thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#4 lore raw

niedz., 21 cze 2020 o 10:23 Andy Shevchenko
<[email protected]> napisał(a):

Quoted 20 lines · Linus Walleij
Quoted 9 lines
Quoted 5 lines · Andy Shevchenko

When adding a quirk for IRQ on Intel Galileo Gen 2 the commit ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2") missed GPIO resource release. We can safely do this in the same quirk, since IRQ will be locked by GPIO framework when requested and unlocked on freeing.

Quoted 6 lines
Quoted 3 lines
Fixes ba8c90c61847 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2")
Cc Mika Westerberg <[email protected]>

This seems to go on top of what Bartosz applied so I expect him to pick it up!

Yes, that's what is expected.

Quoted 7 lines
Quoted 1 line

Thanks!

--
With Best Regards,
Andy Shevchenko

Applied for fixes. I'll send a PR to Linus later this week.

Bart