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: 4296211 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 E98989F1D6 for ; Wed, 4 Jun 2014 17:36:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 165AA20160 for ; Wed, 4 Jun 2014 17:36:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 39C0D20154 for ; Wed, 4 Jun 2014 17:36:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751128AbaFDRgJ (ORCPT ); Wed, 4 Jun 2014 13:36:09 -0400 Received: from mail-yh0-f73.google.com ([209.85.213.73]:38758 "EHLO mail-yh0-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750944AbaFDRgI (ORCPT ); Wed, 4 Jun 2014 13:36:08 -0400 Received: by mail-yh0-f73.google.com with SMTP id f73so1676403yha.4 for ; Wed, 04 Jun 2014 10:36:08 -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=Xb6zy/2osVln5wsUKLJEzvInZ/2upQ/baMbzia1i7v1whHeju3FE52ZJEnLrlqShAF O9BLeBEkuadD+Tu6zHtEmY2VQS9jqHnt093famCI0grxRZRj+NmLBb6If3ZwIirs7f4c 4Qb15H6Bb5L0m6yyzuwtxyiqpPuJM0JHFRQNIpAJL24xGqyKZy6ghLgH7dN8ZbOmb1DI KjFPJX7P100q7ys7N7vrBJyH1OIOWdVMAB5sJVOeZigG+7r0MDM17MzdLij3ajVysTD6 bVaafJf2I6gr4AlS1OyyazXKuOXDnzkt5Ik8JQfSvpGcladASuExjdG+Imo9wcAhAMPg roIw== X-Gm-Message-State: ALoCoQmxnkyxHffZy6CuX71OcJY3UtKLH+McKD5JIy3Uj5Ncyv8QPEqZjCPOi1mGpyVx0UgN/KBD 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 Cc: Daniel Lezcano , Vincent Guittot , Chirantan Ekbote , David Riley , olof@lixom.net, linux-samsung-soc@vger.kernel.org, Doug Anderson , tglx@linutronix.de, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 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)