From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 16 03:04:19 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3ACCB16A4B3 for ; Tue, 16 Sep 2003 03:04:19 -0700 (PDT) Received: from stork.mail.pas.earthlink.net (stork.mail.pas.earthlink.net [207.217.120.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C0C243FAF for ; Tue, 16 Sep 2003 03:04:18 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-2ivfinn.dialup.mindspring.com ([165.247.202.247] helo=mindspring.com) by stork.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19zCgz-00012R-00 for hackers@freebsd.org; Tue, 16 Sep 2003 03:04:17 -0700 Message-ID: <3F66DFED.C3FA43EE@mindspring.com> Date: Tue, 16 Sep 2003 03:03:25 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: FreeBSD List of Hackers References: <200309152127.h8FLRrv71220@Mail.NOSPAM.DynDNS.dK> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4ab15e04276ba2ef74863fdd756b78240350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c Subject: Re: Machine wedges solid after one serial-port source-line addition... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2003 10:04:19 -0000 Barry Bouwsma wrote: > Would anyone care to explain why the following simple patch could be > enough to wedge my machine solid? (My original hack-patches without > any console printf() debuggery did the same thing within seconds, as > well...) All it does is notify the console whenever a serial port DCD > PPS signal transition is detected, as follows (patch against 4.foo; I > haven't tried this with 5.bar or later -- also, not a real patch as I've > included context and snipped my comments) : [ ... ] > I'm wondering if it's something really blindingly obvious that I should > be but am not aware of, or something I gotta work on to track down. You are calling printf() from a fast interrupt handler. You shouldn't call printf() from any interrupt handler, and particularly you shouldn't call it from something that can and will have a FIFO overrun well before the printf() gets back. If you need to communicate information to a console log (or wherever), then you should enqueue the information on the status change, and wake up some thread to do the actual processing of the information out to the console. -- Terry