Could people who are experiencing boot-time hangs in 4.9-PRERELEASE try the following patch to see if it helps? I've had one positive report so far, but it would be helpful to get more feedback to determine if this is the right fix to be committed. The problem was that interrupts were getting unmasked too early in the boot process, causing an interrupt storm that usually occurred while USB devices were being probed. The bug is in fork1(), which is used by kthread_create() to create kernel threads; the code there assumed that all interrupts would be unmasked when called, so it didn't bother saving and restoring the interrupt mask. This assumption is reasonable for normal fork() calls, but not for the creation of kernel threads early in the boot process. The appearance of the problem was linked to some recent changes in sys/kern/subr_taskqueue.c around September 10th. Those changes include a call to kthread_create() that happens just before probing all the devices at boot time, so the result was that interrupts were being left unmasked at a time when they are supposed to be disabled. To actually get an interrupt storm hang, you need some IRQ number to be configured by a device driver, and then for some (possibly other) device sharing that IRQ line to generate an interrupt before the driver for that device is prepared to handle it. As well as the subr_taskqueue.c case, there is also a call to kthread_create() in the USB code, so that might be related too. Apply the patch in /usr/src/sys/kern, then rebuild the kernel and reboot. In case of whitespace problems preventing patch applying, it is also available at: http://people.freebsd.org/~iedowse/fork.diff Ian Index: kern_fork.c ==================================================================RCS file: /home/iedowse/CVS/src/sys/kern/kern_fork.c,v retrieving revision 1.72.2.14 diff -u -r1.72.2.14 kern_fork.c --- kern_fork.c 26 Jun 2003 04:15:10 -0000 1.72.2.14 +++ kern_fork.c 26 Sep 2003 08:26:31 -0000 @@ -183,7 +183,7 @@ struct proc *p2, *pptr; uid_t uid; struct proc *newproc; - int ok; + int ok, s; static int curfail = 0, pidchecked = 0; static struct timeval lastfail; struct forklist *ep; @@ -544,10 +544,10 @@ */ microtime(&(p2->p_stats->p_start)); p2->p_acflag = AFORK; - (void) splhigh(); + s = splhigh(); p2->p_stat = SRUN; setrunqueue(p2); - (void) spl0(); + splx(s); /* * Now can be swapped.
Ian Dowse wrote:> Could people who are experiencing boot-time hangs in 4.9-PRERELEASE > try the following patch to see if it helps? I've had one positive > report so far, but it would be helpful to get more feedback to > determine if this is the right fix to be committed.Works for me. Thanks.
On 27-Sep-2003 Ian Dowse wrote:> > Could people who are experiencing boot-time hangs in 4.9-PRERELEASE > try the following patch to see if it helps? I've had one positive > report so far, but it would be helpful to get more feedback to > determine if this is the right fix to be committed.It is working for me. (and I have removed the patch from Andrew Atrens on usb.c before of course ;-) My USB config is : ohci0: <AcerLabs M5237 (Aladdin-V) USB controller> mem 0xdf000000-0xdf000fff irq 9 at device 2.0 on pci0 usb0: OHCI version 1.0, legacy support usb0: <AcerLabs M5237 (Aladdin-V) USB controller> on ohci0 usb0: USB revision 1.0 uhub0: AcerLabs OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered Thanks -- régis
On Saturday 27 September 2003 06:05 am, Ian Dowse wrote:> Could people who are experiencing boot-time hangs in 4.9-PRERELEASE > try the following patch to see if it helps? I've had one positive > report so far, but it would be helpful to get more feedback to > determine if this is the right fix to be committed. >It also works for me. Kent -- Kent Stewart Richland, WA http://users.owt.com/kstewart/index.html
On Sat, 2003-09-27 at 06:05, Ian Dowse wrote:> Could people who are experiencing boot-time hangs in 4.9-PRERELEASE > try the following patch to see if it helps? I've had one positive > report so far, but it would be helpful to get more feedback to > determine if this is the right fix to be committed.Works for me (removed usb.c patch, installed kern_fork.c patch). FreeBSD zircon.zircon.seattle.wa.us 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #23: Sat Sep 27 12:40:16 PDT 2003 joe@zircon.zircon.seattle.wa.us:/usr/obj/usr/src/sys/ZIRCON i386 /Joe
Also worked for me on a Dell Power Edge 2650.
In message <20030928182442.5EAF.ZHANG@koganei.wide.ad.jp>, Zhang Shu writes:>Also worked for me on a Dell Power Edge 2650.The patch has now been committed as revision 1.72.2.15 of kern_fork.c. Thanks everyone for the quick testing! Ian
Just for the record, this fixes my machine as well. ohci0: <SiS 5571 USB controller> mem 0xcfffc000-0xcfffcfff irq 5 at device 1.2 on pci0 usb0: OHCI version 1.0, legacy support usb0: <SiS 5571 USB controller> on ohci0 usb0: USB revision 1.0 uhub0: SiS OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 3 ports with 3 removable, self powered uhid0: APC Back-UPS ES 725 FW:802.n2.D USB FW:n2, rev 1.10/1.06, addr 2, iclass 3/0 ohci1: <SiS 5571 USB controller> mem 0xcfffd000-0xcfffdfff irq 5 at device 1.3 on pci0 usb1: OHCI version 1.0, legacy support usb1: <SiS 5571 USB controller> on ohci1 usb1: USB revision 1.0 uhub1: SiS OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub1: 3 ports with 3 removable, self powered which had a amd# usbdevs -v Controller /dev/usb0: addr 1: self powered, config 1, OHCI root hub(0x0000), SiS(0x0000), rev 1.00 port 1 addr 2: low speed, power 2 mA, config 1, Back-UPS ES 725 FW:802.n2.D USB FW:n2(0x0002), APC(0x051d), rev 1.06 port 2 powered port 3 powered amd# plugged in. ---Mike At 11:29 AM 28/09/2003, Ian Dowse wrote:>In message <20030928182442.5EAF.ZHANG@koganei.wide.ad.jp>, Zhang Shu writes: > >Also worked for me on a Dell Power Edge 2650. > >The patch has now been committed as revision 1.72.2.15 of kern_fork.c. >Thanks everyone for the quick testing! > >Ian >_______________________________________________ >freebsd-stable@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-stable >To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"
Josef Karthauser
2003-Oct-05 12:11 UTC
hang of new usb stack [was Re: Patch for boot-time USB hangs in 4.9-PRERELEASE]
On Sat, Sep 27, 2003 at 02:05:51PM +0100, Ian Dowse wrote:> > Could people who are experiencing boot-time hangs in 4.9-PRERELEASE > try the following patch to see if it helps? I've had one positive > report so far, but it would be helpful to get more feedback to > determine if this is the right fix to be committed. >I'm interested in whether this fix also fixes the boot time handing of the new usb stack. Perhaps any interested parties could test it and let me know? The new usb patch to RELENG_4 as of today is at: http://www.josef-k.net/misc/RELENG_4-USB-20031005.patch.gz Thanks, Joe -- Josef Karthauser (joe@tao.org.uk) http://www.josef-k.net/ FreeBSD (cvs meister, admin and hacker) http://www.uk.FreeBSD.org/ Physics Particle Theory (student) http://www.pact.cpes.sussex.ac.uk/ ================ An eclectic mix of fact and theory. ================-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 195 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20031005/a4492dfc/attachment.bin