Skip to contentSkip to conversation

PROBLEM: Panic booting from USB disk in ioremap.c (line 81)

PATCH New Len Brown 2 participants 2 messages Feb 26, 2004 – Feb 29, 2004 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Len Brown

author
#1 lore raw

bootflag.c should not use its own private ACPI table parser/mapper -- this is a bug:

http://bugme.osdl.org/show_bug.cgi?id=1922

Elliot,
If you add your system info to that bug report and volunteer to help test the fix, I'll be delighted to use your system as an excuse to address this issue promptly.

thanks,
-Len

ps.
The reason you enter diag mode when SBF is disabled is because w/o SBF, the BOOTING flag doesn't get cleared, so the BIOS assumes the system didn't boot correctly and when entered next it is in DIAG mode. This is expected.

IMO, module load time is probably too early to clear the BOOTING flag anyway. It should be cleared upon completion of successful boot -- though I'm not sure how to identify that point. Come to think about it, maybe we should delay clearing the BOOTING flag until Linux initiates a graceful shutdown, sleep, or reboot? If the system died b/c of bad RAM or something, that would make it run through DIAGS when it next enters POST.

#2 lore raw

PATCH 1/1 : PROBLEM: Panic booting from USB disk in ioremap.c (line 81)

Kernel-devs:

This patch simply adds a sanity check to bootflag.c to detect a bad RSDT pointer and avoids a kernel panic on boot with some buggy BIOSes. The patch is an "interim" patch, as we believe Len Brown has plans to use the ACPI code to manage SBF in future.

Initial post:

Quoted 1 line

We have a problem booting vanilla 2.6.2 and 2.6.3 kernels from a USB

disk >(Transcend JetFlash, both 128MB USB 2 and 256MB USB 1). During what appears >to be PCI device enumeration, we get the following panic:

Len Brown:

Quoted 3 lines

bootflag.c should not use its own private ACPI table parser/mapper -- this is a bug:
http://bugme.osdl.org/show_bug.cgi?id=1922

This is an interim patch for anyone that is wrestling with the same issue.
Thank you to Randy Dunlap for his helpful assistance early in the process (and for some of the code below).

Kind regards,
Doug Turk and Elliot Mackenzie.

========================================================================
====
--- linux-2.6.3/arch/i386/kernel/bootflag.c Wed Feb 18 13:59:06 2004
+++ linux-2.6.3-doug/arch/i386/kernel/bootflag.c Tue Feb 24
23:18:51 2004
@@ -192,22 +192,37 @@
}
if(i>0xFFFE0)
return 0;
-
-
+
rsdt = ioremap(rsdtbase, rsdtlen);
if(rsdt == 0)
return 0;
-
- i = readl(rsdt + 4);
+
+ /* Check the RSDT signature */
+ if (memcmp(rsdt, "RSDT", 4))
+ {
+ iounmap(rsdt);
+ printk(KERN_WARNING "SBF: Could not map RSDT: bad
signature\n");
+ return 0;
+ }
+

/*
* Remap if needed
*/
-
+ i = readl(rsdt + 4);
+
if(i > rsdtlen)
{
rsdtlen = i; iounmap(rsdt);
+ /* Verify that the RSDT length is sane. */
+ if (rsdtlen > 0x1000) { /* arbitrary for now */
+ printk(KERN_ERR "SBF: invalid rsdtlen = 0x%x\n",
+ rsdtlen);
+ return 0;
+ }
+
rsdt = ioremap(rsdtbase, rsdtlen); if(rsdt == 0)
return 0;