From owner-freebsd-stable@freebsd.org Wed Oct 23 04:37:49 2019 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E95016E3C5 for ; Wed, 23 Oct 2019 04:37:49 +0000 (UTC) (envelope-from bscott@bunyatech.com.au) Received: from ppp221-139.static.internode.on.net (2001-44b8-4170-0a00-0000-0000-0000-0002.static.ipv6.internode.on.net [IPv6:2001:44b8:4170:a00::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "150.101.221.139", Issuer "Bunya Technology Certification Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46yd0B5wrJz4dbj for ; Wed, 23 Oct 2019 04:37:46 +0000 (UTC) (envelope-from bscott@bunyatech.com.au) X-Clacks-Overhead: GNU Terry Pratchett Received: from DHCP.tawonga.bunyatech.com.au (DHCP.tawonga.bunyatech.com.au [10.0.1.78] (may be forged)) (authenticated bits=0) by cope.tawonga.bunyatech.com.au (8.15.2/8.15.2/MSA) with ESMTPSA id x9N4bSw4010254 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK) for ; Wed, 23 Oct 2019 15:37:32 +1100 (AEDT) (envelope-from bscott@bunyatech.com.au) To: freebsd-stable@freebsd.org From: Brian Scott Subject: r352862 with puc serial card driver Message-ID: <65f9e0c2-b6ae-f2f7-461a-3f0eab5c405a@bunyatech.com.au> Date: Wed, 23 Oct 2019 15:37:27 +1100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 Content-Language: en-US X-Rspamd-Queue-Id: 46yd0B5wrJz4dbj X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of bscott@bunyatech.com.au designates 2001:44b8:4170:a00::2 as permitted sender) smtp.mailfrom=bscott@bunyatech.com.au X-Spamd-Result: default: False [0.16 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.36)[-0.364,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2001:44b8:4170:a00::/56]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-stable@freebsd.org]; TO_DN_NONE(0.00)[]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[bunyatech.com.au]; NEURAL_HAM_LONG(-0.43)[-0.432,0]; IP_SCORE(0.26)[asn: 4739(1.29), country: AU(0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:4739, ipnet:2001:44b8::/32, country:AU]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2019 04:37:49 -0000 Hi, I just updated my old workhorse system to r353746 (11.3-STABLE, i386) and one of my serial connections (driving a 1-wire network) stopped working. The card with the serial port is a: puc0@pci0:4:3:0:    class=0x070002 card=0x40371409 chip=0x71681409 rev=0x01 hdr=0x00     vendor     = 'Timedia Technology Co Ltd'     device     = 'PCI2S550 (Dual 16550 UART)'     class      = simple comms     subclass   = UART A ktrace/kdump of the program using the port (around the time when it gets upset) is:  71279 WeatherStation CALL  openat(AT_FDCWD,0x29646010,0x6)  71279 WeatherStation NAMI  "/dev/cuau3"  71279 WeatherStation RET   openat 3  71279 WeatherStation CALL  ioctl(0x3,TIOCGETA,0xbfbfe9c8)  71279 WeatherStation RET   ioctl 0  71279 WeatherStation CALL  ioctl(0x3,TIOCGETA,0xbfbfe9c8)  71279 WeatherStation RET   ioctl 0  71279 WeatherStation CALL  ioctl(0x3,TIOCSETAF,0xbfbfe9c8)  71279 WeatherStation RET   ioctl 0  71279 WeatherStation CALL  ioctl(0x3,TIOCFLUSH,0xbfbfe998)  71279 WeatherStation RET   ioctl 0  71279 WeatherStation CALL  ioctl(0x3,TIOCGETA,0xbfbfe9c4)  71279 WeatherStation RET   ioctl 0  71279 WeatherStation CALL  ioctl(0x3,TIOCSETAF,0xbfbfe9c4)  71279 WeatherStation RET   ioctl 0  71279 WeatherStation CALL  ioctl(0x3,TIOCSBRK,0)  71279 WeatherStation RET   ioctl 0  71279 WeatherStation CALL  select(0,0,0,0,0xbfbfe9b8)  71279 WeatherStation RET   select 0  71279 WeatherStation CALL  ioctl(0x3,TIOCCBRK,0)  71279 WeatherStation RET   ioctl 0  71279 WeatherStation CALL  nanosleep(0xbfbfe9f0,0)  71279 WeatherStation RET   nanosleep 0  71279 WeatherStation CALL  ioctl(0x3,TIOCFLUSH,0xbfbfe9d8)  71279 WeatherStation RET   ioctl 0  71279 WeatherStation CALL  write(0x3,0xbfbfea2d,0x1)  71279 WeatherStation GIO   fd 3 wrote 1 byte        0x0000 c1                                                                                                             |.|  71279 WeatherStation RET   write 1  71279 WeatherStation CALL  ioctl(0x3,TIOCDRAIN,0)  71279 WeatherStation RET   ioctl -1 errno 35 Resource temporarily unavailable  71279 WeatherStation CALL  nanosleep(0xbfbfe9f0,0)  71279 WeatherStation RET   nanosleep 0  71279 WeatherStation CALL  ioctl(0x3,TIOCFLUSH,0xbfbfe9d8)  71279 WeatherStation RET   ioctl 0  71279 WeatherStation CALL  write(0x3,0xbfbfea2d,0x5)  71279 WeatherStation GIO   fd 3 wrote 5 bytes        0x0000 1745 5b0f 91                                                                                                   |.E[..|  71279 WeatherStation RET   write 5  71279 WeatherStation CALL  ioctl(0x3,TIOCDRAIN,0)  71279 WeatherStation RET   ioctl -1 errno 35 Resource temporarily unavailable  71279 WeatherStation CALL  select(0x4,0xbfbfe968,0,0,0xbfbfe960)  71279 WeatherStation RET   select 0  71279 WeatherStation CALL  ioctl(0x3,TIOCSETAF,0x8158b80)  71279 WeatherStation RET   ioctl -1 errno 35 Resource temporarily unavailable  71279 WeatherStation CALL  ioctl(0x3,TIOCFLUSH,0xbfbfe9f8)  71279 WeatherStation RET   ioctl 0  71279 WeatherStation CALL  close(0x3)  71279 WeatherStation RET   close 0 So it looks like problems with TIOCDRAIN on the serial port. Doing some very non-scientific digging around what has changed in recent times, I found r352862 (sys/dev/uart/uart_dev_ns8250.c) that seems to be working in this area. (https://svnweb.freebsd.org/base?view=revision&revision=352862) I backed that change out and now everything is working properly again. What I don't know because I didn't dig any further is if this is a problem with the change or if it's a problem with the puc driver not supporting fields that are then required by the uart code. I know this card will be quite old so it may be that I need to upgrade to something newer at some point. The fact that this change has been in current and has now been merged back to stable sort of suggests that not many other people have the same hardware. It also may be that I'm the only person running a 1-wire network from one of these (very likely) and am therefore the only one seeing this behaviour. Any thoughts? Thanks for reading. Brian