From owner-freebsd-bugs@FreeBSD.ORG Thu Jun 10 21:11:57 2010 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EA601065672 for ; Thu, 10 Jun 2010 21:11:57 +0000 (UTC) (envelope-from mayo@oyam.ca) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 390368FC18 for ; Thu, 10 Jun 2010 21:11:56 +0000 (UTC) Received: by pwj1 with SMTP id 1so210345pwj.13 for ; Thu, 10 Jun 2010 14:11:56 -0700 (PDT) Received: by 10.142.151.11 with SMTP id y11mr566470wfd.77.1276204315619; Thu, 10 Jun 2010 14:11:55 -0700 (PDT) Received: from [192.168.167.143] (a221-smpafs01.blockb-142.stargate.ca [208.118.142.221]) by mx.google.com with ESMTPS id d20sm4326487waa.15.2010.06.10.14.11.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 10 Jun 2010 14:11:53 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Mayo Jordanov In-Reply-To: Date: Thu, 10 Jun 2010 14:11:51 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <8970AF12-B477-4DF3-9341-4B2ED399EEC5@oyam.ca> References: <201006041900.o54J0DmB099738@freefall.freebsd.org> <694FC835-8D12-402C-941D-CADFBE8D5961@oyam.ca> To: Garrett Cooper X-Mailer: Apple Mail (2.1078) Cc: freebsd-bugs@freebsd.org Subject: Re: kern/147082: [uart] Serial ports unusable X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 21:11:57 -0000 On 2010-06-04, at 20:47 , Garrett Cooper wrote: > On Fri, Jun 4, 2010 at 5:28 PM, Mayo Jordanov wrote: >> Hi Andy, >>=20 >> Thanks for the suggestion. I have all my ports mapped directly as you = have, and I also tried setting the bios to reserve the IRQs so nothing = else gets to use them. >>=20 >> Thank you for the suggestions and keeping an eye on this. >> mayo >>=20 >> On 2010-06-04, at 16:43 , Andy Farkas wrote: >>=20 >>> On Sat, Jun 5, 2010 at 5:00 AM, Mayo Jordanov wrote: >>>>=20 >>>> One more report, I loaded FreeBSD 6.4 on this machine, and the = serial =3D >>>> ports work without any problems.=3D >>>>=20 >>>=20 >>> Hi Mayo, >>>=20 >>> You might remember that I was having this problem as well, no output = on >>> serial ports, on my HP ProLiant ML 100 box. >>>=20 >>> I solved it by going into BIOS and explicitly setting the COM ports = to >>> 3F8/4 and 2F8/3. They were set to AUTO before. As a side note, when = set >>> to AUTO, COM2 did not show up in dmesg. >>>=20 >>> What are your BIOS settings? >=20 > Was this an upgrade or a fresh install? If it was an upgrade, what > version of FreeBSD did you upgrade from? Can you please provide your > device.hints file? > Thanks, > -Garrett Hi Garrett, I started looking at the code a bit. I'm not very experienced with inner = workings of serial or kernel drivers, but here are a few observations I = made: With the uart in current state and terminal application on each end = (using cuau3 atm), the FreeBSD side gets DTR, RTS On and CD, DST, CTS, = RI are off. If I change device.hints and set flags for the port and add = 0x100 to it (UART_FLAGS_FCR_RX_LOW) followed by a reboot and repeat the = setup, I get: DST, CTS, DTR, RTS on and CD, RI off.=20 The odd thing there is even at this point if I connect two terminal = applications and turn off flow control, I can't get them to send stuff = back and forth. So, the signals on port are detected, but there is still = something that prevents data to be sent/received. I see the data arrive = on the pins when I scope them, so the data must be lost somewhere in = software. I've noticed this when I compared the 6.4 sio driver with 7.3's sio = driver. 6.4 uses FIFO_RX_LOW, whereas 7 switched to using FIFO_RX_HIGH. = In 7.x the driver doesn't work and reports silo overflows. Changing the = FIFO_RX_HIGH to FIFO_RX_LOW (sio.c line 976 -- "sio_setreg(com, = com_fifo, FIFO_ENABLE | FIFO_RX_HIGH);" ) fixes things in 7.x and then = works same as in 6.4.w Similarly, there are quite a few differences in how some of the other = registers are setup in _attach, _probe and other functions. There are = definitely more DELAY calls in the old driver. Like I said, I'm not very = familiar with lower levels of serial comms or I'm not sure what exactly = this means for the driver, but may give you some ideas. Also, opening = /dev/cuau* devices is quick, but closing them always times out in = ttyclos() (when exiting kermit, etc). Thanks, mayo