mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: PROBLEM: Panic booting from USB disk in ioremap.c (line 81)
       [not found] <A6974D8E5F98D511BB910002A50A6647615F32F8@hdsmsx402.hd.intel.com>
@ 2004-02-26  8:11 ` Len Brown
  2004-02-29  5:28   ` [PATCH]: " Elliot Mackenzie
  0 siblings, 1 reply; 2+ messages in thread
From: Len Brown @ 2004-02-26  8:11 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: Elliot Mackenzie, linux-kernel

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.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH]: PROBLEM: Panic booting from USB disk in ioremap.c (line 81)
  2004-02-26  8:11 ` PROBLEM: Panic booting from USB disk in ioremap.c (line 81) Len Brown
@ 2004-02-29  5:28   ` Elliot Mackenzie
  0 siblings, 0 replies; 2+ messages in thread
From: Elliot Mackenzie @ 2004-02-29  5:28 UTC (permalink / raw)
  To: 'Len Brown', 'Randy.Dunlap'; +Cc: linux-kernel

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:
>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:
>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;



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-02-29  5:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <A6974D8E5F98D511BB910002A50A6647615F32F8@hdsmsx402.hd.intel.com>
2004-02-26  8:11 ` PROBLEM: Panic booting from USB disk in ioremap.c (line 81) Len Brown
2004-02-29  5:28   ` [PATCH]: " Elliot Mackenzie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®