[svn-commits] sruffell: linux/trunk r8455 - /linux/trunk/drivers/dahdi/wcte12xp/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Apr 2 19:04:05 CDT 2010


Author: sruffell
Date: Fri Apr  2 19:03:58 2010
New Revision: 8455

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8455
Log:
wcte12xp: Use our own workqueue for the timer and maint events.

When the latency is large and register reads can take 100s of milliseconds, the
alarm polling function could tie up one of the global workqueue threads long
enough to interfere with other system operations.  Most noticeably the console.
DAHDI-573

Modified:
    linux/trunk/drivers/dahdi/wcte12xp/base.c
    linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h

Modified: linux/trunk/drivers/dahdi/wcte12xp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcte12xp/base.c?view=diff&rev=8455&r1=8454&r2=8455
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/base.c Fri Apr  2 19:03:58 2010
@@ -696,6 +696,7 @@
 		list_del_init(&cmd->node);
 		free_cmd(wc, cmd);
 	}
+	destroy_workqueue(wc->wq);
 	kfree(wc);
 }
 
@@ -1263,7 +1264,7 @@
 #else
 	INIT_WORK(&work->work, t1xxp_maint_work);
 #endif
-	schedule_work(&work->work);
+	queue_work(wc->wq, &work->work);
 	return 0;
 }
 
@@ -1924,7 +1925,7 @@
 te12xp_timer(unsigned long data)
 {
 	struct t1 *wc = (struct t1 *)data;
-	schedule_work(&wc->timer_work);
+	queue_work(wc->wq, &wc->timer_work);
 	return;
 }
 
@@ -1995,6 +1996,12 @@
 		return res;
 	}
 	
+	wc->wq = create_singlethread_workqueue(wc->name);
+	if (!wc->wq) {
+		kfree(wc);
+		return -ENOMEM;
+	}
+
 	if (VOICEBUS_DEFAULT_LATENCY != latency) {
 		voicebus_set_minlatency(&wc->vb, latency);
 		voicebus_set_maxlatency(&wc->vb, max_latency);
@@ -2049,7 +2056,7 @@
 #endif
 	clear_bit(INITIALIZED, &wc->bit_flags);
 	del_timer_sync(&wc->timer);
-	flush_scheduled_work();
+	flush_workqueue(wc->wq);
 	del_timer_sync(&wc->timer);
 
 	voicebus_release(&wc->vb);

Modified: linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h?view=diff&rev=8455&r1=8454&r2=8455
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h Fri Apr  2 19:03:58 2010
@@ -135,6 +135,7 @@
 	struct list_head active_cmds;
 	struct timer_list timer;
 	struct work_struct timer_work;
+	struct workqueue_struct *wq;
 };
 
 #define t1_info(t1, format, arg...)         \




More information about the svn-commits mailing list