From owner-freebsd-mips@FreeBSD.ORG Thu Jul 22 03:22:37 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10C4C106564A; Thu, 22 Jul 2010 03:22:37 +0000 (UTC) (envelope-from neelnatu@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id D74EB8FC12; Thu, 22 Jul 2010 03:22:36 +0000 (UTC) Received: by pwj9 with SMTP id 9so3352313pwj.13 for ; Wed, 21 Jul 2010 20:22:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=W4qmqXYqlv1lVkxqzzw9pCMchgQbZjlpjHtzR6EhDnY=; b=JWNvaSwLCVoWaGvXTbVRCQbsrGXYxexWdW5TTa2ebPpT8caNJQ9ScIwJxCh2NbZJOg p5sR6/QG0GSxJe0S364TYL+2Wj1sZ8H743y4PAMT+fbc0hxY7pPSx38n59lwn+mP5i3b XPIm/90auT3pDa16dLxRkELUMZ8+Fq7uTW448= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=EJqcepKNLHZYXrdgm7FJW3P6zZ86RzC/QJ7SqbkfAU6zQnc5Bq/GDqdw7GU6txSRu/ y9AmTVqzsXUZGYnftSxlZ4UdPEK+/D77JAV/Wk4Enlm4suWISpRY2sGOE7jraSE+1x6E T0oOQp1bsXjShvKiqN6DeYrlt5uAF3fsurLlI= MIME-Version: 1.0 Received: by 10.142.231.14 with SMTP id d14mr1426265wfh.308.1279768956158; Wed, 21 Jul 2010 20:22:36 -0700 (PDT) Received: by 10.142.139.19 with HTTP; Wed, 21 Jul 2010 20:22:36 -0700 (PDT) In-Reply-To: <4C4698D6.2090104@FreeBSD.org> References: <4C41A248.8090605@FreeBSD.org> <4C4698D6.2090104@FreeBSD.org> Date: Wed, 21 Jul 2010 20:22:36 -0700 Message-ID: From: Neel Natu To: Alexander Motin Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-mips@freebsd.org Subject: Re: [RFC] Event timers on MIPS X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2010 03:22:37 -0000 Hi Alexander, Your patch works fine on a Sibyte. I verified that wall clock time is progressing as expected. Is there any other test that you recommend? I have a few comments about the patch: 1. set_cputicker() in clock_attach() should be moved back up to mips_timer_init_params(). Otherwise the platform-specific CPU tickers used by Sibyte, Octeon and RMI will be overwritten by the mips32 ticker. 2. The local variable 'cycles_per_tick' in clock_intr() can now be a uint32_t. 3. Is there a race between setting 'cycles_per_tick' in clock_start() and clock_intr()? Would it be better to write the compare register first and then set 'cycles_per_tick' to a non-zero value? If I understand the code correctly we are liable to get clock interrupts even afer the clock is stopped when the CP0 COUNT register matches 0xffffffff. 4. We need to update the DPCPU(compare_ticks) value when we start the timer in clock_start(). 5. I think the entire 'lost_ticks' processing in clock_intr() should be conditional on (cycles_per_tick > 0). Without this we may incorrectly update the value of DPCPU(lost_ticks). 6. Can you a couple of lines of explaining the computatation of 'et_min_period' and 'et_max_period'? It is not completely obvious to me. best Neel 2010/7/20 Alexander Motin : > Alexander Motin wrote: >> I've made a patch, updating MIPS timer code (except RMI) to utilize new >> MI event timer infrastructure. I've successfully built QEMU and XLR >> kernels with the patch. Unluckily I can't test how it works, unless >> somebody teach me how to cook QEMU to run it. I also haven't ported RMI >> timers drivers, as I am not sure how that hardware is intended to work. >> >> Patch for HEAD can be found here: >> http://people.freebsd.org/~mav/timers_mips.patch > > Slightly updated version for fresh HEAD: > http://people.freebsd.org/~mav/timers_mips2.patch > > -- > Alexander Motin > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" >