From: Michael Brown Date: Fri, 10 Feb 2023 23:18:47 +0000 (+0000) Subject: [eisa] Check for system board presence before probing for slots X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F888%2Fhead;p=thirdparty%2Fipxe.git [eisa] Check for system board presence before probing for slots EISA expansion slot I/O port addresses overlap space that may be assigned to PCI devices, which can lead to register reads and writes with unwanted side effects during EISA probing. Reduce the chances of performing EISA probing on PCI devices by probing EISA slot vendor and product ID registers only if the EISA system board vendor ID register indicates that the motherboard supports EISA. Debugged-by: Václav Ovsík Tested-by: Václav Ovsík Signed-off-by: Michael Brown --- diff --git a/src/drivers/bus/eisa.c b/src/drivers/bus/eisa.c index a4efe2621..68837eb4d 100644 --- a/src/drivers/bus/eisa.c +++ b/src/drivers/bus/eisa.c @@ -98,8 +98,16 @@ static void eisa_remove ( struct eisa_device *eisa ) { static int eisabus_probe ( struct root_device *rootdev ) { struct eisa_device *eisa = NULL; unsigned int slot; + uint8_t system; int rc; + /* Check for EISA system board */ + system = inb ( EISA_VENDOR_ID ); + if ( system & 0x80 ) { + DBG ( "No EISA system board (read %02x)\n", system ); + return -ENODEV; + } + for ( slot = EISA_MIN_SLOT ; slot <= EISA_MAX_SLOT ; slot++ ) { /* Allocate struct eisa_device */ if ( ! eisa )