From patchwork Thu Aug 29 17:53:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Soren Brinkmann X-Patchwork-Id: 2851531 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 BF5D89F2F4 for ; Thu, 29 Aug 2013 17:54:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B4478204B4 for ; Thu, 29 Aug 2013 17:54:52 +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 AA0232049C for ; Thu, 29 Aug 2013 17:54:51 +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 1VF6QO-0000HY-4y; Thu, 29 Aug 2013 17:54:29 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VF6QE-0003RJ-Bg; Thu, 29 Aug 2013 17:54:18 +0000 Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VF6Py-0003O1-0d for linux-arm-kernel@lists.infradead.org; Thu, 29 Aug 2013 17:54:03 +0000 Received: by mail-pa0-f53.google.com with SMTP id lb1so1228242pab.26 for ; Thu, 29 Aug 2013 10:53:39 -0700 (PDT) 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=uUhVpXa/LttsNNw8y5jSUZdkS/xgZ6jLNLVN2kpRaMk=; b=G/jnh90He/JMFXjuefJxaJkGm7YztdVVKCOSOFbm3ZBYpPuybO8Is48uvnhy+J+3Z8 VCVvmj91Z4dzZXWSf8as6NPEslmezldJQCYpxV/LTCsHhyD2KDjggzaMYgcQ4xsh6HJW sk2XZKGF1cmQsICHU4zkZElyMMhVezyENOsM43fKfmysYVY5osdrnl6ei0m23GJuols7 Ltgd6W7CAXO8zdVu40gI9iv3i6sJdFu67wJ7T/xV+zxu3QrQ+Ya3v1gx5CEnAJnbTxcI hrIMEXyUIDQ0a2FPT+DeEnYETd8uqO3czumxqKp3Wnzlqanel0U0/2zQXBIObNRVkYDv CnwA== X-Received: by 10.66.229.106 with SMTP id sp10mr5844682pac.117.1377798819563; Thu, 29 Aug 2013 10:53:39 -0700 (PDT) Received: from localhost ([149.199.62.254]) by mx.google.com with ESMTPSA id ys4sm39281807pbb.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 29 Aug 2013 10:53:38 -0700 (PDT) From: Soren Brinkmann To: Michal Simek , Daniel Lezcano , Thomas Gleixner , John Stultz Subject: [PATCH RFC 1/3] clocksource/cadence_ttc: Remove clocksource clock notifier Date: Thu, 29 Aug 2013 10:53:08 -0700 Message-Id: <1377798790-28927-2-git-send-email-soren.brinkmann@xilinx.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1377798790-28927-1-git-send-email-soren.brinkmann@xilinx.com> References: <1377798790-28927-1-git-send-email-soren.brinkmann@xilinx.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130829_135402_227943_B3203DC0 X-CRM114-Status: GOOD ( 14.11 ) X-Spam-Score: -1.9 (-) Cc: Soren Brinkmann , 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=-6.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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 Remove the clocksource related clock notifier which tries to update the clocksource frequency in case the timer's input frequency changes. The notifier's approach - unregistering and re-registering the clocksource with the new frequency - is destined to fail, if the TTC is the only available HR clocksource. Signed-off-by: Soren Brinkmann --- drivers/clocksource/cadence_ttc_timer.c | 44 --------------------------------- 1 file changed, 44 deletions(-) diff --git a/drivers/clocksource/cadence_ttc_timer.c b/drivers/clocksource/cadence_ttc_timer.c index b2bb3a4b..99ec898 100644 --- a/drivers/clocksource/cadence_ttc_timer.c +++ b/drivers/clocksource/cadence_ttc_timer.c @@ -219,43 +219,6 @@ static void ttc_set_mode(enum clock_event_mode mode, } } -static int ttc_rate_change_clocksource_cb(struct notifier_block *nb, - unsigned long event, void *data) -{ - struct clk_notifier_data *ndata = data; - struct ttc_timer *ttc = to_ttc_timer(nb); - struct ttc_timer_clocksource *ttccs = container_of(ttc, - struct ttc_timer_clocksource, ttc); - - switch (event) { - case POST_RATE_CHANGE: - /* - * Do whatever is necessary to maintain a proper time base - * - * I cannot find a way to adjust the currently used clocksource - * to the new frequency. __clocksource_updatefreq_hz() sounds - * good, but does not work. Not sure what's that missing. - * - * This approach works, but triggers two clocksource switches. - * The first after unregister to clocksource jiffies. And - * another one after the register to the newly registered timer. - * - * Alternatively we could 'waste' another HW timer to ping pong - * between clock sources. That would also use one register and - * one unregister call, but only trigger one clocksource switch - * for the cost of another HW timer used by the OS. - */ - clocksource_unregister(&ttccs->cs); - clocksource_register_hz(&ttccs->cs, - ndata->new_rate / PRESCALE); - /* fall through */ - case PRE_RATE_CHANGE: - case ABORT_RATE_CHANGE: - default: - return NOTIFY_DONE; - } -} - static void __init ttc_setup_clocksource(struct clk *clk, void __iomem *base) { struct ttc_timer_clocksource *ttccs; @@ -273,13 +236,6 @@ static void __init ttc_setup_clocksource(struct clk *clk, void __iomem *base) return; } - ttccs->ttc.clk_rate_change_nb.notifier_call = - ttc_rate_change_clocksource_cb; - ttccs->ttc.clk_rate_change_nb.next = NULL; - if (clk_notifier_register(ttccs->ttc.clk, - &ttccs->ttc.clk_rate_change_nb)) - pr_warn("Unable to register clock notifier.\n"); - ttccs->ttc.base_addr = base; ttccs->cs.name = "ttc_clocksource"; ttccs->cs.rating = 200;