ChangeSet 1.2181.25.28, 2005/03/22 09:13:15+01:00, [EMAIL PROTECTED]
[ALSA] remove unneeded interrupt locks in rawmidi drivers
Generic drivers,MPU401 UART,CS4281 driver,ENS1370/1+ driver
CS46xx driver,EMU10K1/EMU10K2 driver
Now that the output trigger callback is called from a softirq instead
of an hardirq, we don't need anymore to disable interrupts in our
interrupt handlers.
Signed-off-by: Clemens Ladisch <[EMAIL PROTECTED]>
drivers/mpu401/mpu401_uart.c | 10 ++++------
drivers/mtpav.c | 5 ++---
drivers/serial-u16550.c | 7 +++----
pci/cs4281.c | 13 ++++++-------
pci/cs46xx/cs46xx_lib.c | 5 ++---
pci/emu10k1/emu10k1x.c | 5 ++---
pci/emu10k1/emumpu401.c | 5 ++---
pci/ens1370.c | 14 ++++++--------
8 files changed, 27 insertions(+), 37 deletions(-)
diff -Nru a/sound/drivers/mpu401/mpu401_uart.c
b/sound/drivers/mpu401/mpu401_uart.c
--- a/sound/drivers/mpu401/mpu401_uart.c 2005-03-30 16:15:09 -08:00
+++ b/sound/drivers/mpu401/mpu401_uart.c 2005-03-30 16:15:09 -08:00
@@ -92,21 +92,19 @@
static void _snd_mpu401_uart_interrupt(mpu401_t *mpu)
{
- unsigned long flags;
-
- spin_lock_irqsave(&mpu->input_lock, flags);
+ spin_lock(&mpu->input_lock);
if (test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) {
snd_mpu401_uart_input_read(mpu);
} else {
snd_mpu401_uart_clear_rx(mpu);
}
- spin_unlock_irqrestore(&mpu->input_lock, flags);
+ spin_unlock(&mpu->input_lock);
/* ok. for better Tx performance try do some output when input is done
*/
if (test_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode) &&
test_bit(MPU401_MODE_BIT_OUTPUT_TRIGGER, &mpu->mode)) {
- spin_lock_irqsave(&mpu->output_lock, flags);
+ spin_lock(&mpu->output_lock);
snd_mpu401_uart_output_write(mpu);
- spin_unlock_irqrestore(&mpu->output_lock, flags);
+ spin_unlock(&mpu->output_lock);
}
}
diff -Nru a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c
--- a/sound/drivers/mtpav.c 2005-03-30 16:15:09 -08:00
+++ b/sound/drivers/mtpav.c 2005-03-30 16:15:09 -08:00
@@ -580,13 +580,12 @@
static irqreturn_t snd_mtpav_irqh(int irq, void *dev_id, struct pt_regs *regs)
{
- unsigned long flags;
mtpav_t *mcard = dev_id;
//printk("irqh()\n");
- spin_lock_irqsave(&mcard->spinlock, flags);
+ spin_lock(&mcard->spinlock);
snd_mtpav_read_bytes(mcard);
- spin_unlock_irqrestore(&mcard->spinlock, flags);
+ spin_unlock(&mcard->spinlock);
return IRQ_HANDLED;
}
diff -Nru a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c
--- a/sound/drivers/serial-u16550.c 2005-03-30 16:15:09 -08:00
+++ b/sound/drivers/serial-u16550.c 2005-03-30 16:15:09 -08:00
@@ -292,18 +292,17 @@
*/
static irqreturn_t snd_uart16550_interrupt(int irq, void *dev_id, struct
pt_regs *regs)
{
- unsigned long flags;
snd_uart16550_t *uart;
uart = (snd_uart16550_t *) dev_id;
- spin_lock_irqsave(&uart->open_lock, flags);
+ spin_lock(&uart->open_lock);
if (uart->filemode == SERIAL_MODE_NOT_OPENED) {
- spin_unlock_irqrestore(&uart->open_lock, flags);
+ spin_unlock(&uart->open_lock);
return IRQ_NONE;
}
inb(uart->base + UART_IIR); /* indicate to the UART that
the interrupt has been serviced */
snd_uart16550_io_loop(uart);
- spin_unlock_irqrestore(&uart->open_lock, flags);
+ spin_unlock(&uart->open_lock);
return IRQ_HANDLED;
}
diff -Nru a/sound/pci/cs4281.c b/sound/pci/cs4281.c
--- a/sound/pci/cs4281.c 2005-03-30 16:15:09 -08:00
+++ b/sound/pci/cs4281.c 2005-03-30 16:15:09 -08:00
@@ -1848,7 +1848,6 @@
static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs
*regs)
{
cs4281_t *chip = dev_id;
- unsigned long flags;
unsigned int status, dma, val;
cs4281_dma_t *cdma;
@@ -1864,7 +1863,7 @@
for (dma = 0; dma < 4; dma++)
if (status & BA0_HISR_DMA(dma)) {
cdma = &chip->dma[dma];
- spin_lock_irqsave(&chip->reg_lock, flags);
+ spin_lock(&chip->reg_lock);
/* ack DMA IRQ */
val = snd_cs4281_peekBA0(chip, cdma->regHDSR);
/* workaround, sometimes CS4281 acknowledges */
@@ -1873,16 +1872,16 @@
if ((val & BA0_HDSR_DHTC) && !(cdma->frag & 1))
{
cdma->frag--;
chip->spurious_dhtc_irq++;
- spin_unlock_irqrestore(&chip->reg_lock,
flags);
+ spin_unlock(&chip->reg_lock);
continue;
}
if ((val & BA0_HDSR_DTC) && (cdma->frag & 1)) {
cdma->frag--;
chip->spurious_dtc_irq++;
- spin_unlock_irqrestore(&chip->reg_lock,
flags);
+ spin_unlock(&chip->reg_lock);
continue;
}
- spin_unlock_irqrestore(&chip->reg_lock, flags);
+ spin_unlock(&chip->reg_lock);
snd_pcm_period_elapsed(cdma->substream);
}
}
@@ -1890,7 +1889,7 @@
if ((status & BA0_HISR_MIDI) && chip->rmidi) {
unsigned char c;
- spin_lock_irqsave(&chip->reg_lock, flags);
+ spin_lock(&chip->reg_lock);
while ((snd_cs4281_peekBA0(chip, BA0_MIDSR) & BA0_MIDSR_RBE) ==
0) {
c = snd_cs4281_peekBA0(chip, BA0_MIDRP);
if ((chip->midcr & BA0_MIDCR_RIE) == 0)
@@ -1907,7 +1906,7 @@
}
snd_cs4281_pokeBA0(chip, BA0_MIDWP, c);
}
- spin_unlock_irqrestore(&chip->reg_lock, flags);
+ spin_unlock(&chip->reg_lock);
}
/* EOI to the PCI part... reenables interrupts */
diff -Nru a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
--- a/sound/pci/cs46xx/cs46xx_lib.c 2005-03-30 16:15:09 -08:00
+++ b/sound/pci/cs46xx/cs46xx_lib.c 2005-03-30 16:15:09 -08:00
@@ -1149,7 +1149,6 @@
static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id, struct pt_regs
*regs)
{
- unsigned long flags;
cs46xx_t *chip = dev_id;
u32 status1;
#ifdef CONFIG_SND_CS46XX_NEW_DSP
@@ -1213,7 +1212,7 @@
if ((status1 & HISR_MIDI) && chip->rmidi) {
unsigned char c;
- spin_lock_irqsave(&chip->reg_lock, flags);
+ spin_lock(&chip->reg_lock);
while ((snd_cs46xx_peekBA0(chip, BA0_MIDSR) & MIDSR_RBE) == 0) {
c = snd_cs46xx_peekBA0(chip, BA0_MIDRP);
if ((chip->midcr & MIDCR_RIE) == 0)
@@ -1230,7 +1229,7 @@
}
snd_cs46xx_pokeBA0(chip, BA0_MIDWP, c);
}
- spin_unlock_irqrestore(&chip->reg_lock, flags);
+ spin_unlock(&chip->reg_lock);
}
/*
* EOI to the PCI part....reenables interrupts
diff -Nru a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c
--- a/sound/pci/emu10k1/emu10k1x.c 2005-03-30 16:15:09 -08:00
+++ b/sound/pci/emu10k1/emu10k1x.c 2005-03-30 16:15:09 -08:00
@@ -1265,7 +1265,6 @@
static void do_emu10k1x_midi_interrupt(emu10k1x_t *emu, emu10k1x_midi_t *midi,
unsigned int status)
{
- unsigned long flags;
unsigned char byte;
if (midi->rmidi == NULL) {
@@ -1285,7 +1284,7 @@
}
spin_unlock(&midi->input_lock);
- spin_lock_irqsave(&midi->output_lock, flags);
+ spin_lock(&midi->output_lock);
if ((status & midi->ipr_tx) && mpu401_output_ready(emu, midi)) {
if (midi->substream_output &&
snd_rawmidi_transmit(midi->substream_output, &byte, 1) ==
1) {
@@ -1294,7 +1293,7 @@
snd_emu10k1x_intr_disable(emu, midi->tx_enable);
}
}
- spin_unlock_irqrestore(&midi->output_lock, flags);
+ spin_unlock(&midi->output_lock);
}
static void snd_emu10k1x_midi_interrupt(emu10k1x_t *emu, unsigned int status)
diff -Nru a/sound/pci/emu10k1/emumpu401.c b/sound/pci/emu10k1/emumpu401.c
--- a/sound/pci/emu10k1/emumpu401.c 2005-03-30 16:15:09 -08:00
+++ b/sound/pci/emu10k1/emumpu401.c 2005-03-30 16:15:09 -08:00
@@ -73,7 +73,6 @@
static void do_emu10k1_midi_interrupt(emu10k1_t *emu, emu10k1_midi_t *midi,
unsigned int status)
{
- unsigned long flags;
unsigned char byte;
if (midi->rmidi == NULL) {
@@ -93,7 +92,7 @@
}
spin_unlock(&midi->input_lock);
- spin_lock_irqsave(&midi->output_lock, flags);
+ spin_lock(&midi->output_lock);
if ((status & midi->ipr_tx) && mpu401_output_ready(emu, midi)) {
if (midi->substream_output &&
snd_rawmidi_transmit(midi->substream_output, &byte, 1) ==
1) {
@@ -102,7 +101,7 @@
snd_emu10k1_intr_disable(emu, midi->tx_enable);
}
}
- spin_unlock_irqrestore(&midi->output_lock, flags);
+ spin_unlock(&midi->output_lock);
}
static void snd_emu10k1_midi_interrupt(emu10k1_t *emu, unsigned int status)
diff -Nru a/sound/pci/ens1370.c b/sound/pci/ens1370.c
--- a/sound/pci/ens1370.c 2005-03-30 16:15:09 -08:00
+++ b/sound/pci/ens1370.c 2005-03-30 16:15:09 -08:00
@@ -2083,14 +2083,13 @@
static void snd_ensoniq_midi_interrupt(ensoniq_t * ensoniq)
{
- unsigned long flags;
snd_rawmidi_t * rmidi = ensoniq->rmidi;
unsigned char status, mask, byte;
if (rmidi == NULL)
return;
/* do Rx at first */
- spin_lock_irqsave(&ensoniq->reg_lock, flags);
+ spin_lock(&ensoniq->reg_lock);
mask = ensoniq->uartm & ES_MODE_INPUT ? ES_RXRDY : 0;
while (mask) {
status = inb(ES_REG(ensoniq, UART_STATUS));
@@ -2099,10 +2098,10 @@
byte = inb(ES_REG(ensoniq, UART_DATA));
snd_rawmidi_receive(ensoniq->midi_input, &byte, 1);
}
- spin_unlock_irqrestore(&ensoniq->reg_lock, flags);
+ spin_unlock(&ensoniq->reg_lock);
/* do Tx at second */
- spin_lock_irqsave(&ensoniq->reg_lock, flags);
+ spin_lock(&ensoniq->reg_lock);
mask = ensoniq->uartm & ES_MODE_OUTPUT ? ES_TXRDY : 0;
while (mask) {
status = inb(ES_REG(ensoniq, UART_STATUS));
@@ -2116,7 +2115,7 @@
outb(byte, ES_REG(ensoniq, UART_DATA));
}
}
- spin_unlock_irqrestore(&ensoniq->reg_lock, flags);
+ spin_unlock(&ensoniq->reg_lock);
}
static int snd_ensoniq_midi_input_open(snd_rawmidi_substream_t * substream)
@@ -2283,7 +2282,6 @@
static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id, struct
pt_regs *regs)
{
- unsigned long flags;
ensoniq_t *ensoniq = dev_id;
unsigned int status, sctrl;
@@ -2294,7 +2292,7 @@
if (!(status & ES_INTR))
return IRQ_NONE;
- spin_lock_irqsave(&ensoniq->reg_lock, flags);
+ spin_lock(&ensoniq->reg_lock);
sctrl = ensoniq->sctrl;
if (status & ES_DAC1)
sctrl &= ~ES_P1_INT_EN;
@@ -2304,7 +2302,7 @@
sctrl &= ~ES_R1_INT_EN;
outl(sctrl, ES_REG(ensoniq, SERIAL));
outl(ensoniq->sctrl, ES_REG(ensoniq, SERIAL));
- spin_unlock_irqrestore(&ensoniq->reg_lock, flags);
+ spin_unlock(&ensoniq->reg_lock);
if (status & ES_UART)
snd_ensoniq_midi_interrupt(ensoniq);
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html