From owner-svn-src-head@FreeBSD.ORG Thu Jan 1 13:56:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9393E1065670; Thu, 1 Jan 2009 13:56:32 +0000 (UTC) (envelope-from rik@inse.ru) Received: from mail.inse.ru (mail.inse.ru [144.206.128.1]) by mx1.freebsd.org (Postfix) with ESMTP id 4834D8FC1A; Thu, 1 Jan 2009 13:56:32 +0000 (UTC) (envelope-from rik@inse.ru) Received: from www.inse.ru (www.inse.ru [144.206.128.1]) by mail.inse.ru (Postfix) with ESMTPSA id 9734233C51; Thu, 1 Jan 2009 16:56:30 +0300 (MSK) Message-ID: <495CCBBD.5060605@localhost.inse.ru> Date: Thu, 01 Jan 2009 16:57:17 +0300 From: Roman Kurakin User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: Bruce Evans References: <200812271522.mBRFMMHY074982@svn.freebsd.org> <20081229.114241.756909212.imp@bsdimp.com> <495B406F.2040305@localhost.inse.ru> <20090101.000643.1543764949.imp@bsdimp.com> <20090101222434.S7598@delplex.bde.org> In-Reply-To: <20090101222434.S7598@delplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: rik@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r186520 - head/sys/dev/puc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jan 2009 13:56:33 -0000 Hi Bruce, Bruce Evans wrote: > 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). We can implement some sort of sysctl, hint or smth like this. I do not think that AUTODETECT_RCLK should be used by default everywhere, only in special cases. And for that cases it could be just to inform the user about the value for the 'hint' to use. > - 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. Probably this is not the case. I doubt that emulated hardware should hit such problems that it will need autodetction for it. Any way, if such case will arise, such autodetection shouldn't not do more harm than it is. rik > Bruce