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
This commit is contained in:
Warner Losh 2001-08-16 17:30:55 +00:00
parent dda035d1fc
commit 1865c617e4
2 changed files with 4 additions and 0 deletions

View File

@ -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);

View File

@ -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);