• Oswald Buddenhagen's avatar
    ALSA: emu10k1: use mutex for E-MU FPGA access locking · 2d3f4810
    Oswald Buddenhagen authored
    The FPGA access through the GPIO port does not interfere with other
    sound processor register access, so there is no need to subject it to
    emu_lock. And after moving all FPGA access out of the interrupt handler,
    it does not need to be IRQ-safe, either.
    
    What's more, attaching the dock causes a firmware upload, which takes
    several seconds. We really don't want to disable IRQs for this long, and
    even less also have someone else spin with IRQs disabled waiting for us.
    
    Therefore, use a mutex for FPGA access locking.
    
    This makes the code somewhat more noisy, as we need to wrap bigger
    sections into the mutex, as it needs to enclose the spinlocks.
    
    The latter has the "side effect" of fixing dock FPGA programming in a
    corner case: a really badly timed mixer access right between entering
    FPGA programming mode and uploading the netlist would mess up the
    protocol.
    Signed-off-by: default avatarOswald Buddenhagen <oswald.buddenhagen@gmx.de>
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    Message-ID: <20240428093716.3198666-5-oswald.buddenhagen@gmx.de>
    2d3f4810
emumixer.c 69.6 KB