From: Andrey Borzenkov <arvidjaar@newmail.ru>
To: hpa@zytor.com
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] Ghost EDD devices in /sys again
Date: Sat, 6 Sep 2008 12:40:21 +0400 [thread overview]
Message-ID: <200809061240.25925.arvidjaar@newmail.ru> (raw)
In-Reply-To: <200809052219.44093.arvidjaar@newmail.ru>
[-- Attachment #1: Type: text/plain, Size: 2023 bytes --]
On Friday 05 September 2008, Andrey Borzenkov wrote:
> 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.
>
> Unfortunately I do not speak asm language of C; if somebody could provide
> equivalent fix for current edd.c, I am more than ready to test it.
Was it really that simple?
Subject: [PATCH] Fix ghost devices under /sys/firmware/edd
From: Andrey Borzenkov <arvidjaar@mail.ru>
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>
---
arch/x86/boot/edd.c | 4 +++-
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)
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2008-09-06 8:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-05 18:19 Andrey Borzenkov
2008-09-06 8:40 ` Andrey Borzenkov [this message]
2008-09-06 12:07 ` [PATCH] " Ingo Molnar
2008-09-06 14:34 ` Ingo Molnar
2008-09-06 14:04 ` H. Peter Anvin
2008-09-06 17:46 ` Andrey Borzenkov
2008-09-06 22:08 H. Peter Anvin
2008-09-28 6:34 ` Andrey Borzenkov
2008-09-28 15:12 ` H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200809061240.25925.arvidjaar@newmail.ru \
--to=arvidjaar@newmail.ru \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome