From patchwork Wed Jun 4 17:30:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 4296201 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DD226BEEA7 for ; Wed, 4 Jun 2014 17:33:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1CE0F201DE for ; Wed, 4 Jun 2014 17:33:31 +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 375E420149 for ; Wed, 4 Jun 2014 17:33:30 +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 1WsF2C-0007sQ-VO; Wed, 04 Jun 2014 17:31:32 +0000 Received: from mail-ve0-f201.google.com ([209.85.128.201]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WsF22-0007es-1c for linux-arm-kernel@lists.infradead.org; Wed, 04 Jun 2014 17:31:22 +0000 Received: by mail-ve0-f201.google.com with SMTP id db11so1677943veb.0 for ; Wed, 04 Jun 2014 10:31:00 -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=dnZAZIP/qoHbBRupZMFnNGcm6I7YQfbiIDPCZt16Qiw=; b=gt01X1ScLZGSMo+GaQVp5UKNNIrJJgHdjpLoPceG0STJOpHzjl5KVCjY/5Pvd+3i++ oQXc5Pv0vqv6REYYfTJAsQhVB4FII/NhPA7ogawufy8vJ+w/QEkGW3udXJiU9Ic3Pi4g iFoMuzgtoANlX2w1dPq5VwMaYv8Q0/Cu+NdRBFKDYvk1H5f7SWkq0S3c/TGeR/FNaJfS O3R45Z5KdErz/v6XyBmMVhUOCTv14P5y9tr/Vv0xqQYY9CIJQWu7WBymeMg8YghblaTk DWAMBNV4ekFBntKbe5cW7O3gh4Uo/PjcjiMGOJCclbNRvThCqjK6hFvojpXOVuQjF+uu etWQ== X-Gm-Message-State: ALoCoQktmkp5SQ/fIlak9tUmX2E2/eIodSyRldQQKPVl2fdz2VTTrvhC0nSdL+uJfPZ3j7mWCQ4H X-Received: by 10.58.107.203 with SMTP id he11mr22862599veb.12.1401903060512; Wed, 04 Jun 2014 10:31:00 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id t4si281318yhm.0.2014.06.04.10.31.00 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Jun 2014 10:31:00 -0700 (PDT) Received: from tictac.mtv.corp.google.com (tictac.mtv.corp.google.com [172.22.72.141]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 483FC5A45C7; Wed, 4 Jun 2014 10:30:57 -0700 (PDT) Received: by tictac.mtv.corp.google.com (Postfix, from userid 121310) id E1E4A809C1; Wed, 4 Jun 2014 10:30:56 -0700 (PDT) From: Doug Anderson To: Kukjin Kim , Tomasz Figa Subject: [PATCH 1/3] clocksource: exynos_mct: Fix ftrace Date: Wed, 4 Jun 2014 10:30:32 -0700 Message-Id: <1401903034-20074-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-20140604_103122_164581_6B9D8BA8 X-CRM114-Status: GOOD ( 12.50 ) X-Spam-Score: -1.4 (-) Cc: linux-samsung-soc@vger.kernel.org, David Riley , Chirantan Ekbote , Daniel Lezcano , Doug Anderson , linux-kernel@vger.kernel.org, olof@lixom.net, Vincent Guittot , tglx@linutronix.de, 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=-2.5 required=5.0 tests=BAYES_00,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. Signed-off-by: Doug Anderson --- 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 8d64200..ba3a683 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -165,7 +165,7 @@ static void exynos4_mct_frc_start(u32 hi, u32 lo) exynos4_mct_write(reg, EXYNOS4_MCT_G_TCON); } -static cycle_t exynos4_frc_read(struct clocksource *cs) +static inline cycle_t notrace _exynos4_frc_read(void) { unsigned int lo, hi; u32 hi2 = __raw_readl(reg_base + EXYNOS4_MCT_G_CNT_U); @@ -179,6 +179,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(0, 0); @@ -195,7 +200,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)