| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * ALSA sequencer FIFO |
|---|
| 3 | 4 | * Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl> |
|---|
| 4 | | - * |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 8 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 9 | | - * (at your option) any later version. |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | | - * GNU General Public License for more details. |
|---|
| 15 | | - * |
|---|
| 16 | | - * You should have received a copy of the GNU General Public License |
|---|
| 17 | | - * along with this program; if not, write to the Free Software |
|---|
| 18 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 19 | | - * |
|---|
| 20 | 5 | */ |
|---|
| 21 | 6 | |
|---|
| 22 | 7 | #include <sound/core.h> |
|---|
| .. | .. |
|---|
| 98 | 83 | void snd_seq_fifo_clear(struct snd_seq_fifo *f) |
|---|
| 99 | 84 | { |
|---|
| 100 | 85 | struct snd_seq_event_cell *cell; |
|---|
| 101 | | - unsigned long flags; |
|---|
| 102 | 86 | |
|---|
| 103 | 87 | /* clear overflow flag */ |
|---|
| 104 | 88 | atomic_set(&f->overflow, 0); |
|---|
| 105 | 89 | |
|---|
| 106 | 90 | snd_use_lock_sync(&f->use_lock); |
|---|
| 107 | | - spin_lock_irqsave(&f->lock, flags); |
|---|
| 91 | + spin_lock_irq(&f->lock); |
|---|
| 108 | 92 | /* drain the fifo */ |
|---|
| 109 | 93 | while ((cell = fifo_cell_out(f)) != NULL) { |
|---|
| 110 | 94 | snd_seq_cell_free(cell); |
|---|
| 111 | 95 | } |
|---|
| 112 | | - spin_unlock_irqrestore(&f->lock, flags); |
|---|
| 96 | + spin_unlock_irq(&f->lock); |
|---|
| 113 | 97 | } |
|---|
| 114 | 98 | |
|---|
| 115 | 99 | |
|---|
| .. | .. |
|---|
| 195 | 179 | } |
|---|
| 196 | 180 | set_current_state(TASK_INTERRUPTIBLE); |
|---|
| 197 | 181 | add_wait_queue(&f->input_sleep, &wait); |
|---|
| 198 | | - spin_unlock_irq(&f->lock); |
|---|
| 182 | + spin_unlock_irqrestore(&f->lock, flags); |
|---|
| 199 | 183 | schedule(); |
|---|
| 200 | | - spin_lock_irq(&f->lock); |
|---|
| 184 | + spin_lock_irqsave(&f->lock, flags); |
|---|
| 201 | 185 | remove_wait_queue(&f->input_sleep, &wait); |
|---|
| 202 | 186 | if (signal_pending(current)) { |
|---|
| 203 | 187 | spin_unlock_irqrestore(&f->lock, flags); |
|---|
| .. | .. |
|---|
| 239 | 223 | /* change the size of pool; all old events are removed */ |
|---|
| 240 | 224 | int snd_seq_fifo_resize(struct snd_seq_fifo *f, int poolsize) |
|---|
| 241 | 225 | { |
|---|
| 242 | | - unsigned long flags; |
|---|
| 243 | 226 | struct snd_seq_pool *newpool, *oldpool; |
|---|
| 244 | 227 | struct snd_seq_event_cell *cell, *next, *oldhead; |
|---|
| 245 | 228 | |
|---|
| .. | .. |
|---|
| 255 | 238 | return -ENOMEM; |
|---|
| 256 | 239 | } |
|---|
| 257 | 240 | |
|---|
| 258 | | - spin_lock_irqsave(&f->lock, flags); |
|---|
| 241 | + spin_lock_irq(&f->lock); |
|---|
| 259 | 242 | /* remember old pool */ |
|---|
| 260 | 243 | oldpool = f->pool; |
|---|
| 261 | 244 | oldhead = f->head; |
|---|
| .. | .. |
|---|
| 265 | 248 | f->tail = NULL; |
|---|
| 266 | 249 | f->cells = 0; |
|---|
| 267 | 250 | /* NOTE: overflow flag is not cleared */ |
|---|
| 268 | | - spin_unlock_irqrestore(&f->lock, flags); |
|---|
| 251 | + spin_unlock_irq(&f->lock); |
|---|
| 269 | 252 | |
|---|
| 270 | 253 | /* close the old pool and wait until all users are gone */ |
|---|
| 271 | 254 | snd_seq_pool_mark_closing(oldpool); |
|---|