From patchwork Wed Mar 28 15:50:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 10313519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 906FD60467 for ; Wed, 28 Mar 2018 15:51:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8046B29A38 for ; Wed, 28 Mar 2018 15:51:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DBC229AA7; Wed, 28 Mar 2018 15:51:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0E31429AD8 for ; Wed, 28 Mar 2018 15:51:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Q5nF1A+dph85eOjqpb64GrWpflTGVNUoAFXXIFKLvNU=; b=fA3TK+IIYpxErJ kaVP8D8Uvp9IDcMmiiAbqyWw7vLmL03BOhX6bkxWRcWvi5xNYUH+57X62pZf4PIk1VAPTs0TNeVUH 6nN6suPmb22zZB3qvHveVVxb5P4W0gcnC4Mnoh8ha8rnbVq60mo2sMG9gd+ChiAfLm4/tTipxxxHB hvnR6aEn9BOk3R7t0IOcXFGL34AA+Ffse6mKoMjKOhD/wD/50YONf/A7sBl0GLRqm5vL2g/9rshGQ DWcuSNVnBuk+OCuCRbfgI1ApWunpELjM/LMRLFGhlKqci998EZc/v/LyuV1ntAJywxta9QEkC/Mzy 7VdlC4/M/F2eWV20+JWw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f1DLm-00076N-21; Wed, 28 Mar 2018 15:50:58 +0000 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f1DLj-000750-Cq for linux-arm-kernel@lists.infradead.org; Wed, 28 Mar 2018 15:50:57 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 3462920728; Wed, 28 Mar 2018 17:50:43 +0200 (CEST) Received: from localhost (242.171.71.37.rev.sfr.net [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id C9DC120146; Wed, 28 Mar 2018 17:50:32 +0200 (CEST) Date: Wed, 28 Mar 2018 17:50:33 +0200 From: Alexandre Belloni To: Daniel Lezcano Subject: Re: [PATCH v3 0/6] clocksource: rework Atmel TCB timer driver Message-ID: <20180328155033.GH13942@piout.net> References: <20180223171558.7037-1-alexandre.belloni@bootlin.com> <9761072.pX2B0LJlSJ@ada> <989df8a3-462a-c645-87f1-9f956e1b22c9@linaro.org> <4073350.0MmxRoANOi@ada> <6d43177a-bbea-6a01-5fa5-1c7891e18412@linaro.org> <20180328141645.GF13942@piout.net> <75e5917b-a9ba-c67e-e964-3f002681f9bb@linaro.org> <20180328153135.GG13942@piout.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180328153135.GG13942@piout.net> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180328_085055_590191_339E6E87 X-CRM114-Status: GOOD ( 12.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Dahl , Boris Brezillon , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On 28/03/2018 at 17:31:35 +0200, Alexandre Belloni wrote: > > Do you have an explanation of why the rate is much higher ? > > > > The core is giving deltas of 31 clocks instead of much more than that, I > guess I messed up the initialization somewhere. > I did mess up. Alexander, can you test that: This will behave exactly the same as before on 16bits TCB and will have much less interrupts on 32 bits platforms. diff --git a/drivers/clocksource/timer-atmel-tcb.c b/drivers/clocksource/timer-atmel-tcb.c index 7fde9cfbf203..bbbacf8c46b0 100644 --- a/drivers/clocksource/timer-atmel-tcb.c +++ b/drivers/clocksource/timer-atmel-tcb.c @@ -222,7 +222,7 @@ static int __init tc_clkevt_register(struct device_node *node, goto err_slow; clk_disable(tce.clk); - clockevents_config_and_register(&tce.clkevt, 32768, 1, bits - 1); + clockevents_config_and_register(&tce.clkevt, 32768, 1, BIT(bits) - 1); ret = request_irq(tce.irq, tc_clkevt2_irq, IRQF_TIMER | IRQF_SHARED, tce.clkevt.name, &tce);