hang in sio driver when interrupt occurs while in siocnputc()

Don Bowman don at sandvine.com
Sun Aug 10 12:17:02 PDT 2003


I propose this patch, which solves my issue. Comments?

$ cvs diff -U3 sio.c 
Index: sio.c
===================================================================
RCS file: /usr/cvs/src/sys/isa/Attic/sio.c,v
retrieving revision 1.291.2.33.1000.4
diff -U3 -r1.291.2.33.1000.4 sio.c
--- sio.c       13 May 2003 23:51:23 -0000      1.291.2.33.1000.4
+++ sio.c       10 Aug 2003 18:11:37 -0000
@@ -274,6 +274,7 @@
        struct termios  lt_in;  /* should be in struct tty */
        struct termios  lt_out;
 
+       bool_t  in_polled_mode;
        bool_t  do_timestamp;
        bool_t  do_dcd_timestamp;
        struct timeval  timestamp;
@@ -1985,6 +1986,10 @@
        struct  timecounter *tc;
        u_int   count;
 
+       if (com->in_polled_mode) {
+               return;
+       }
+
        int_ctl = inb(com->intr_ctl_port);
        int_ctl_new = int_ctl;
 
@@ -3085,6 +3090,9 @@
        sp->ier = inb(iobase + com_ier);
        outb(iobase + com_ier, 0);      /* spltty() doesn't stop siointr()
*/
        siocntxwait(iobase);
+       if (com_addr(comconsole)) {
+           (com_addr(comconsole))->in_polled_mode = TRUE;
+       }
        sp->cfcr = inb(iobase + com_cfcr);
        outb(iobase + com_cfcr, CFCR_DLAB | CFCR_8BITS);
        sp->dlbl = inb(iobase + com_dlbl);
@@ -3132,6 +3140,9 @@
         */
        outb(iobase + com_mcr, sp->mcr | MCR_DTR | MCR_RTS);
        outb(iobase + com_ier, sp->ier);
+       if (com_addr(comconsole)) {
+           (com_addr(comconsole))->in_polled_mode = FALSE;
+       }
 }
 
 static void


More information about the freebsd-hackers mailing list