Re: [PATCH][ATM] assorted he driver cleanup

From: chas williams (chas@cmf.nrl.navy.mil)
Date: Wed Jun 18 2003 - 16:08:10 EST


In message <20030602004232.A25795@electric-eye.fr.zoreil.com>,Francois Romieu w
rites:
>An unconditional HE_SPIN_UNLOCK(he_dev, flags); stands behind the
>'close_tx_incomplete' label in he_close(). The following patch should cure
>a possible unlock of a non-locked lock (courtesy of kbugs.org, see
>http://kbugs.org/cgi-bin/index.py?page=source&version=2.5.70&file=drivers/atm/
>he.c#line2840).

dave, please apply the following patch:

[atm]: he: cure possible unlock of a non-locked lock

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.1333 -> 1.1334
# drivers/atm/he.c 1.15 -> 1.16
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/06/18 chas@relax.cmf.nrl.navy.mil 1.1334
# fix possible unlock of a non-locked lock
# --------------------------------------------
#
diff -Nru a/drivers/atm/he.c b/drivers/atm/he.c
--- a/drivers/atm/he.c Wed Jun 18 17:07:21 2003
+++ b/drivers/atm/he.c Wed Jun 18 17:07:21 2003
@@ -2685,12 +2685,13 @@
                 remove_wait_queue(&he_vcc->tx_waitq, &wait);
                 set_current_state(TASK_RUNNING);
 
+ spin_lock_irqsave(&he_dev->global_lock, flags);
+
                 if (timeout == 0) {
                         hprintk("close tx timeout cid 0x%x\n", cid);
                         goto close_tx_incomplete;
                 }
 
- spin_lock_irqsave(&he_dev->global_lock, flags);
                 while (!((tsr4 = he_readl_tsr4(he_dev, cid)) & TSR4_SESSION_ENDED)) {
                         HPRINTK("close tx cid 0x%x !TSR4_SESSION_ENDED (tsr4 = 0x%x)\n", cid, tsr4);
                         udelay(250);
-
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 : Mon Jun 23 2003 - 22:00:26 EST