Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Make the readahead-while-sending-output code cond...



details:   https://anonhg.NetBSD.org/src/rev/7eb8ded18fe4
branches:  trunk
changeset: 933526:7eb8ded18fe4
user:      martin <martin%NetBSD.org@localhost>
date:      Tue May 26 13:24:52 2020 +0000

description:
Make the readahead-while-sending-output code conditional in
com_common_putc(), only erquest readahead before interrupts are enabled
and when called from comcnputc().
Fixes PR kern/55286.

diffstat:

 sys/dev/ic/com.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (60 lines):

diff -r 9a88c09e9891 -r 7eb8ded18fe4 sys/dev/ic/com.c
--- a/sys/dev/ic/com.c  Tue May 26 11:43:00 2020 +0000
+++ b/sys/dev/ic/com.c  Tue May 26 13:24:52 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.358 2020/05/01 07:27:51 simonb Exp $ */
+/* $NetBSD: com.c,v 1.359 2020/05/26 13:24:52 martin Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.358 2020/05/01 07:27:51 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.359 2020/05/26 13:24:52 martin Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -159,7 +159,7 @@
 void   com_iflush(struct com_softc *);
 
 int    com_common_getc(dev_t, struct com_regs *);
-static void    com_common_putc(dev_t, struct com_regs *, int);
+static void    com_common_putc(dev_t, struct com_regs *, int, int);
 
 int    cominit(struct com_regs *, int, int, int, tcflag_t);
 
@@ -2399,12 +2399,12 @@
 }
 
 static void
-com_common_putc(dev_t dev, struct com_regs *regsp, int c)
+com_common_putc(dev_t dev, struct com_regs *regsp, int c, int with_readahead)
 {
        int s = splserial();
        int cin, stat, timo;
 
-       if (com_readaheadcount < MAX_READAHEAD
+       if (with_readahead && com_readaheadcount < MAX_READAHEAD
             && ISSET(stat = CSR_READ_1(regsp, COM_REG_LSR), LSR_RXRDY)) {
                int cn_trapped = 0;
                cin = CSR_READ_1(regsp, COM_REG_RXDATA);
@@ -2572,7 +2572,7 @@
 comcnputc(dev_t dev, int c)
 {
 
-       com_common_putc(dev, &comcons_info.regs, c);
+       com_common_putc(dev, &comcons_info.regs, c, cold);
 }
 
 void
@@ -2641,7 +2641,7 @@
 com_kgdb_putc(void *arg, int c)
 {
 
-       com_common_putc(NODEV, &comkgdbregs, c);
+       com_common_putc(NODEV, &comkgdbregs, c, 0);
 }
 #endif /* KGDB */
 



Home | Main Index | Thread Index | Old Index