From owner-svn-src-all@FreeBSD.ORG Wed Jan 30 10:05:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 23C3996B for ; Wed, 30 Jan 2013 10:05:26 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.78]) by mx1.freebsd.org (Postfix) with ESMTP id CC90BBF6 for ; Wed, 30 Jan 2013 10:05:25 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1U0UXk-0008LN-QW for svn-src-all@freebsd.org; Wed, 30 Jan 2013 11:05:25 +0100 Received: from [81.21.138.17] (helo=ronaldradial.versatec.local) by smtp.greenhost.nl with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1U0UXk-0006pP-E9 for svn-src-all@freebsd.org; Wed, 30 Jan 2013 11:05:24 +0100 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: svn-src-all@freebsd.org Subject: Re: svn commit: r246016 - head/sys/dev/uart References: <201301272333.r0RNXhuO031356@svn.freebsd.org> Date: Wed, 30 Jan 2013 11:05:24 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Ronald Klop" Message-ID: In-Reply-To: <201301272333.r0RNXhuO031356@svn.freebsd.org> User-Agent: Opera Mail/12.13 (Win32) X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.0 X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.1 X-Scan-Signature: a6d9551f4f6a9cf0aa9f9bf7e32696d9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 10:05:26 -0000 On Mon, 28 Jan 2013 00:33:43 +0100, Colin Percival wrote: > Author: cperciva > Date: Sun Jan 27 23:33:42 2013 > New Revision: 246016 > URL: http://svnweb.freebsd.org/changeset/base/246016 > > Log: > Add a loader tunable "hw.broken_txfifo" which enables a workaround for > a > bug in old versions of QEMU (and Xen, and other places using QEMU > code). > On those buggy emulated UARTs, the "TX idle" interrupt gets lost; with > this workaround, we spinwait for the TX to happen and then send > ourselves > the interrupt. It's ugly but it works, while minimizing the impact on > the code for the !broken_txfifo case. > MFC after: 2 weeks Would hw.uart.broken_txfifo not be a better name? It looks more in line with the other devices under hw.* and avoids naming collisions. Regards, Ronald. > > Modified: > head/sys/dev/uart/uart_dev_ns8250.c > > Modified: head/sys/dev/uart/uart_dev_ns8250.c > ============================================================================== > --- head/sys/dev/uart/uart_dev_ns8250.c Sun Jan 27 23:21:51 > 2013 (r246015) > +++ head/sys/dev/uart/uart_dev_ns8250.c Sun Jan 27 23:33:42 > 2013 (r246016) > @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > +#include > #include > #include > @@ -845,6 +847,11 @@ ns8250_bus_setsig(struct uart_softc *sc, > return (0); > } > +static int broken_txfifo = 0; > +SYSCTL_INT(_hw, OID_AUTO, broken_txfifo, CTLFLAG_RW | CTLFLAG_TUN, > + &broken_txfifo, 0, "UART FIFO has QEMU emulation bug"); > +TUNABLE_INT("hw.broken_txfifo", &broken_txfifo); > + > static int > ns8250_bus_transmit(struct uart_softc *sc) > { > @@ -862,7 +869,12 @@ ns8250_bus_transmit(struct uart_softc *s > uart_setreg(bas, REG_DATA, sc->sc_txbuf[i]); > uart_barrier(bas); > } > - sc->sc_txbusy = 1; > + if (broken_txfifo) > + ns8250_drain(bas, UART_DRAIN_TRANSMITTER); > + else > + sc->sc_txbusy = 1; > uart_unlock(sc->sc_hwmtx); > + if (broken_txfifo) > + uart_sched_softih(sc, SER_INT_TXIDLE); > return (0); > } > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"