summaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/edd.c
diff options
context:
space:
mode:
authorAndrey Borzenkov <arvidjaar@newmail.ru>2008-09-06 12:40:21 +0400
committerIngo Molnar <mingo@elte.hu>2008-09-06 16:30:36 +0200
commit464f04c9e9b3b1c4f5ffb89c51d8ba2a2034c846 (patch)
treeea736cae3f30e2e04c27c6c51e4ee3efffa8e2fe /arch/x86/boot/edd.c
parentd2f37384fc9957ad0162d5285a5660f0a86ef243 (diff)
downloadop-kernel-dev-464f04c9e9b3b1c4f5ffb89c51d8ba2a2034c846.zip
op-kernel-dev-464f04c9e9b3b1c4f5ffb89c51d8ba2a2034c846.tar.gz
x86: fix ghost EDD devices in /sys again
> This is regression but old enough. Apparently I had for whatever reasons > EDD turned off till recently. This is 2.6.27-rc5 just in case. > > In 2006 I fixed ghost devices due to buggy BIOS: > > http://marc.info/?l=linux-kernel&m=114087765422490&w=2 > > Later edd.S has been rewritten in C, and apparently this patch has been > lost: > > {pts/1}% ls /sys/firmware/edd > int13_dev80/ int13_dev84/ int13_dev88/ int13_dev8c/ > int13_dev81/ int13_dev85/ int13_dev89/ int13_dev8d/ > int13_dev82/ int13_dev86/ int13_dev8a/ int13_dev8e/ > int13_dev83/ int13_dev87/ int13_dev8b/ int13_dev8f/ > > But I have just a single disk. This is the same system BTW. Some BIOSes do not always set CF on error before return from int13. The patch adds additional check for status being zero (AH == 0). This was fixed for edd.S in http://marc.info/?l=linux-kernel&m=114087765422490&w=2, but lost again when edd.S was rewritten in C. Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/boot/edd.c')
-rw-r--r--arch/x86/boot/edd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/boot/edd.c b/arch/x86/boot/edd.c
index d93cbc6..bf4ae6f 100644
--- a/arch/x86/boot/edd.c
+++ b/arch/x86/boot/edd.c
@@ -32,7 +32,9 @@ static int read_mbr(u8 devno, void *buf)
: "+a" (ax), "+c" (cx), "+d" (dx), "+b" (bx)
: : "esi", "edi", "memory");
- return -(u8)ax; /* 0 or -1 */
+ /* Some BIOSes do not set carry flag on error but still return
+ * error in AH. The condition below is expected to catch both */
+ return -!!ax; /* 0 or -1 */
}
static u32 read_mbr_sig(u8 devno, struct edd_info *ei, u32 *mbrsig)
OpenPOWER on IntegriCloud