summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-09-15 17:35:05 +0100
committerMark Brown <broonie@kernel.org>2026-09-15 17:35:05 +0100
commit82ecb042d5f4efc01298fbf7575e22fadfd8dfd3 (patch)
treeff2799c20bd35a2e4129b47710138d8b1dd05d75 /tools/perf/scripts/python/stackcollapse.py
parent247b84c07b7ea4940f69995cc4fc4f20d8c0c615 (diff)
parentdf0afa439044d7099055d5dc27189a083d8c9899 (diff)
ASoC: generic: Free jack GPIOs on card remove
Chancel Liu <chancel.liu@oss.nxp.com> says: simple_util_init_jack() acquires a jack detection GPIO with gpiod_get_optional() and passes it to snd_soc_jack_add_gpios(), which also installs an IRQ handler, a PM notifier, a delayed work and a sysfs export for it. None of simple-card, audio-graph-card or audio-graph-card2 implements a card->remove() callback, so none of this is ever released. That goes unnoticed while the card is only torn down together with its platform device, because the devres cleanup registered by snd_soc_jack_add_gpios() is tied to that platform device. It becomes a problem once the card alone is unregistered and registered again while the platform device stays bound - for instance when a codec component is unbound and bound again. card->probe() then runs a second time and gpiod_get_optional() fails with -EBUSY, because the descriptor is still held by the previous bind. The card is not registered again and audio stays broken until the platform device itself is unbound. Patch 1 adds the simple_util_remove_jack() helper, patches 2-4 wire it up in the three generic card drivers. Verified with audio-graph-card2 and a wm8962 codec using hp-det-gpios. Before the series, the first echo 3-001a > /sys/bus/i2c/drivers/wm8962/unbind echo 3-001a > /sys/bus/i2c/drivers/wm8962/bind leaves the GPIO line and IRQ claimed while the card is gone, and the re-bind fails with ASoC error (-16): at graph_util_card_probe() ASoC error (-16): at snd_soc_card_probe() on wm8962-audio after which the sound card never comes back. With the series applied, both codec unbind/bind and platform unbind/bind cycles release the GPIO and IRQ on unbind and fully restore the card. Link: https://patch.msgid.link/20260913102502.2805912-1-chancel.liu@oss.nxp.com
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions