Skip to contentSkip to conversation

ALSA: aoa: Fix GPIO notification IRQ cleanup

PATCH Superseded Sreeraj S Kurup 3 participants 5 messages Nov 30 – Dec 1

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: aoa: Fix GPIO notification IRQ cleanup

The feature GPIO implementation checks gpio_private when cleaning up the line-in and line-out notification IRQs.

However, ftr_set_notify() registers these IRQs using request_irq() and tracks the registered callbacks through the notify field.

Check notify consistently for all notification IRQs so that registered line-in and line-out IRQs are released during teardown.

---
 sound/aoa/core/gpio-feature.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/aoa/core/gpio-feature.c +2 -2
index 19ed0e6907da..2549b660caa4 100644
@@ -285,9 +285,9 @@ static void ftr_gpio_exit(struct gpio_runtime *rt)
 	rt->implementation_private = 0;
 	if (rt->headphone_notify.notify)
 		free_irq(headphone_detect_irq, &rt->headphone_notify);
-	if (rt->line_in_notify.gpio_private)
+	if (rt->line_in_notify.notify)
 		free_irq(linein_detect_irq, &rt->line_in_notify);
-	if (rt->line_out_notify.gpio_private)
+	if (rt->line_out_notify.notify)
 		free_irq(lineout_detect_irq, &rt->line_out_notify);
 	cancel_delayed_work_sync(&rt->headphone_notify.work);
 	cancel_delayed_work_sync(&rt->line_in_notify.work);
Signature · 1 line
2.55.0
#1 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] ALSA: aoa: missing Fixes trailer for ftr_gpio_exit() IRQ cleanup fix --

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] ALSA: aoa: missing Fixes trailer for ftr_gpio_exit() IRQ cleanup fix
--

commit 9f709f56656cba3f95f376bcac2ddeb15a825400
Author: Sreeraj S Kurup <[email protected]>

Quoted 5 lines

ALSA: aoa: Fix GPIO notification IRQ cleanup

The feature GPIO implementation checks gpio_private when cleaning up the line-in and line-out notification IRQs.

Quoted 7 lines

However, ftr_set_notify() registers these IRQs using request_irq() and tracks the registered callbacks through the notify field.

Check notify consistently for all notification IRQs so that registered line-in and line-out IRQs are released during teardown.

[Severity: Low]
This fixes a bug present since ftr_gpio_exit() was added. Should this include:

Fixes f3d9478b2ce4 ("[ALSA] snd-aoa: add snd-aoa")
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#2 lore raw

PATCH v2 1/1 ALSA: aoa: Fix GPIO notification IRQ cleanup

In reply to Sreeraj S Kurup

The feature GPIO implementation checks gpio_private when cleaning up the line-in and line-out notification IRQs.

However, ftr_set_notify() registers these IRQs using request_irq() and tracks the registered callbacks through the notify field.

Check notify consistently for all notification IRQs so that registered line-in and line-out IRQs are released during teardown.

Fixes f3d9478b2ce4 ("[ALSA] snd-aoa: add snd-aoa")

---
v2:
- Add Fixes trailer.

 sound/aoa/core/gpio-feature.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/aoa/core/gpio-feature.c +2 -2
index 19ed0e6907da..2549b660caa4 100644
@@ -285,9 +285,9 @@ static void ftr_gpio_exit(struct gpio_runtime *rt)
 	rt->implementation_private = 0;
 	if (rt->headphone_notify.notify)
 		free_irq(headphone_detect_irq, &rt->headphone_notify);
-	if (rt->line_in_notify.gpio_private)
+	if (rt->line_in_notify.notify)
 		free_irq(linein_detect_irq, &rt->line_in_notify);
-	if (rt->line_out_notify.gpio_private)
+	if (rt->line_out_notify.notify)
 		free_irq(lineout_detect_irq, &rt->line_out_notify);
 	cancel_delayed_work_sync(&rt->headphone_notify.work);
 	cancel_delayed_work_sync(&rt->line_in_notify.work);
Signature · 1 line
2.55.0
Applied
#3 lore raw
Quoted 4 lines · Sreeraj S Kurup

The feature GPIO implementation checks gpio_private when cleaning up the line-in and line-out notification IRQs.

Quoted 8 lines

However, ftr_set_notify() registers these IRQs using request_irq() and tracks the registered callbacks through the notify field.

Check notify consistently for all notification IRQs so that registered line-in and line-out IRQs are released during teardown.

Fixes f3d9478b2ce4 ("[ALSA] snd-aoa: add snd-aoa")

Applied to for-next branch. Thanks.

Takashi