From owner-freebsd-mips@FreeBSD.ORG Wed Aug 18 14:45:48 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 61A2C1065670; Wed, 18 Aug 2010 14:45:48 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id E05F68FC0C; Wed, 18 Aug 2010 14:45:47 +0000 (UTC) Received: by yxe42 with SMTP id 42so265529yxe.13 for ; Wed, 18 Aug 2010 07:45:47 -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=Mrv18y64/3GtTs2Nmpt2p52GeSJuAft6V4cReCZJdcE=; b=JbbV2vGuw/PHnbgTRCnmBOYyqq+GxxKHFSw8pXkDsbQkqFRM7s+5ZD3eQ8Ef1pzJy2 DijIWUw3KVCJw4Ag25qkuZIEmng8XrykM04qRXQub++RarGDoLESI3P5vvCMc+jtlbXz qQsWsH1fT1kGxEwG5LktcPz4rCQPE6KEltzak= 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=AtQiziY1zknvjSRu86gdVtbkJXPyB8o8MiD3Q8ETHqkvGauwl4yDCT7v6uNkQu+RiD 6039F8H8wK1h/61756DUkWv6mbFhOUXFtXOogapPR/7/HoKFoWLSUyJXxxd1SBhnr31t tlG4iUahh2yNrI+siXFRJ0ymVA+xU7SZfQjkY= MIME-Version: 1.0 Received: by 10.151.62.37 with SMTP id p37mr365888ybk.275.1282142747110; Wed, 18 Aug 2010 07:45:47 -0700 (PDT) Received: by 10.150.58.10 with HTTP; Wed, 18 Aug 2010 07:45:46 -0700 (PDT) In-Reply-To: <4C5977BC.1060104@FreeBSD.org> References: <4C41A248.8090605@FreeBSD.org> <4C41B4CF.6080409@FreeBSD.org> <4C4205CC.6080700@FreeBSD.org> <4C4ED247.80701@FreeBSD.org> <4C555CF7.5080101@FreeBSD.org> <4C5977BC.1060104@FreeBSD.org> Date: Wed, 18 Aug 2010 20:15:46 +0530 Message-ID: From: "Jayachandran C." To: Alexander Motin , Neel Natu Content-Type: text/plain; charset=ISO-8859-1 Cc: Randall Stewart , 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: Wed, 18 Aug 2010 14:45:48 -0000 On Wed, Aug 4, 2010 at 7:52 PM, Alexander Motin wrote: > Neel Natu wrote: >> Thanks for taking the time to review the patch. Here is the updated patch: >> http://people.freebsd.org/~neel/tick_diff.txt > > Seems fine. > >> On Sun, Aug 1, 2010 at 4:39 AM, Alexander Motin wrote: >>> "t_upper++;" there looks a bit strange, as it is not written back. The >>> wrapping stuff won't work if this timer interrupts were not used. >> >> This part is intentional. >> >> I wanted only clock_intr() to update the cached values of >> 'counter_upper' and 'counter_lower_last' and tick_ticker() to sample a >> consistent snapshot of the tuple and then operate on it. >> >> I have added an XXX comment to describe the dependency. We can revisit >> this if we change the default timer in mips. > > It's not about default timer, but about having any other timer. But if > you wish so, it should be enough for now. I'm seeing a problem with the timer code on XLR, when I run ping: xlrboard# ping 192.168.30.1 PING 192.168.30.1 (192.168.30.1): 56 data bytes 64 bytes from 192.168.30.1: icmp_seq=0 ttl=64 time=0.649 ms 64 bytes from 192.168.30.1: icmp_seq=1 ttl=64 time=362.624 ms 64 bytes from 192.168.30.1: icmp_seq=2 ttl=64 time=0.219 ms 64 bytes from 192.168.30.1: icmp_seq=3 ttl=64 time=362.631 ms 64 bytes from 192.168.30.1: icmp_seq=4 ttl=64 time=-362.168 ms 64 bytes from 192.168.30.1: icmp_seq=5 ttl=64 time=362.628 ms 64 bytes from 192.168.30.1: icmp_seq=6 ttl=64 time=0.234 ms 64 bytes from 192.168.30.1: icmp_seq=7 ttl=64 time=362.631 ms 64 bytes from 192.168.30.1: icmp_seq=8 ttl=64 time=0.483 ms This happens with the current XLR code, and even after updating it from mips/mips/tick.c (to take in Neel's changes). Due to the way our network driver works, there is a likely that the ping packets are received by different CPUs every time, but having the negative time there seems to indicate some issue. Also on XLR the count registers are not synchronized across cores, so the values will be different for each CPU. I will look at some more, but meanwhile, any clue on what might be wrong would be helpful. I still haven't done the PIC timer based timecount, that might fix it, if it is due to the count registers being out of sync. Thanks, JC.