Re: i810_audio ? (possible patch)

From: Mario Mikocevic (mozgy@hinet.hr)
Date: Fri Nov 30 2001 - 04:38:49 EST


Hi,

On Wed, Nov 28, 2001 at 10:38:14AM +0000, Alan Cox wrote:
> If I had it handy I would

Well, I checked 17pre1 and does _not_ fix my problem.
Included patch does make the difference.
No more oopses and all bitrates work in realproducer.
(it's filtered from RH's -ac kernel i810_audio.c)

(I took the liberty of upping th version to 0.04a :)

--- i810_audio.c-2.4.17-pre1 Thu Nov 29 13:53:26 2001
+++ i810_audio.c Fri Nov 30 10:30:45 2001
@@ -197,7 +197,7 @@
 #define INT_MASK (INT_SEC|INT_PRI|INT_MC|INT_PO|INT_PI|INT_MO|INT_NI|INT_GPI)
 
 
-#define DRIVER_VERSION "0.04"
+#define DRIVER_VERSION "0.04a"
 
 /* magic numbers to protect our data structures */
 #define I810_CARD_MAGIC 0x5072696E /* "Prin" */
@@ -1231,7 +1231,6 @@
         unsigned long flags;
         unsigned int swptr;
         int cnt;
- DECLARE_WAITQUEUE(waita, current);
 
 #ifdef DEBUG2
         printk("i810_audio: i810_read called, count = %d\n", count);
@@ -1257,7 +1256,6 @@
         dmabuf->trigger &= ~PCM_ENABLE_OUTPUT;
         ret = 0;
 
- add_wait_queue(&dmabuf->wait, &waita);
         while (count > 0) {
                 spin_lock_irqsave(&card->lock, flags);
                 if (PM_SUSPENDED(card)) {
@@ -1322,7 +1320,7 @@
 
                 if (copy_to_user(buffer, dmabuf->rawbuf + swptr, cnt)) {
                         if (!ret) ret = -EFAULT;
- goto done;
+ return ret;
                 }
 
                 swptr = (swptr + cnt) % dmabuf->dmasize;
@@ -1344,10 +1342,6 @@
         i810_update_lvi(state,1);
         if(!(dmabuf->enable & ADC_RUNNING))
                 start_adc(state);
- done:
- set_current_state(TASK_RUNNING);
- remove_wait_queue(&dmabuf->wait, &waita);
-
         return ret;
 }
 
@@ -1362,7 +1356,6 @@
         unsigned long flags;
         unsigned int swptr = 0;
         int cnt, x;
- DECLARE_WAITQUEUE(waita, current);
 
 #ifdef DEBUG2
         printk("i810_audio: i810_write called, count = %d\n", count);
@@ -1387,7 +1380,6 @@
         dmabuf->trigger &= ~PCM_ENABLE_INPUT;
         ret = 0;
 
- add_wait_queue(&dmabuf->wait, &waita);
         while (count > 0) {
                 spin_lock_irqsave(&state->card->lock, flags);
                 if (PM_SUSPENDED(card)) {
@@ -1427,7 +1419,7 @@
                         }
                         if (file->f_flags & O_NONBLOCK) {
                                 if (!ret) ret = -EAGAIN;
- goto ret;
+ return ret;
                         }
                         /* Not strictly correct but works */
                         tmo = (dmabuf->dmasize * HZ) / (dmabuf->rate * 4);
@@ -1451,13 +1443,13 @@
                         }
                         if (signal_pending(current)) {
                                 if (!ret) ret = -ERESTARTSYS;
- goto ret;
+ return ret;
                         }
                         continue;
                 }
                 if (copy_from_user(dmabuf->rawbuf+swptr,buffer,cnt)) {
                         if (!ret) ret = -EFAULT;
- goto ret;
+ return ret;
                 }
 
                 swptr = (swptr + cnt) % dmabuf->dmasize;
@@ -1483,9 +1475,6 @@
         i810_update_lvi(state,0);
         if (!dmabuf->enable && dmabuf->count >= dmabuf->userfragsize)
                 start_dac(state);
- ret:
- set_current_state(TASK_RUNNING);
- remove_wait_queue(&dmabuf->wait, &waita);
 
         return ret;
 }

-- 
Mario Mikočević (Mozgy)
mozgy at hinet dot hr
My favourite FUBAR ...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Nov 30 2001 - 21:00:37 EST