Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Dec 1995 19:35:44 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        andrew@fortress.org, msmith@atrad.adelaide.edu.au
Cc:        hackers@freebsd.org
Subject:   Re: Strange Multi-port SIO behaviour
Message-ID:  <199512030835.TAA16906@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> Andrew Webster stands accused of saying:
>> > > Can you please note the state of the ports when their probes fail? 
>> > > In particular, DCD and rx status info are vital.  Also, enable verbose
>> > > probing (flags & 0x80) on all the ports, and let us know which tests
>> > > fail.

>Well it didn't take long to crash...  Attached you will find the dmesg 
>output from the system after the crash-reboot.  I'd really like to 
>findout why it crashes once every day to 2 days!

At last, an adequate bug report!  (I made verbose probing the default
but someone reversed the flag.  The idea was that you turn the flag off
for nonexistent devices and leave it set for all real devices to get
useful error messages.  This was before the device enable flag and the
-c boot flag existed so it was hard to turn flags off.  Now verbose
error messages should always be printed for all enabled devices and
there is no need for the special sio flag.)

>The following ports were up (DCD asserted) at the time of the crash:

>sio7,8,9,10,11,12,13,14,17

>> At the end of /sys/i386/isa/sio.c:sioprobe() replace
>> 
>> 	return (result);
>> with
>> 	return (IO_COMSIZE);
>> 
>> You'll still get all the setup stuff from the probe, but even if the probe
>> fails, the port should be recognised.

>Any danger the port would be left in some wierd state?

It depends.  In this case the problem seems to be that some ports
inherit pending interrupts from before the crash.  This stops shared
interrupts from working until all the other ports sharing an interrupt
have been probed.  This explains why the last port on each of your
boards is probed successfully.  The second last port is probed
successfully iff the last port doesn't have a pending interrupt...

If this is the problem, then each board is left in a weird state until
after all probes and attaches on it have completed.  Then its state
becomes OK.

Board 1:
>sio4: probe test 3 failed
>sio4 not found at 0x1a0
>...
>sio7 at 0x1b8-0x1bf irq 7 flags 0x781 on isa
>sio7: type 16550A (multiport master)

Board 2:
>sio8: probe test 3 failed
>sio8 not found at 0x140
>...
>sio14 at 0x130-0x137 flags 0xf85 on isa
>sio14: type 16550A (multiport)
>sio15 at 0x138-0x13f irq 9 flags 0xf85 on isa
>sio15: type 16550A (multiport master)

Board 3:
>sio16: probe test 3 failed
>sio16 not found at 0x200
>sio17 at 0x208-0x20f flags 0x1785 on isa
>sio17: type 16550A (multiport)
>...
>sio23 at 0x238-0x23f irq 3 flags 0x1785 on isa
>sio23: type 16550A (multiport master)

This problems should be fixed as a side effect of another fix in -current.

Bruce

----------------------------
revision 1.123
date: 1995/11/29 15:00:07;  author: bde;  state: Exp;  lines: +5 -10
Removed builtin list of port addresses.  The address for sio3
conflicted with S3 graphics cards.  Now users should put sio[2-3]
in the config file if the hardware exisst, even if the probe is
certain to fail due to an interrupt conflict.  Otherwise, ports
sharing the interrupt may fail the probe if the system is warm
booted while sio[2-3] are active (perhaps under another OS).  The
same problem for nonstandard ports is now handled better than
before.
----------------------------
Index: sio.c
===================================================================
RCS file: /a/ncvs/src/sys/i386/isa/sio.c,v
retrieving revision 1.122
retrieving revision 1.123
diff -c -2 -r1.122 -r1.123
*** sio.c	1995/11/29 14:39:57	1.122
--- sio.c	1995/11/29 15:00:07	1.123
***************
*** 32,36 ****
   *
   *	from: @(#)com.c	7.5 (Berkeley) 5/16/91
!  *	$Id: sio.c,v 1.122 1995/11/29 14:39:57 julian Exp $
   */
  
--- 32,36 ----
   *
   *	from: @(#)com.c	7.5 (Berkeley) 5/16/91
!  *	$Id: sio.c,v 1.123 1995/11/29 15:00:07 bde Exp $
   */
  
***************
*** 340,346 ****
  };
  
- /* XXX - configure this list */
- static Port_t likely_com_ports[] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, };
- 
  static struct kern_devconf kdc_sio[NSIO] = { {
  	0, 0, 0,		/* filled in by dev_attach */
--- 340,343 ----
***************
*** 503,507 ****
  {
  	static bool_t	already_init;
- 	Port_t		*com_ptr;
  	bool_t		failures[10];
  	int		fn;
--- 500,503 ----
***************
*** 510,513 ****
--- 506,510 ----
  	u_char		mcr_image;
  	int		result;
+ 	struct isa_device	*xdev;
  
  	sioregisterdev(dev);
***************
*** 520,528 ****
  		 * XXX the gate enable is elsewhere for some multiports.
  		 */
! 		for (com_ptr = likely_com_ports;
! 		     com_ptr < &likely_com_ports[sizeof likely_com_ports
! 						 / sizeof likely_com_ports[0]];
! 		     ++com_ptr)
! 			outb(*com_ptr + com_mcr, 0);
  #if NCRD > 0
  /*
--- 517,523 ----
  		 * XXX the gate enable is elsewhere for some multiports.
  		 */
! 		for (xdev = isa_devtab_tty; xdev->id_driver != NULL; xdev++)
! 			if (xdev->id_driver == &siodriver && xdev->id_enabled)
! 				outb(xdev->id_iobase + com_mcr, 0);
  #if NCRD > 0
  /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512030835.TAA16906>