From owner-svn-src-all@FreeBSD.ORG Thu Jan 1 12:29:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12802106566B; Thu, 1 Jan 2009 12:29:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id A012C8FC17; Thu, 1 Jan 2009 12:29:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-173-239.carlnfd1.nsw.optusnet.com.au (c211-30-173-239.carlnfd1.nsw.optusnet.com.au [211.30.173.239]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n01CThTP028853 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 1 Jan 2009 23:29:44 +1100 Date: Thu, 1 Jan 2009 23:29:42 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: "M. Warner Losh" In-Reply-To: <20090101.000643.1543764949.imp@bsdimp.com> Message-ID: <20090101222434.S7598@delplex.bde.org> References: <200812271522.mBRFMMHY074982@svn.freebsd.org> <20081229.114241.756909212.imp@bsdimp.com> <495B406F.2040305@localhost.inse.ru> <20090101.000643.1543764949.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: rik@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, rik@inse.ru, src-committers@freebsd.org Subject: Re: svn commit: r186520 - head/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jan 2009 12:29:58 -0000 On Thu, 1 Jan 2009, M. Warner Losh wrote: > In message: <495B406F.2040305@localhost.inse.ru> > Roman Kurakin writes: > : Probably we need to implement AUTODETECT_RCLK. I've had the patch, > : but it worked only for modules, cause there was no working timers while the > : cards probe time if the driver was compiled in. I've planned to move > : detection > : code to the first open and do some cleanup after the detection, but > : didn't do > : that. > > I'd like to see that. I think we can defer the detection of RCLK to > later. How accurate is this, btw? How dependent on timing of > interrupts is it? This cannot work in the following cases: - serial consoles. The device is then used as a low-level console long before the first open and in a context where timer interrupts are unavailable even if timers are initialized. However, at least on i386's, the main (i8254) timer is initialized just before console initialization (which is just before the first possible use of a console (for booting with -d)), to support the syscons driver using DELAY() which requires the timer to be initialized. DELAY() is probably sufficient for detecting RCLK if it is possible to detect RCLK at all (set the speed low enough so that polling every millisecond after DELAY(1000) is good enough). - emulated hardware. The emulation only needs to emulate the specified speed on the external interface. It would take an unreasonably high quality emulation to get the timing right in all cases, especially for the loopback case which should be used here. In the loopback case, the external interface hardware would not even be used, except part of the unreasonably high quality implementation would involve using the external interface to the extent of telling it to do nothing except return its timing signals so that the looped back input arrives at the same time as it would on the other side of the external interface if it weren't looped back. Bruce