PPP Crash

Richard B. Johnson (root@analogic.com)
Mon, 28 Apr 1997 22:17:50 -0400 (EDT)


The following patch __seems__ to fix a problem with my SMP machine crashing
when PPP Disconnects. It adds one more "save_flags, restore_flags" before
an existing cli/sti and also makes the others uniform by using "__u32".

--- /usr/src/linux-2.1.36/drivers/net/ppp.c.orig Wed Apr 23 01:42:50 1997
+++ /usr/src/linux-2.1.36/drivers/net/ppp.c Mon Apr 28 17:24:28 1997
@@ -522,7 +522,7 @@
lock_buffer (register struct ppp_buffer *buf)
{
register int state;
- int flags;
+ __u32 flags;
/*
* Save the current state and if free then set it to the "busy" state
*/
@@ -558,6 +558,7 @@
struct ppp_buffer *old_tbuf;

int mtu, mru;
+ __u32 flags;
/*
* Allocate the buffer from the kernel for the data
*/
@@ -599,6 +600,7 @@
/*
* Update the pointers to the new buffer structures.
*/
+ save_flags(flags);
cli ();
old_wbuf = ppp->wbuf;
old_rbuf = ppp->rbuf;
@@ -633,7 +635,7 @@
ppp->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP);
ppp->flags &= ~SC_XMIT_BUSY;

- sti ();
+ restore_flags(flags);
/*
* Release old buffer pointers
*/
@@ -859,16 +861,18 @@
struct ppp_buffer *xbuf)
{
register int count, actual;
+ __u32 flags;
/*
* Prevent re-entrancy by ensuring that this routine is called only once.
*/
+ save_flags(flags);
cli ();
if (ppp->flags & SC_XMIT_BUSY) {
- sti ();
+ restore_flags(flags);
return;
}
ppp->flags |= SC_XMIT_BUSY;
- sti ();
+ restore_flags(flags);
/*
* Send the next block of data to the modem
*/
@@ -915,6 +919,7 @@
/*
* Look at the priorities. Choose a daemon write over the device driver.
*/
+ save_flags(flags);
cli();
xbuf = ppp->s1buf;
ppp->s1buf = NULL;
@@ -922,7 +927,7 @@
xbuf = ppp->s2buf;
ppp->s2buf = NULL;
}
- sti();
+ restore_flags(flags);
/*
* If there is a pending buffer then transmit it now.
*/
@@ -979,7 +984,7 @@
static void
ppp_kick_tty (struct ppp *ppp, struct ppp_buffer *xbuf)
{
- register int flags;
+ __u32 flags;
/*
* Hold interrupts.
*/

Cheers,
Dick Johnson
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Richard B. Johnson
Project Engineer
Analogic Corporation
Voice : (508) 977-3000 ext. 3754
Fax : (508) 532-6097
Modem : (508) 977-6870
Ftp : ftp@boneserver.analogic.com
Email : rjohnson@analogic.com, johnson@analogic.com
Penguin : Linux version 2.1.35 on an i586 machine (66.15 BogoMips).
Warning : I read unsolicited mail for $350.00 per hour. Supply billing address.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-