ALSA: emu10k1: make E-MU FPGA writes potentially more reliable
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>
Sun, 28 Apr 2024 09:37:16 +0000 (11:37 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sun, 28 Apr 2024 09:58:12 +0000 (11:58 +0200)
We did not delay after the second strobe signal, so another immediately
following access could potentially corrupt the written value.

This is a purely speculative fix with no supporting evidence, but after
taking out the spinlocks around the writes, it seems plausible that a
modern processor could be actually too fast. Also, it's just cleaner to
be consistent.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Message-ID: <20240428093716.3198666-7-oswald.buddenhagen@gmx.de>

sound/pci/emu10k1/io.c

index f3260a81e47b7b5d504b670d868c295dd34efb76..f4a1c2d4b0787518634dac52ebae9c41a01f05dc 100644 (file)
@@ -285,6 +285,7 @@ static void snd_emu1010_fpga_write_locked(struct snd_emu10k1 *emu, u32 reg, u32
        outw(value, emu->port + A_GPIO);
        udelay(10);
        outw(value | 0x80 , emu->port + A_GPIO);  /* High bit clocks the value into the fpga. */
+       udelay(10);
 }
 
 void snd_emu1010_fpga_write(struct snd_emu10k1 *emu, u32 reg, u32 value)