Ignore:
Timestamp:
Apr 19, 2025, 8:08:37 PM (4 months ago)
Author:
David Azarewicz
Message:

Merge in changes from 6.6-LTS branch.
Fixed additional 25+ problems.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/pci/emu10k1/emumpu401.c

    r703 r772  
    105105static int snd_emu10k1_midi_cmd(struct snd_emu10k1 * emu, struct snd_emu10k1_midi *midi, unsigned char cmd, int ack)
    106106{
    107         unsigned long flags;
    108107        int timeout, ok;
    109108
    110         spin_lock_irqsave(&midi->input_lock, flags);
     109        spin_lock_irq(&midi->input_lock);
    111110        mpu401_write_data(emu, midi, 0x00);
    112111        /* mpu401_clear_rx(emu, midi); */
     
    127126                ok = 1;
    128127        }
    129         spin_unlock_irqrestore(&midi->input_lock, flags);
     128        spin_unlock_irq(&midi->input_lock);
    130129        if (!ok) {
    131130                dev_err(emu->card->dev,
     
    143142        struct snd_emu10k1 *emu;
    144143        struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data;
    145         unsigned long flags;
    146144
    147145        emu = midi->emu;
    148146        if (snd_BUG_ON(!emu))
    149147                return -ENXIO;
    150         spin_lock_irqsave(&midi->open_lock, flags);
     148        spin_lock_irq(&midi->open_lock);
    151149        midi->midi_mode |= EMU10K1_MIDI_MODE_INPUT;
    152150        midi->substream_input = substream;
    153151        if (!(midi->midi_mode & EMU10K1_MIDI_MODE_OUTPUT)) {
    154                 spin_unlock_irqrestore(&midi->open_lock, flags);
     152                spin_unlock_irq(&midi->open_lock);
    155153                if (snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 1))
    156154                        goto error_out;
     
    158156                        goto error_out;
    159157        } else {
    160                 spin_unlock_irqrestore(&midi->open_lock, flags);
     158                spin_unlock_irq(&midi->open_lock);
    161159        }
    162160        return 0;
     
    170168        struct snd_emu10k1 *emu;
    171169        struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data;
    172         unsigned long flags;
    173170
    174171        emu = midi->emu;
    175172        if (snd_BUG_ON(!emu))
    176173                return -ENXIO;
    177         spin_lock_irqsave(&midi->open_lock, flags);
     174        spin_lock_irq(&midi->open_lock);
    178175        midi->midi_mode |= EMU10K1_MIDI_MODE_OUTPUT;
    179176        midi->substream_output = substream;
    180177        if (!(midi->midi_mode & EMU10K1_MIDI_MODE_INPUT)) {
    181                 spin_unlock_irqrestore(&midi->open_lock, flags);
     178                spin_unlock_irq(&midi->open_lock);
    182179                if (snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 1))
    183180                        goto error_out;
     
    185182                        goto error_out;
    186183        } else {
    187                 spin_unlock_irqrestore(&midi->open_lock, flags);
     184                spin_unlock_irq(&midi->open_lock);
    188185        }
    189186        return 0;
     
    197194        struct snd_emu10k1 *emu;
    198195        struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data;
    199         unsigned long flags;
    200196        int err = 0;
    201197
     
    203199        if (snd_BUG_ON(!emu))
    204200                return -ENXIO;
    205         spin_lock_irqsave(&midi->open_lock, flags);
     201        spin_lock_irq(&midi->open_lock);
    206202        snd_emu10k1_intr_disable(emu, midi->rx_enable);
    207203        midi->midi_mode &= ~EMU10K1_MIDI_MODE_INPUT;
    208204        midi->substream_input = NULL;
    209205        if (!(midi->midi_mode & EMU10K1_MIDI_MODE_OUTPUT)) {
    210                 spin_unlock_irqrestore(&midi->open_lock, flags);
     206                spin_unlock_irq(&midi->open_lock);
    211207                err = snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 0);
    212208        } else {
    213                 spin_unlock_irqrestore(&midi->open_lock, flags);
     209                spin_unlock_irq(&midi->open_lock);
    214210        }
    215211        return err;
     
    220216        struct snd_emu10k1 *emu;
    221217        struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data;
    222         unsigned long flags;
    223218        int err = 0;
    224219
     
    226221        if (snd_BUG_ON(!emu))
    227222                return -ENXIO;
    228         spin_lock_irqsave(&midi->open_lock, flags);
     223        spin_lock_irq(&midi->open_lock);
    229224        snd_emu10k1_intr_disable(emu, midi->tx_enable);
    230225        midi->midi_mode &= ~EMU10K1_MIDI_MODE_OUTPUT;
    231226        midi->substream_output = NULL;
    232227        if (!(midi->midi_mode & EMU10K1_MIDI_MODE_INPUT)) {
    233                 spin_unlock_irqrestore(&midi->open_lock, flags);
     228                spin_unlock_irq(&midi->open_lock);
    234229                err = snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 0);
    235230        } else {
    236                 spin_unlock_irqrestore(&midi->open_lock, flags);
     231                spin_unlock_irq(&midi->open_lock);
    237232        }
    238233        return err;
     
    257252        struct snd_emu10k1 *emu;
    258253        struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data;
    259         unsigned long flags;
    260254
    261255        emu = midi->emu;
     
    268262       
    269263                /* try to send some amount of bytes here before interrupts */
    270                 spin_lock_irqsave(&midi->output_lock, flags);
     264                spin_lock_irq(&midi->output_lock);
    271265                while (max > 0) {
    272266                        if (mpu401_output_ready(emu, midi)) {
     
    274268                                    snd_rawmidi_transmit(substream, &byte, 1) != 1) {
    275269                                        /* no more data */
    276                                         spin_unlock_irqrestore(&midi->output_lock, flags);
     270                                        spin_unlock_irq(&midi->output_lock);
    277271                                        return;
    278272                                }
     
    283277                        }
    284278                }
    285                 spin_unlock_irqrestore(&midi->output_lock, flags);
     279                spin_unlock_irq(&midi->output_lock);
    286280                snd_emu10k1_intr_enable(emu, midi->tx_enable);
    287281        } else {
Note: See TracChangeset for help on using the changeset viewer.