From owner-freebsd-mips@FreeBSD.ORG Thu Jul 22 09:01:26 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 363621065676 for ; Thu, 22 Jul 2010 09:01:26 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id AF9378FC12 for ; Thu, 22 Jul 2010 09:01:25 +0000 (UTC) Received: by fxm13 with SMTP id 13so4541228fxm.13 for ; Thu, 22 Jul 2010 02:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=ANoQFH2x1Qq4OCWXnotW+O8Zb/xGra7WQWNWt/h/VGE=; b=iKHmIFwIo5PBre4jhb+8xteZuTeP8ryUYzfmuqTPTMaH9R5r+2COk/TgX+tJ9V/QJ1 u33vYFhkPlVidFuQnim5pkhraeKx63SpY15ZNS7PTyMithp0iMKJ+uznsPD3Wirwl8R5 D5BAGqWnVys8bSjOGoa1LM67lAicjmx3nWteA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=UXDBSRspNma+RE3foGN2jT56wa30K4GKDbaodY/nSTKnyjmQkjqbb8sMm2eWmJMaWa Yen4OJxhkwqLXMvPlm7l12FOSghyoE/zT3bIzklFiGYpmUXOsJuMhe6tik1PanDJxIqo UZVIQJVKGhUti40IlrGrqGF3QJunV7x6HsWac= Received: by 10.223.108.204 with SMTP id g12mr1543131fap.21.1279789284153; Thu, 22 Jul 2010 02:01:24 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id r27sm3238326faa.24.2010.07.22.02.01.22 (version=SSLv3 cipher=RC4-MD5); Thu, 22 Jul 2010 02:01:23 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C48089C.1010503@FreeBSD.org> Date: Thu, 22 Jul 2010 12:00:12 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Neel Natu References: <4C41A248.8090605@FreeBSD.org> <4C4698D6.2090104@FreeBSD.org> <4C47D8CD.7020209@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 09:01:26 -0000 Neel Natu wrote: > On Wed, Jul 21, 2010 at 10:36 PM, Alexander Motin wrote: >> New patch: http://people.freebsd.org/~mav/timers_mips3.patch > > In clock_intr() it would seem that the last 'et_event_cb()' should be > called conditionally only if (cycles_per_tick > 0). Of course, this is > necessary only if my explanation about spurious clock_intr() > invocations is correct. cycles_per_tick == 0 except spurious interrupt may also mean one-shot timer operation mode. In such case callback should be called on interrupt, but timer should be stopped after that. To protect from counter still running after stop (if needed) - probably we need one more variable, or define some specific cycles_per_tick value. I am not actually sure if writing 0xffffffff stops timer. I've just seen it somewhere else. What is the proper way there to really stop the timer to avoid spurious interrupt? > I have tested the latest patch on the Sibyte as well and it works correctly. Thanks. -- Alexander Motin