From patchwork Sat Feb 23 13:06:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 159128 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp34557jad; Sat, 23 Feb 2019 05:09:24 -0800 (PST) X-Google-Smtp-Source: AHgI3IYyWO4dsqNNKR8OVNKASDBqCiIgRfP3wsQigiZ9/OKn0Xq2/Or+mCFmt+k4hL9beV2BIfQB X-Received: by 2002:a65:6091:: with SMTP id t17mr8900950pgu.416.1550927364281; Sat, 23 Feb 2019 05:09:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550927364; cv=none; d=google.com; s=arc-20160816; b=ZXKRg1usr2vdAUcdgYUX4HeM/AM7oMzQPu1fZuAh5YZ5svjS6HTVXJgNBkk7eXjPHA SZJ70VYeh/9vMYXabUqV/xdEw9XRBwkOkzLabHt6ccpUqxayoLjU6rvVdYNyUUAHlG1U WVA7X62ljEF87zGjCqcDcDH9kin4zSNF38xr134Of7HvBm+5VElUXeiBoHj7UgCfxsTY a41X4Iisj6EcGUMvtre8BFrolFd1zvNCW8O+5aeR5bA9ZW0R/9KSMQeBMYTOXS6skUQ3 HwTku/DqayDFyk+dDC5TwxCv5+GdFEpif2wKWdnIzY5dMiXAQVEooM7cXmWmc6wX4k4X AWLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=e7WizLNdunmkgpvUZcueZ9x7MQ1ttRLHdGjFtWenvEw=; b=aLeiaINdj6q9RewPLFAZfboI+8qUJtDn2KmHv9X7BL7/fG0NBd1cyzrbIiRVEjv9NU 0DnpAra9NR9SYl72OZUVefxWOS019VtrJKsKEsaZgZnO3YpzV6uAXdKxPXzqC9iiVjMU A8pWAD/VHKzpEailDR3AVMgoYBThejCO3h0gJec+VF7oceJ6tlk4ais9HY2NczBhKOyp YjCRZOYIcNW9Lr9meiocj3wMzRUYYFW2SoVByw+5Rl/s70k1EcC6xVV2N6AAyEeMa/ZH 3QPEu/OnI1IrWTHk6GKoC0VDpbKHS9XsP9uD632wBLe5Xva9nHEOSETHlhvVj0Z55FI+ yYfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XAc5B7k3; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j4si3798132pgc.186.2019.02.23.05.09.24; Sat, 23 Feb 2019 05:09:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XAc5B7k3; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725859AbfBWNJX (ORCPT + 3 others); Sat, 23 Feb 2019 08:09:23 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51090 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727773AbfBWNIA (ORCPT ); Sat, 23 Feb 2019 08:08:00 -0500 Received: by mail-wm1-f66.google.com with SMTP id x7so4251908wmj.0 for ; Sat, 23 Feb 2019 05:07:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=e7WizLNdunmkgpvUZcueZ9x7MQ1ttRLHdGjFtWenvEw=; b=XAc5B7k3LFdets0XOM7Vv1NwuvRTyprMF4KE1poem0QeAOBRSZaEkvXLvvMElE88UJ wZ+mJwCm0WJSRKSMlAzUeCt4HxQjin9Mf8yftyPSOlDVUpX0ZUO/hKWwuvDAJ/U9A9+f WWchtkd39iAka+FjXizc+PLkcA+mRkDq5yqzYSGIooAPzGssecRFkemdCPG1atmPDguZ OlanMP5QjHDkVZagrbFRyPHGXCv+KL7wHinLBt3X+x95Qut8Qa4QOdoKjFWgFyetK70t 0xBUBYJZidOCdUfWFIbu+Dfx83Py97vk6qCDFJ4FEgtDKMwxpseVVy4m80hQ5ZS9uLMy 9afw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=e7WizLNdunmkgpvUZcueZ9x7MQ1ttRLHdGjFtWenvEw=; b=GoIdoOtUh8KSBxfAKm7TIM49qvEn+GVJahSKp+xM1nRU38xuqEg/OqXHYupr0YAQXk tjrUPiQJEEHo1WUTrKLGIv+RFCvF5ZBcFRgVJDUH5azaquohvamnPTPF1b4Bkjd9Jxuj D/9TtnPVfiFbHA7FlZ5GuokR8p0zn6rOcYAK6IKwdda10TdXPb9rLQhTsd+NfRykFq5C ayqhPC1QRkVucvfFHVeKdAExZ0cetWYQeY7OQxL3odIHA27GjwzjHy2lIqRSJi66stQI yfRPEledyX9fdsJ5Ttz4+3qn3NCi6S/4YgaimaQZOWuNtppZ/2CqHv6USEABPoDDWCDy ldQA== X-Gm-Message-State: AHQUAubNYEQY5gbscbE0IXF0ssWPo0dYw295SOjgSqwa2wJPJ34i1nZc JEZ59okOryyT9Db6jI2d8C5XHg== X-Received: by 2002:a05:600c:219a:: with SMTP id e26mr5675795wme.93.1550927277877; Sat, 23 Feb 2019 05:07:57 -0800 (PST) Received: from clegane.local (189.126.130.77.rev.sfr.net. [77.130.126.189]) by smtp.gmail.com with ESMTPSA id i12sm7830746wrq.21.2019.02.23.05.07.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Feb 2019 05:07:57 -0800 (PST) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Stuart Menefy , stable@vger.kernel.org, Marek Szyprowski , Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org (moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES), linux-samsung-soc@vger.kernel.org (moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES) Subject: [PATCH 03/18] clocksource/drivers/exynos_mct: Move one-shot check from tick clear to ISR Date: Sat, 23 Feb 2019 14:06:51 +0100 Message-Id: <20190223130707.16704-3-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190223130707.16704-1-daniel.lezcano@linaro.org> References: <20190223130707.16704-1-daniel.lezcano@linaro.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Stuart Menefy When a timer tick occurs and the clock is in one-shot mode, the timer needs to be stopped to prevent it triggering subsequent interrupts. Currently this code is in exynos4_mct_tick_clear(), but as it is only needed when an ISR occurs move it into exynos4_mct_tick_isr(), leaving exynos4_mct_tick_clear() just doing what its name suggests it should. Signed-off-by: Stuart Menefy Reviewed-by: Krzysztof Kozlowski Tested-by: Marek Szyprowski Cc: stable@vger.kernel.org # v4.3+ Signed-off-by: Daniel Lezcano --- drivers/clocksource/exynos_mct.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) -- 2.17.1 diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 7a244b681876..1e325f89d408 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -388,6 +388,13 @@ static void exynos4_mct_tick_start(unsigned long cycles, exynos4_mct_write(tmp, mevt->base + MCT_L_TCON_OFFSET); } +static void exynos4_mct_tick_clear(struct mct_clock_event_device *mevt) +{ + /* Clear the MCT tick interrupt */ + if (readl_relaxed(reg_base + mevt->base + MCT_L_INT_CSTAT_OFFSET) & 1) + exynos4_mct_write(0x1, mevt->base + MCT_L_INT_CSTAT_OFFSET); +} + static int exynos4_tick_set_next_event(unsigned long cycles, struct clock_event_device *evt) { @@ -420,8 +427,11 @@ static int set_state_periodic(struct clock_event_device *evt) return 0; } -static void exynos4_mct_tick_clear(struct mct_clock_event_device *mevt) +static irqreturn_t exynos4_mct_tick_isr(int irq, void *dev_id) { + struct mct_clock_event_device *mevt = dev_id; + struct clock_event_device *evt = &mevt->evt; + /* * This is for supporting oneshot mode. * Mct would generate interrupt periodically @@ -430,16 +440,6 @@ static void exynos4_mct_tick_clear(struct mct_clock_event_device *mevt) if (!clockevent_state_periodic(&mevt->evt)) exynos4_mct_tick_stop(mevt); - /* Clear the MCT tick interrupt */ - if (readl_relaxed(reg_base + mevt->base + MCT_L_INT_CSTAT_OFFSET) & 1) - exynos4_mct_write(0x1, mevt->base + MCT_L_INT_CSTAT_OFFSET); -} - -static irqreturn_t exynos4_mct_tick_isr(int irq, void *dev_id) -{ - struct mct_clock_event_device *mevt = dev_id; - struct clock_event_device *evt = &mevt->evt; - exynos4_mct_tick_clear(mevt); evt->event_handler(evt);