Re: 5.3-BETA5 panic on first boot - floppy related

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 28 Sep 2004 13:09:26 -0400
On Sunday 26 September 2004 04:44 am, Christian Laursen wrote:
> I upgraded my laptop to 5.3-BETA4 a couple of days ago and have started
> to experience it panic ont the first boot if ACPI is enabled.
>
> Without ACPI it boots fine and after the panic and subsequently typing
> 'reset' in the kernel debugger it boots fine with ACPI enabled.
>
> The dmesg output including a stack trace is here:
> http://borderworlds.dk/~xi/vulcan/dmesg.txt
>
> My kernel configuration is here:
> http://borderworlds.dk/~xi/vulcan/VULCAN
>
> I just tried to boot with the floppy drive attached, but that doesn't
> make any difference.

There is a bug in the fdc_acpi driver in that it attaches drives via hints 
even if the controller fails to attach which leads to this panic.  A possible 
fix for RELENG_5 is below:

Index: fdc_acpi.c
===================================================================
RCS file: /usr/cvs/src/sys/dev/fdc/fdc_acpi.c,v
retrieving revision 1.2.2.2
diff -u -r1.2.2.2 fdc_acpi.c
--- fdc_acpi.c	18 Sep 2004 04:57:55 -0000	1.2.2.2
+++ fdc_acpi.c	28 Sep 2004 17:07:52 -0000
_at__at_ -130,7 +130,7 _at__at_
 	bus = device_get_parent(dev);
 	if (ACPI_FAILURE(ACPI_EVALUATE_OBJECT(bus, dev, "_FDE", NULL, &buf))) {
 		error = ENXIO;
-		goto out;
+		goto out_hintsprobe;
 	}
 
 	/* Parse the output of _FDE in various ways. */
_at__at_ -154,7 +154,7 _at__at_
 			device_printf(dev, "_FDE wrong length: %d\n",
 			    obj->Buffer.Length);
 			error = ENXIO;
-			goto out;
+			goto out_hintsprobe;
 		}
 		break;
 	case ACPI_TYPE_PACKAGE:
_at__at_ -173,17 +173,21 _at__at_
 	default:
 		device_printf(dev, "invalid _FDE type %d\n", obj->Type);
 		error = ENXIO;
-		goto out;
+		goto out_hintsprobe;
 	}
 
 	/* Add fd child devices as specified. */
 	error = fdc_acpi_probe_children(bus, dev, fde);
 
-out:
-	/* If there was a problem, fall back to the hints-based probe. */
+out_hintsprobe:
+	/*
+	 * If there was a problem with the _FDE drive enumeration, fall
+	 * back to the hints-based probe.
+	 */
 	if (error)
 		error = fdc_hints_probe(dev);
 
+out:
 	if (buf.Pointer)
 		free(buf.Pointer, M_TEMP);
 	if (error != 0)


-- 
John Baldwin <jhb_at_FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
Received on Tue Sep 28 2004 - 15:26:31 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:14 UTC