Re: [PATCH] alsa-driver: portman2x4 code cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Takashi Iwai <tiwai@xxxxxxx> writes:
>> > Also, added cpu_relax() in busy loops, and fixed unneeded
>> > initialization of variables.
>> 
>> Ok, thanks
>> 
>> > The code is now committed to ALSA HG tree.  Please give it a try.
>> 
>> Ah, I just tested and found that the rawmidi open/close callbacks
>> have to be defined and cannot be NULL. So the driver as it is
>> will oops if device will be opened.
>> Fixed this, now tested with amidi input/output on all ports works
>> fine. Patch is below.
>
> Thanks, applied now.
>
>> > BTW, if the driver works for you, we can move this to alsa-kernel tree
>> > so that it's merged to the upstream kernel...
>> 
>> Great, yes I think it can then be moved to alsa-kernel tree.
>
> OK, I'll work on this tomorrow.

Ok, I still found another minor issue. Probably we do not need 
irqsave/irqrestore for the spinlock calls in the interrupt handler.

Matthias

Signed-off-by: Matthias Koenig <mkoenig@xxxxxxx>
=====================================================================
Summary: portman2x4 - do not use irqsave/irqrestore in IRQ handler

Replace spin_lock_irqsave/spin_unlock_irqrestore with
spin_lock/spin_unlock in IRQ handler.

diff -r e2ef37984418 drivers/portman2x4-kernel.c
--- a/drivers/portman2x4-kernel.c	Wed Jan 24 20:46:25 2007 +0100
+++ b/drivers/portman2x4-kernel.c	Thu Jan 25 10:44:44 2007 +0100
@@ -617,11 +617,10 @@ static void snd_portman_interrupt(int ir
 static void snd_portman_interrupt(int irq, void *userdata, struct pt_regs *regs)
 #endif
 {
-	unsigned long flags;
 	unsigned char midivalue = 0;
 	struct portman *pm = ((struct snd_card*)userdata)->private_data;
 
-	spin_lock_irqsave(&pm->reg_lock, flags);
+	spin_lock(&pm->reg_lock);
 
 	/* While any input data is waiting */
 	while ((portman_read_status(pm) & INT_REQ) == INT_REQ) {
@@ -649,7 +648,7 @@ static void snd_portman_interrupt(int ir
 
 	}
 
-	spin_unlock_irqrestore(&pm->reg_lock, flags);
+	spin_unlock(&pm->reg_lock);
 }
 
 static int __devinit snd_portman_probe_port(struct parport *p)
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux