From patchwork Fri Nov 8 21:21:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Soren Brinkmann X-Patchwork-Id: 3159911 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 885D79F243 for ; Fri, 8 Nov 2013 21:24:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C0EFC20460 for ; Fri, 8 Nov 2013 21:24:45 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DB62220457 for ; Fri, 8 Nov 2013 21:24:44 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VetWL-0008MY-P4; Fri, 08 Nov 2013 21:23:15 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VetVx-00069j-Rk; Fri, 08 Nov 2013 21:22:49 +0000 Received: from mail-pd0-x22f.google.com ([2607:f8b0:400e:c02::22f]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VetV4-0005x6-Gu for linux-arm-kernel@lists.infradead.org; Fri, 08 Nov 2013 21:21:55 +0000 Received: by mail-pd0-f175.google.com with SMTP id g10so2644208pdj.20 for ; Fri, 08 Nov 2013 13:21:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=fBCL5oO0zmSGPaof5WumR5O22b0gswpHbAhvhWUH4q4=; b=FJ2tJZG1mGbxkyCnQgAPuCJdF8E4O6t5q9zsE2ugkrhhCMwUaJVPQV5Q54IUhPjHkF Psbr4JzC/vsUXqm5CLqloESV8QgJ9kMFExn5iO/mdGgj6uYApiqSkIZOrBg4XGSxkqoT XJ1mivZ3ZXAWfL6d3IMeQA39fe5dyM8zyijKDX799xSLX0BK7jMo6wTx6Hz91I69pP8v M2awDN9ciJoE331vsI6atADk/4gW7Ca7NjRJwcfjTEcMuK8fe/4HN+Q728tZOKxGuqT3 fdz+dLiMoIJq3PBhXBuiUMEnNYH1dW7Qj+wGlnshsLqHZGUSuKPG+IpY9nsMUthMI4ba jCig== X-Received: by 10.66.251.40 with SMTP id zh8mr5597202pac.185.1383945692890; Fri, 08 Nov 2013 13:21:32 -0800 (PST) Received: from localhost ([149.199.62.254]) by mx.google.com with ESMTPSA id yi10sm16683831pab.8.2013.11.08.13.21.31 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 08 Nov 2013 13:21:32 -0800 (PST) From: Soren Brinkmann To: Rob Herring , Pawel Moll , Mark Rutland , Stephen Warren , Ian Campbell , Russell King , Michal Simek , Daniel Lezcano , Thomas Gleixner Subject: [PATCH 4/7] clocksource/cadence_ttc: Adjust interval in clock notifier Date: Fri, 8 Nov 2013 13:21:14 -0800 Message-Id: <1383945677-29674-5-git-send-email-soren.brinkmann@xilinx.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1383945677-29674-1-git-send-email-soren.brinkmann@xilinx.com> References: <1383945677-29674-1-git-send-email-soren.brinkmann@xilinx.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131108_162154_684196_3A80F324 X-CRM114-Status: GOOD ( 10.25 ) X-Spam-Score: -1.9 (-) Cc: Soren Brinkmann , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The clockevent has to be reprogrammed if the timer's input clock frequency changes and the timer is in periodic mode, in order to maintain the correct timer interval. Signed-off-by: Soren Brinkmann --- drivers/clocksource/cadence_ttc_timer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/clocksource/cadence_ttc_timer.c b/drivers/clocksource/cadence_ttc_timer.c index a92350b55d32..68a336038d8f 100644 --- a/drivers/clocksource/cadence_ttc_timer.c +++ b/drivers/clocksource/cadence_ttc_timer.c @@ -338,6 +338,10 @@ static int ttc_rate_change_clockevent_cb(struct notifier_block *nb, /* update cached frequency */ ttc->freq = ndata->new_rate; + if (ttcce->ce.mode == CLOCK_EVT_MODE_PERIODIC) + ttc_set_interval(ttc, DIV_ROUND_CLOSEST(ttc->freq, + PRESCALE * HZ)); + /* fall through */ } case PRE_RATE_CHANGE: