From patchwork Thu Jun 19 17:08:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 4385151 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 38DA89F314 for ; Thu, 19 Jun 2014 17:10:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 642182026D for ; Thu, 19 Jun 2014 17:10:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9185B2025B for ; Thu, 19 Jun 2014 17:10:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WxfpZ-0007iD-Ok; Thu, 19 Jun 2014 17:08:57 +0000 Received: from mail-vc0-f202.google.com ([209.85.220.202]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WxfpW-0007eL-TZ for linux-arm-kernel@lists.infradead.org; Thu, 19 Jun 2014 17:08:55 +0000 Received: by mail-vc0-f202.google.com with SMTP id id10so346012vcb.3 for ; Thu, 19 Jun 2014 10:08:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=i0YEz83Dm4OFfdJ4nFCdbXEqa8WidoF2+WZAT4ulrnU=; b=aMYkjv0Mc06o4YN4PaFHpDzviiI8QyrkcK4/VHKX3hMmHH6nsJMS4Y4RZLliG2iPGg Cs3IE4ab22+e8VEZQ++f8thI4Ue9kC1yIoyTuy4BXFvwgJ12nZpG5oXZG1fFsbgX2Cx7 LonhuvW4VLEREgTh42JPNUt7saeyOq5IzD0VKO6T4S0v5XYjBkDlKcQjdk5bp7YhuWwK DV6s/0kGdZnZ+gRkfeNmuzrv+wVhmkiBxsFPUP/z1kuDgVGwCX+oSIEj13Uhmyk8rVeR ZxL1DsfidFS+2fIJRn3npEz9C+DcquO/OiN32Y3v+N8mg+klk56oFS3PizTpC299cNjF yxIA== X-Gm-Message-State: ALoCoQkhkwB7VXVlV0KG1yEhR1IT15B4KfVu9iAHZOSTc8NHi0nV/OG04DNmji9QbVomVB+idEeh X-Received: by 10.236.197.226 with SMTP id t62mr2443434yhn.50.1403197713076; Thu, 19 Jun 2014 10:08:33 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id c50si434998yhl.7.2014.06.19.10.08.33 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Jun 2014 10:08:33 -0700 (PDT) Received: from tictac.mtv.corp.google.com (tictac.mtv.corp.google.com [172.22.72.141]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id DBF3031C3E3; Thu, 19 Jun 2014 10:08:32 -0700 (PDT) Received: by tictac.mtv.corp.google.com (Postfix, from userid 121310) id 7AB28807F7; Thu, 19 Jun 2014 10:08:32 -0700 (PDT) From: Doug Anderson To: Daniel Lezcano , Kukjin Kim , Tomasz Figa Subject: [PATCH v2] clocksource: exynos_mct: Fix ftrace Date: Thu, 19 Jun 2014 10:08:26 -0700 Message-Id: <1403197706-29966-1-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.0.0.526.g5318336 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140619_100855_038744_6A459EFF X-CRM114-Status: GOOD ( 13.11 ) X-Spam-Score: -0.7 (/) Cc: linux-samsung-soc@vger.kernel.org, David Riley , Chirantan Ekbote , Doug Anderson , linux-kernel@vger.kernel.org, Amit Daniel Kachhap , olof@lixom.net, Vincent Guittot , tglx@linutronix.de, javier.martinez@collabora.co.uk, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD, 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 In (93bfb76 clocksource: exynos_mct: register sched_clock callback) we supported using the MCT as a scheduler clock. We properly marked exynos4_read_sched_clock() as notrace. However, we then went and called another function that _wasn't_ notrace. That means if you do: cd /sys/kernel/debug/tracing/ echo function_graph > current_tracer You'll get a crash. Fix this (but still let other readers of the MCT be trace-enabled) by adding an extra function. It's important to keep other users of MCT traceable because the MCT is actually quite slow to access and we want exynos4_frc_read() to show up in ftrace profiles if it's the bottleneck. Signed-off-by: Doug Anderson --- Changes in v2: - Split out from other patches so this can go into 3.16. - Better comment about why exynos4_frc_read() should be traceable. - No more useless inline. drivers/clocksource/exynos_mct.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index f71d55f..5ce99c0 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -162,7 +162,7 @@ static void exynos4_mct_frc_start(void) exynos4_mct_write(reg, EXYNOS4_MCT_G_TCON); } -static cycle_t exynos4_frc_read(struct clocksource *cs) +static cycle_t notrace _exynos4_frc_read(void) { unsigned int lo, hi; u32 hi2 = __raw_readl(reg_base + EXYNOS4_MCT_G_CNT_U); @@ -176,6 +176,11 @@ static cycle_t exynos4_frc_read(struct clocksource *cs) return ((cycle_t)hi << 32) | lo; } +static cycle_t exynos4_frc_read(struct clocksource *cs) +{ + return _exynos4_frc_read(); +} + static void exynos4_frc_resume(struct clocksource *cs) { exynos4_mct_frc_start(); @@ -192,7 +197,7 @@ struct clocksource mct_frc = { static u64 notrace exynos4_read_sched_clock(void) { - return exynos4_frc_read(&mct_frc); + return _exynos4_frc_read(); } static void __init exynos4_clocksource_init(void)