[PATCH] x86, suspend: Run A20 test on resume

From: H. Peter Anvin
Date: Mon Dec 10 2012 - 16:17:48 EST


If A20 is disabled on resume, we may have to explicitly enable it.
Rather than creating a bunch of ad hoc code, use the same code we
would on system startup.

Note: the startup code implicitly assumes BIOS, specifically that int
$0x15 is enabled. However, for non-BIOS platforms to have A20 closed
on resume seems extremely unlikely, since pretty much all non-BIOS
firmware run in 32- or 64-bit mode.

Reported-by: Ondrej Zary <linux@xxxxxxxxxxxxxxxxxxxx>
Link: http://lkml.kernel.org/r/201210240847.52417.linux@xxxxxxxxxxxxxxxxxxxx
Signed-off-by: H. Peter Anvin <hpa@xxxxxxxxxxxxxxx>
---
arch/x86/realmode/rm/Makefile | 2 +-
arch/x86/realmode/rm/a20.c | 1 +
arch/x86/realmode/rm/wakemain.c | 3 +++
3 files changed, 5 insertions(+), 1 deletion(-)
create mode 100644 arch/x86/realmode/rm/a20.c

diff --git a/arch/x86/realmode/rm/Makefile b/arch/x86/realmode/rm/Makefile
index 8869287..7e2ff68 100644
--- a/arch/x86/realmode/rm/Makefile
+++ b/arch/x86/realmode/rm/Makefile
@@ -10,7 +10,7 @@
always := realmode.bin realmode.relocs

wakeup-objs := wakeup_asm.o wakemain.o video-mode.o
-wakeup-objs += copy.o bioscall.o regs.o
+wakeup-objs += copy.o bioscall.o regs.o a20.o
# The link order of the video-*.o modules can matter. In particular,
# video-vga.o *must* be listed first, followed by video-vesa.o.
# Hardware-specific drivers should follow in the order they should be
diff --git a/arch/x86/realmode/rm/a20.c b/arch/x86/realmode/rm/a20.c
new file mode 100644
index 0000000..e71d518
--- /dev/null
+++ b/arch/x86/realmode/rm/a20.c
@@ -0,0 +1 @@
+#include "../../boot/a20.c"
diff --git a/arch/x86/realmode/rm/wakemain.c b/arch/x86/realmode/rm/wakemain.c
index 91405d5..6e0d548 100644
--- a/arch/x86/realmode/rm/wakemain.c
+++ b/arch/x86/realmode/rm/wakemain.c
@@ -79,4 +79,7 @@ void main(void)
probe_cards(0);
set_mode(wakeup_header.video_mode);
}
+
+ /* If A20 is closed, fix now */
+ enable_a20();
}
--
1.7.11.7


--------------050400020700090403080108--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/