From: Frank Davis <fdavis@si.rr.com>
To: linux-kernel@vger.kernel.org
Cc: fdavis@si.rr.com
Subject: [PATCH] 2.5.53 : drivers/net/wan/x25_asy.c
Date: Sat, 28 Dec 2002 20:04:21 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.44.0212282000520.952-100000@linux-dev> (raw)
Hello all,
The attached patch swaps the save_flags/cli/restore_flags combo with a
spinlock. Please review.
Regards,
Frank
--- linux/drivers/net/wan/x25_asy.c.old Sat Dec 28 18:49:00 2002
+++ linux/drivers/net/wan/x25_asy.c Sat Dec 28 18:54:51 2002
@@ -33,6 +33,7 @@
#include <linux/lapb.h>
#include <linux/init.h>
#include "x25_asy.h"
+#include <linux/spinlock.h>
typedef struct x25_ctrl {
struct x25_asy ctrl; /* X.25 things */
@@ -40,6 +41,7 @@
} x25_asy_ctrl_t;
static x25_asy_ctrl_t **x25_asy_ctrls = NULL;
+static spinlock_t x25_asy_slock = SPIN_LOCK_UNLOCKED;
int x25_asy_maxdev = SL_NRUNIT; /* Can be overridden with insmod! */
@@ -164,8 +166,7 @@
return;
}
- save_flags(flags);
- cli();
+ spin_lock_irqsave(&x25_asy_slock, flags);
oxbuff = sl->xbuff;
sl->xbuff = xbuff;
@@ -195,7 +196,7 @@
sl->buffsize = len;
- restore_flags(flags);
+ spin_unlock_irqrestore(&x25_asy_slock, flags);
if (oxbuff != NULL)
kfree(oxbuff);
next reply other threads:[~2002-12-29 1:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-29 1:04 Frank Davis [this message]
2002-12-30 1:17 ` [PATCH] 2.5.53 : drivers/net/wan/x25_asy.c Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.44.0212282000520.952-100000@linux-dev \
--to=fdavis@si.rr.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox