https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255072

--- Comment #50 from sp...@itl.ua ---
(In reply to Toomas Soome from comment #45)

> Unfortunately, with those legacy cases, we really can not fix it just by 
> reading and changing the code -- we need to understand under which conditions
> the problem is appearing and then figure how to fix it. Meaning, debug 
> printouts need to be inserted and it is long cycle of tests.... and 
> unfortunately, those tests need to be performed on that specific hardware.

BTW, I had done this investigation already, with all those printouts, long
cycle of tests and finally locating the exact point and conditions when boot
fails.
The issue is obviously in BIOS code and has stochastic behavior as it occurs
due to (seems) some race condition.
My comprehensive tests had shown that in no way the FreeBSD loader code causes
the failure (I've tested 11.2-RELEASE and 12.3-RELEASE).
The failure occurs exclusively inside of bd_edd_io() or bd_int13probe(), though
far not every call of these functions. This conclusion is based on result of
debug printf()'s: right before these calls and right after of them. Sometimes
(randomly) these functions do not return (no exit debug message), approximately
once per several tens of calls (proved by print()'s with incrementing number
after each such call, and this number is always random one), without any
regularity, so it is like some race condition.
bd_edd_io() and bd_int13probe() call BIOS INT 13H, so it appears to be the
cause of the failure.
The reason why 11.2 loader seems to not having this issue (it boots normally)
is just the fact it calls INT 13H just several times (about 6 or so) and almost
always the race condition does not occur and boot goes normally (proved by
incrementing count of bd_int13probe() calls - boot fails).
Contrarily, 12.3 loader, due to zfs probing, has over hundred of INT 13H calls
so earlier or sooner INT 13H runs into the race condition and boot fails.

Just to remember, the failure occurs when three conditions are met:
1) Legacy boot
2) AHCI mode
3) USB flash drive inserted
In these conditions, boot fails regardless of the device from which boot is
preformed, whether it is USB Drive or HDD. So conclusion is: BIOS 13H handler
incorrectly handles HDD+FlashDrive combination in AHCI mode.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to