]> git.ipfire.org Git - thirdparty/linux.git/commit
ALSA: emu10k1: move the whole GPIO event handling to the workqueue
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>
Sun, 28 Apr 2024 09:37:13 +0000 (11:37 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sun, 28 Apr 2024 09:58:12 +0000 (11:58 +0200)
commitf848337cd801c7106a4ec0d61765771dab2a5909
tree18da0d15aeb280cf59dbf8581a5db4131b2a3f7f
parent28deafd0fbdc45cc9c63bd7dd4efc35137958862
ALSA: emu10k1: move the whole GPIO event handling to the workqueue

The actual event processing was already done by workqueue items. We can
move the event dispatching there as well, rather than doing it already
in the interrupt handler callback.

This change has a rather profound "side effect" on the reliability of
the FPGA programming: once we enter programming mode, we must not issue
any snd_emu1010_fpga_{read,write}() calls until we're done, as these
would badly mess up the programming protocol. But exactly that would
happen when trying to program the dock, as that triggers GPIO interrupts
as a side effect. This is mitigated by deferring the actual interrupt
handling, as workqueue items are not re-entrant.

To avoid scheduling the dispatcher on non-events, we now explicitly
ignore GPIO IRQs triggered by "uninteresting" pins, which happens a lot
as a side effect of calling snd_emu1010_fpga_{read,write}().

Fixes: fbb64eedf5a3 ("ALSA: emu10k1: make E-MU dock monitoring interrupt-driven")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=218584
Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Message-ID: <20240428093716.3198666-4-oswald.buddenhagen@gmx.de>
include/sound/emu10k1.h
sound/pci/emu10k1/emu10k1.c
sound/pci/emu10k1/emu10k1_main.c