From c0669fbb6c5ec5393c0345765ef15a7cc46732ce Mon Sep 17 00:00:00 2001 From: imp Date: Thu, 16 Aug 2001 17:30:55 +0000 Subject: [PATCH] Fix the so-called "half-baked-probe" code that I wrote a long time ago to properly clear the interrupt register on the no error case. Also, set the mcr register to zero when we find we can't support the chip. This fixes the hang on sio driver attach problem in the new pci pccard code that some people have reported. At least on my machine. I'd like to get this into 4.4. Submitted by: bde PR: kern/29742 MFC after: 1 day --- sys/dev/sio/sio.c | 2 ++ sys/isa/sio.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 954ebd403a7..67ef253cd81 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -950,11 +950,13 @@ sioprobe(dev, xrid) } else { /* Unknown, Just omit this chip.. XXX */ result = ENXIO; + sio_setreg(com, com_mcr, 0); } } else { /* OK. this is well-known guys */ CLR_FLAG(dev, COM_C_IIR_TXRDYBUG); } + sio_setreg(com, com_ier, 0); sio_setreg(com, com_cfcr, CFCR_8BITS); mtx_unlock_spin(&sio_lock); bus_release_resource(dev, SYS_RES_IOPORT, rid, port); diff --git a/sys/isa/sio.c b/sys/isa/sio.c index 954ebd403a7..67ef253cd81 100644 --- a/sys/isa/sio.c +++ b/sys/isa/sio.c @@ -950,11 +950,13 @@ sioprobe(dev, xrid) } else { /* Unknown, Just omit this chip.. XXX */ result = ENXIO; + sio_setreg(com, com_mcr, 0); } } else { /* OK. this is well-known guys */ CLR_FLAG(dev, COM_C_IIR_TXRDYBUG); } + sio_setreg(com, com_ier, 0); sio_setreg(com, com_cfcr, CFCR_8BITS); mtx_unlock_spin(&sio_lock); bus_release_resource(dev, SYS_RES_IOPORT, rid, port); -- 2.45.2