Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Mar 2012 16:57:47 +0100
From:      Svatopluk Kraus <onwahe@gmail.com>
To:        hackers@freebsd.org
Subject:   pccbb device doesn't send device_shutdown() to childs (reboot freezes)
Message-ID:  <CAFHCsPVSwXps9K5-h_VjLKnQ56vHhPx%2BDs_isy8NAS7AnjdsTw@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi,

   I solved very curious problem with rarely system (FreeBSD-9)
freezing during reboot. Finally, I found out that system freezes in ep
device callout. The part of device tree is following:

   -> pccbb -> pccard -> ep

   cbb_pci_shutdown() method in pccbb device places the cards in
reset, turns off the interrupts and powers down the socket. No child
has a chance to know about it. Thus, if ep device callout fires
between device_shutdown() is called on root device and interrupts are
disabled, the callout freezes in never-ending while loop, which reads
status from hardware (now without power).

   I propose following change (editted by hand) in cbb_pci_shutdown():

	struct cbb_softc *sc = (struct cbb_softc *)device_get_softc(brdev);
+
+	/* Inform all childs. */
+ 	bus_generic_shutdown(brdev);
+
	/*
	 * We're about to pull the rug out from the card, so mark it as
	 * gone to prevent harm.
         */
        sc->cardok = 0;

    Futhermore, ep device (ed device too, ... ?) has not implemented
device_shutdown method. So, fixing pccbb device is not enough to solve
the freezing problem. I somehow patched the mentioned devices too, but
maybe someone more competent should do it for FreeBSD tree.

            Svata



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFHCsPVSwXps9K5-h_VjLKnQ56vHhPx%2BDs_isy8NAS7AnjdsTw>