[svn-commits] sruffell: linux/trunk r8375 - in /linux/trunk/drivers/dahdi: voicebus/ wctdm2...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Mar 22 04:20:40 CDT 2010


Author: sruffell
Date: Mon Mar 22 04:20:37 2010
New Revision: 8375

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8375
Log:
wcte12xp, wctdm24xxp: Do not keep individual free lists for VPM commands.

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

Modified: linux/trunk/drivers/dahdi/voicebus/GpakCust.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/voicebus/GpakCust.c?view=diff&rev=8375&r1=8374&r2=8375
==============================================================================
--- linux/trunk/drivers/dahdi/voicebus/GpakCust.c (original)
+++ linux/trunk/drivers/dahdi/voicebus/GpakCust.c Mon Mar 22 04:20:37 2010
@@ -72,21 +72,12 @@
 
 static struct vpmadt032_cmd *vpmadt032_get_free_cmd(struct vpmadt032 *vpm)
 {
-	unsigned long flags;
 	struct vpmadt032_cmd *cmd;
 	might_sleep();
-	spin_lock_irqsave(&vpm->list_lock, flags);
-	if (list_empty(&vpm->free_cmds)) {
-		spin_unlock_irqrestore(&vpm->list_lock, flags);
-		cmd = kmalloc(sizeof(struct vpmadt032_cmd), GFP_KERNEL);
-		if (unlikely(!cmd))
-			return NULL;
-		memset(cmd, 0, sizeof(*cmd));
-	} else {
-		cmd = list_entry(vpm->free_cmds.next, struct vpmadt032_cmd, node);
-		list_del_init(&cmd->node);
-		spin_unlock_irqrestore(&vpm->list_lock, flags);
-	}
+	cmd = kmalloc(sizeof(struct vpmadt032_cmd), GFP_KERNEL);
+	if (unlikely(!cmd))
+		return NULL;
+	memset(cmd, 0, sizeof(*cmd));
 	init_completion(&cmd->complete);
 	return cmd;
 }
@@ -140,8 +131,9 @@
 	ret = wait_for_completion_timeout(&cmd->complete, HZ/5);
 	if (unlikely(!ret)) {
 		spin_lock_irqsave(&vpm->list_lock, flags);
-		list_add_tail(&cmd->node, &vpm->free_cmds);
+		list_del(&cmd->node);
 		spin_unlock_irqrestore(&vpm->list_lock, flags);
+		kfree(cmd);
 		return -EIO;
 	}
 
@@ -151,10 +143,8 @@
 		ret = 0;
 	}
 
-	/* Just throw this command back on the ready list. */
-	spin_lock_irqsave(&vpm->list_lock, flags);
-	list_add_tail(&cmd->node, &vpm->free_cmds);
-	spin_unlock_irqrestore(&vpm->list_lock, flags);
+	list_del(&cmd->node);
+	kfree(cmd);
 	return 0;
 }
 
@@ -532,7 +522,6 @@
 	spin_lock_init(&vpm->list_lock);
 	spin_lock_init(&vpm->change_list_lock);
 	INIT_LIST_HEAD(&vpm->change_list);
-	INIT_LIST_HEAD(&vpm->free_cmds);
 	INIT_LIST_HEAD(&vpm->pending_cmds);
 	INIT_LIST_HEAD(&vpm->active_cmds);
 	sema_init(&vpm->sem, 1);
@@ -714,7 +703,6 @@
 	spin_lock_irqsave(&vpm->list_lock, flags);
 	list_splice(&vpm->pending_cmds, &local_list);
 	list_splice(&vpm->active_cmds, &local_list);
-	list_splice(&vpm->free_cmds, &local_list);
 	spin_unlock_irqrestore(&vpm->list_lock, flags);
 
 	while (!list_empty(&local_list)) {

Modified: linux/trunk/drivers/dahdi/voicebus/GpakCust.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/voicebus/GpakCust.h?view=diff&rev=8375&r1=8374&r2=8375
==============================================================================
--- linux/trunk/drivers/dahdi/voicebus/GpakCust.h (original)
+++ linux/trunk/drivers/dahdi/voicebus/GpakCust.h Mon Mar 22 04:20:37 2010
@@ -118,8 +118,6 @@
 	spinlock_t change_list_lock;
 	struct list_head change_list;
 	spinlock_t list_lock;
-	/* Commands that are ready to be used. */
-	struct list_head free_cmds;
 	/* Commands that are waiting to be processed. */
 	struct list_head pending_cmds;
 	/* Commands that are currently in progress by the VPM module */

Modified: linux/trunk/drivers/dahdi/wctdm24xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=8375&r1=8374&r2=8375
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/base.c Mon Mar 22 04:20:37 2010
@@ -785,8 +785,7 @@
 	cmd->data = (0xff & readchunk[CMD_BYTE(25, 1, 0)]) << 8;
 	cmd->data |= readchunk[CMD_BYTE(25, 2, 0)];
 	if (cmd->desc & __VPM150M_WR) {
-		/* Writes do not need any acknowledgement */
-		list_add_tail(&cmd->node, &vpm->free_cmds);
+		kfree(&cmd->node);
 	} else {
 		cmd->desc |= __VPM150M_FIN;
 		complete(&cmd->complete);

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=8375&r1=8374&r2=8375
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/base.c Mon Mar 22 04:20:37 2010
@@ -258,8 +258,7 @@
 	cmd->data  = (0xff & readchunk[CMD_BYTE(2, 1, 1)]) << 8;
 	cmd->data |= readchunk[CMD_BYTE(2, 2, 1)];
 	if (cmd->desc & __VPM150M_WR) {
-		/* Writes do not need any acknowledgement */
-		list_add_tail(&cmd->node, &vpm->free_cmds);
+		kfree(&cmd->node);
 	} else {
 		cmd->desc |= __VPM150M_FIN;
 		complete(&cmd->complete);




More information about the svn-commits mailing list