Date: Sat, 13 May 2006 14:30:30 +0200 From: Holger Kipp <hk@alogis.com> To: "Daniel O'Connor" <doconnor@gsoft.com.au> Cc: freebsd-stable@freebsd.org Subject: Re: Odd RS232 problem Message-ID: <20060513123030.GA32024@intserv.int1.b.intern> In-Reply-To: <200605131413.17020.doconnor@gsoft.com.au> References: <200605131413.17020.doconnor@gsoft.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, May 13, 2006 at 02:13:08PM +0930, Daniel O'Connor wrote: > Hi, > I am trying to talk to a high voltage power supply unit we're using at work, > it uses RS232 and you can read back current, voltage, faults, etc.. > > What I have seems to work fine except that occassionally I get junk read back, > strangely it appears the longer my program runs the more often I see corrupt data. I am not an expert, except that we added another card to our old Server (Dialout) and upgraded from 4.x to 6.x and had very interesting problems, too. The following seemed to help here: First, make sure you have a dedicated IRQ for the card. Then, add options PUC_FASTINTR to your kernel config. If you encounter silo overflows, you might need to increase cp4ticks in sio.c, eg - cp4ticks = speed / 10 / hz * 4; + cp4ticks = speed / 10 / hz * 40; and/or you might want to change hz from 1000 back to 100. This is on old 500MHz-hardware which should be capable of handling a few sios without problems (but generates about 15% irq-load on swi4: clock sio permanently under 6.x). $ ps ax | grep swi 12 ?? WL 1:43.10 [swi1: net] 13 ?? WL 5109:23.82 [swi4: clock sio] 14 ?? WL 0:00.00 [swi3: vm] 16 ?? WL 0:18.64 [swi2: cambio] 17 ?? WL 0:00.00 [swi6: task queue] 18 ?? WL 0:00.00 [swi6: Giant taskq] 19 ?? WL 0:00.00 [swi5: +] 22 ?? WL 0:22.20 [swi0: sio] > The serial card in it is.. > puc0: <Dolphin Peripherals 4036> port 0x9400-0x941f irq 18 at device 13.0 on pci0 > sio4: <Dolphin Peripherals 4036> on puc0 > sio4: type 16550A > sio4: unable to activate interrupt in fast mode - using normal mode > sio5: <Dolphin Peripherals 4036> on puc0 > sio5: type 16550A > sio5: unable to activate interrupt in fast mode - using normal mode > > So, apart from the actual program code everything else is different :) > (Hopefully my next test will reduce the variable space a lot..) We still have some strange issues we did not have with the old card only and FreeBSD 4.x, but at least it is working again without data loss etc. Have you looked at the port speed and if it is changing or has different speeds on both ends? The card together with the modems were really trying very hard to get the data to the other side, and were very good at it, especially with smaller chunks (necessary for dialing and authentication). Problems then started with real traffic going over the line - and we didn't get any errors in messages... My impression is that serial io irq-handling on 6.x needs some improvement (personal feeling: it is much worse then on 4.x). Hope this helps. Regards, Holger Kipp
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060513123030.GA32024>