From patchwork Wed Oct 28 13:11:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 55687 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp115077lbr; Wed, 28 Oct 2015 06:17:59 -0700 (PDT) X-Received: by 10.50.29.101 with SMTP id j5mr2852315igh.70.1446038279224; Wed, 28 Oct 2015 06:17:59 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oq3si21283059igb.73.2015.10.28.06.17.58; Wed, 28 Oct 2015 06:17:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965774AbbJ1NR5 (ORCPT + 28 others); Wed, 28 Oct 2015 09:17:57 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:35058 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965608AbbJ1NRl (ORCPT ); Wed, 28 Oct 2015 09:17:41 -0400 X-Greylist: delayed 342 seconds by postgrey-1.27 at vger.kernel.org; Wed, 28 Oct 2015 09:17:41 EDT Received: by wmll128 with SMTP id l128so7426510wml.0 for ; Wed, 28 Oct 2015 06:17:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rSPR9HP4LWgS6A63JrwuUalwe2lAgtjV6Ls3vodSBgI=; b=HLtAFQN6w3DTrnorpMSGp3COhP1xQxYNLs1Ygpi0FOBOYDvyt3HQL6tkoCPnY2sITV 9ulfQzdWs4hPQkLoSmUNHWZdSkNSos0ufjxHUG9RLiSDSQH2jNqhAqzk1FNn6W2ti2Gf Eg1I3LeAMSDnNeyToqf9qFtAVAZ18+9t6ZN2jWaiTESLsFQOZDcrfKVc2rqVCcEXsy0X NORleXv71eB/hpHqjj0Vya8X4k9Y84BltdTENvkuUoIpxeXATzASnhlILnM+aYaDk+pQ E7VW6OKFlxb5n+CzVz5pRL2SHiTWvdT+pdMPHfXsyCi+g9iTQg2QdHqcPeqWk0nBw05G UVLw== 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:in-reply-to :references; bh=rSPR9HP4LWgS6A63JrwuUalwe2lAgtjV6Ls3vodSBgI=; b=I6ebFhm61BZ8ME244UW50r+AvN2sKlKFIGyar6HwiDkEYzUebXlBrTZMV8YbqIye7X 0FJQnLNFl/elvgJ8QEaDK5QpekNHdd+y8c1eoXKvSLq8FmpOfZM3ET16DXikF1gPWO9E YU1lXhiGDPrkTWiYnL2SGmFJioKPa645GH5iB+ejevsLuDZLx2Cho44+Gu/VdmcAJ5kI MXGzgEkWg0Jpt1IuGZipGq64NyQ1yOR4AuZ2O9QCc6sZlmfkhawmt4jkiRw7TP1RjjQ1 jb8l838aZtRkThAd037vI68CEqmSMZZn3vWEPGwuRRRwvaXZletYiY/upq46WbbhHz04 pyzA== X-Gm-Message-State: ALoCoQlT9fxcLfTvlt/ljZ6uNw06TXmkbddY71fzSW2csvASP6VuoaDfkAHIZFkSJd9DC7riLnQS X-Received: by 10.28.136.15 with SMTP id k15mr1362995wmd.51.1446037919084; Wed, 28 Oct 2015 06:11:59 -0700 (PDT) Received: from localhost.localdomain (sju31-1-78-210-255-2.fbx.proxad.net. [78.210.255.2]) by smtp.gmail.com with ESMTPSA id lv4sm49967344wjb.43.2015.10.28.06.11.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Oct 2015 06:11:58 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Cc: Jisheng Zhang , linux-kernel@vger.kernel.org (open list:CLOCKSOURCE, CLOC...) Subject: [PATCH 2/8] clocksource/drivers/pistachio: Prevent ftrace recursion Date: Wed, 28 Oct 2015 14:11:27 +0100 Message-Id: <1446037894-22601-2-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1446037894-22601-1-git-send-email-daniel.lezcano@linaro.org> References: <5630C947.4020706@linaro.org> <1446037894-22601-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jisheng Zhang Currently pistachio can be used as a scheduler clock. We properly marked pistachio_read_sched_clock() as notrace but we then call another function pistachio_clocksource_read_cycles() that _wasn't_ notrace. Having a traceable function in the sched_clock() path leads to a recursion within ftrace and a kernel crash. Fix this by adding notrace attribute to the pistachio_clocksource_read_cycles() function. Signed-off-by: Jisheng Zhang Signed-off-by: Daniel Lezcano --- drivers/clocksource/time-pistachio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/clocksource/time-pistachio.c b/drivers/clocksource/time-pistachio.c index 18d4266..bba6799 100644 --- a/drivers/clocksource/time-pistachio.c +++ b/drivers/clocksource/time-pistachio.c @@ -67,7 +67,8 @@ static inline void gpt_writel(void __iomem *base, u32 value, u32 offset, writel(value, base + 0x20 * gpt_id + offset); } -static cycle_t pistachio_clocksource_read_cycles(struct clocksource *cs) +static cycle_t notrace +pistachio_clocksource_read_cycles(struct clocksource *cs) { struct pistachio_clocksource *pcs = to_pistachio_clocksource(cs); u32 counter, overflw;