From ebb783b68d13012e7e44fb47055f2ab2dee7f186 Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Wed, 1 Feb 2023 19:12:12 +0100 Subject: linux: Skip probing IDE when 255 phys heads detected This allows qemu -M q35 to boot without 30 second timeout failing on hd0, when disk is actually attached via ahci. --- linux/src/drivers/block/ide.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux/src') diff --git a/linux/src/drivers/block/ide.c b/linux/src/drivers/block/ide.c index 2d0fc77e..67d939a9 100644 --- a/linux/src/drivers/block/ide.c +++ b/linux/src/drivers/block/ide.c @@ -2964,7 +2964,7 @@ static void probe_cmos_for_drives (ide_hwif_t *hwif) unsigned char head = *(BIOS+2); unsigned char sect = *(BIOS+14); unsigned char ctl = *(BIOS+8); - if (cyl > 0 && head > 0 && sect > 0 && sect < 64) { + if (cyl > 0 && head > 0 && sect > 0 && sect < 64 && head < 255) { drive->cyl = drive->bios_cyl = cyl; drive->head = drive->bios_head = head; drive->sect = drive->bios_sect = sect; -- cgit v1.2.3