grub/grub-core
Stefan Fritsch 566a03a623 ahci: Improve error handling
Check the error bits in the interrupt status register. According to the
AHCI 1.2 spec, "Interrupt sources that are disabled (‘0’) are still
reflected in the status registers.", so this should work even though
grub uses polling

This fixes the following problem on a Fujitsu E744 laptop:

Sometimes there is a very long delay (up to several minutes) when
booting from hard disk. It seems accessing the DVD drive (which has no
disk inserted) sometimes fails with some errors, which leads to each
access being stalled until the 20s timeout triggers. This seems to
happen when grub is trying to read filesystem/partition data.

The problem is that the command_issue bit that is checked in the loop is
only reset if the "HBA receives a FIS which clears the BSY, DRQ, and ERR
bits for the command", but the ERR bit is never cleared. Therefore
command_issue is never reset and grub waits for the timeout.

The relevant bit in our case is the Task File Error Status (TFES), which
is equivalent to the ERR bit 0 in tfd. But this patch also checks
the other error bits except for the "Interface non-fatal error status"
bit.

Signed-off-by: Stefan Fritsch <fritsch@genua.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2018-01-29 12:53:24 +01:00
..
boot sparc64: Close cdboot ihandle 2017-05-18 21:58:15 +02:00
bus ehci: Fix compilation on i386 2017-07-09 21:31:19 +02:00
commands ls: prevent double open 2017-11-24 16:18:29 +01:00
disk ahci: Improve error handling 2018-01-29 12:53:24 +01:00
efiemu i386, x86_64, ppc: fix switch fallthrough cases with GCC7 2017-04-04 19:23:55 +03:00
font Document intentional fallthroughs. 2015-01-27 17:17:58 +01:00
fs xfs: Don't attempt to iterate over empty directory. 2017-08-30 15:56:19 +02:00
gdb i386, x86_64, ppc: fix switch fallthrough cases with GCC7 2017-04-04 19:23:55 +03:00
gettext * grub-core/gettext/gettext.c (main_context), (secondary_context): 2013-11-07 01:01:47 +01:00
gfxmenu gfxmenu: fix memory leak 2016-01-12 21:52:50 +03:00
gnulib i386, x86_64, ppc: fix switch fallthrough cases with GCC7 2017-04-04 19:23:55 +03:00
hello * grub-core/commands/gptsync.c: Fix typographic quoting. 2012-03-03 13:05:08 +01:00
hook * grub-core/hook/datehook.c (grub_read_hook_datetime): Small stylistic 2011-11-11 21:03:49 +01:00
io gzio: fix unaligned access 2017-08-30 21:31:28 +02:00
kern tsc: Change default tsc calibration method to pmtimer on EFI systems 2017-10-06 16:58:55 +02:00
lib efi: Move grub_reboot() into kernel 2017-09-07 23:29:31 +02:00
loader arm64/xen: Add missing #address-cells and #size-cells properties 2017-12-06 13:02:34 +01:00
mmap Translate UEFI persistent memory type 2015-12-15 10:25:34 +03:00
net Add Virtual LAN support. 2017-05-03 13:03:50 +02:00
normal core: use GRUB_TERM_ definitions when handling term characters 2017-08-07 19:28:22 +02:00
osdep unix exec: avoid atexit handlers when child exits 2017-08-30 15:20:13 +02:00
partmap disk/ldm, partmap/msdos.c: fix spelling error 2015-08-22 21:22:41 +02:00
parttool * grub-core/net/http.c: Add TRANSLATORS comments. 2012-03-05 16:42:26 +01:00
script yylex: Explicilty cast fprintf to void. 2017-08-14 14:11:43 +02:00
term core: use GRUB_TERM_ definitions when handling term characters 2017-08-07 19:28:22 +02:00
tests Regenerate checksum.h with newer unifont. 2017-08-30 17:12:04 +02:00
video coreboot: Split parts that are platform-independent. 2017-05-08 19:10:24 +02:00
gdb_grub.in * grub-core/gdb_grub.in: Fix overflow and wrong field. 2013-10-14 03:40:20 +02:00
genemuinit.sh use MODULE_FILES for genemuinit* instead of MOD_FILES 2014-01-18 23:15:40 +04:00
genemuinitheader.sh use MODULE_FILES for genemuinit* instead of MOD_FILES 2014-01-18 23:15:40 +04:00
genmod.sh.in Fix shebang for termux. 2017-05-03 12:49:31 +02:00
genmoddep.awk enforcing fixup 2017-08-14 16:27:10 +02:00
gensyminfo.sh.in Fix shebang for termux. 2017-05-03 12:49:31 +02:00
gensymlist.sh Make 'make check' work on emu. 2013-04-27 02:00:16 +02:00
gentrigtables.c * grub-core/gentrigtables.c: Make tables const. 2013-03-01 11:15:09 +01:00
gmodule.pl.in * grub-core/gmodule.pl.in: Accept newer binutils which output 2014-09-21 18:23:23 +02:00
gnulib-fix-gcc7-fallthrough.diff Add gnulib-fix-gcc7-fallthrough.diff 2017-04-04 19:37:47 +03:00
gnulib-fix-null-deref.diff Import new gnulib. 2013-04-11 21:12:46 +02:00
gnulib-fix-width.diff Import new gnulib. 2013-04-11 21:12:46 +02:00
gnulib-no-abort.diff Import new gnulib. 2013-04-11 21:12:46 +02:00
gnulib-no-gets.diff Import new gnulib. 2013-04-11 21:12:46 +02:00
Makefile.am arm_coreboot: Support DMA. 2017-05-08 22:06:04 +02:00
Makefile.core.def efi: Move grub_reboot() into kernel 2017-09-07 23:29:31 +02:00
modinfo.sh.in Fix shebang for termux. 2017-05-03 12:49:31 +02:00