From patchwork Sun Nov 8 22:36:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 56173 Delivered-To: patch@linaro.org Received: by 10.112.1.169 with SMTP id 9csp162197lbn; Sun, 8 Nov 2015 14:38:43 -0800 (PST) X-Received: by 10.66.90.227 with SMTP id bz3mr22488114pab.36.1447022315725; Sun, 08 Nov 2015 14:38:35 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id lo9si17916714pab.201.2015.11.08.14.38.35; Sun, 08 Nov 2015 14:38:35 -0800 (PST) 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 S1752235AbbKHWib (ORCPT + 28 others); Sun, 8 Nov 2015 17:38:31 -0500 Received: from mail-wi0-f176.google.com ([209.85.212.176]:37206 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751693AbbKHWhh (ORCPT ); Sun, 8 Nov 2015 17:37:37 -0500 Received: by wiva10 with SMTP id a10so23627303wiv.0 for ; Sun, 08 Nov 2015 14:37:36 -0800 (PST) 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=SnOUeDcHPkZno3fyuje3k+HHXSiZ+Tegpa0fGbgXs5o=; b=mDBOz/LuX9yPLcAZCD6cpMmBDd6QP5Y+FophHNz+aPetZHioN4qJfC9cdJvLYc6BsO gkmPquMtkSWguTTZ8XnBxsOinbM2a1E/UVg/SebGgJJ6eDqto3keh/8/rwNWx0xwDlhS Z8Ita4WV5HvZ4DpIWiBmM428k23HZy+q8ctqOmtYmM7R91p18Hm8RCVdqJEmW9JdwT+C SduJD1fjOX9hA/Tf6mmceWOCi0iQbfHr2cCB+X+vOE/OGeB+N4ARsATvLLm4WGyWX8u2 5bNvp9LQ0E7RRecCOlISSDTEpQMRXCkLQM0mu+WnUUXF1PVf+kDl76JYb4oKlCwcMqaj YG+g== 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=SnOUeDcHPkZno3fyuje3k+HHXSiZ+Tegpa0fGbgXs5o=; b=lxXu++d/V7N4dTgfZzcxFtCTK68p9mfbppEtOkJXgKSsB02OvktoZqP7A6wfdJyAFH B2vKAoECwH51h9S2whXXm2rP9lmx3Z4BpRsCxz8orihaa8S7aavKJ3Ld8CWEddjKRIsp VFYgO17gKgJJFrUo1XM6Vdq7vKrlMkhAJXvuJ8ysj+PLs95o81q5dzop5eMzSRccXYpd rYTzKDyBjTHbM6h2XfkfhKKDwMAPmow2iwS11BNKqNm/lO6jFY+FpFN54Ic9QYAPa3hZ zhQht3nZmO9q5bYkSuxSJrW7Wr0P1tQaHvHgS1ZUflZtdNqEFn3RQnujpUbpCQ6YtqR8 ArrA== X-Gm-Message-State: ALoCoQkQZ2cwxJm2d4DB0Zwlc/Xp4uVN2OZnJAoZ/aQLHz0CDh5B9USVMbAhEJx/OVXjZxbAP6mE X-Received: by 10.194.78.162 with SMTP id c2mr25740034wjx.112.1447022256439; Sun, 08 Nov 2015 14:37:36 -0800 (PST) Received: from localhost.localdomain ([78.210.255.2]) by smtp.gmail.com with ESMTPSA id n17sm10912746wmg.17.2015.11.08.14.37.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Nov 2015 14:37:35 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org, ysato@users.sourceforge.jp Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp (moderated list:H8/300 ARCHITECTURE) Subject: [RFC PATCH 07/10] clocksource/drivers/h8300_timer8: Remove pointless irq re-entrant safe code Date: Sun, 8 Nov 2015 23:36:36 +0100 Message-Id: <1447022199-4648-7-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447022199-4648-1-git-send-email-daniel.lezcano@linaro.org> References: <1447022199-4648-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 The current code assumes the interrupt function is re-entrant. That is not correct. An interrupt handler is never invoked concurrently. The interrupt line is masked on all processors. Remove the chewing flags in the code. Signed-off-by: Daniel Lezcano --- drivers/clocksource/h8300_timer8.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) -- 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/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c index 680f65b..ba219cf 100644 --- a/drivers/clocksource/h8300_timer8.c +++ b/drivers/clocksource/h8300_timer8.c @@ -24,8 +24,6 @@ #define TCORB 6 #define _8TCNT 8 -#define FLAG_SKIPEVENT (1 << 1) -#define FLAG_IRQCONTEXT (1 << 2) #define FLAG_STARTED (1 << 3) #define SCALE 64 @@ -67,14 +65,13 @@ static irqreturn_t timer8_interrupt(int irq, void *dev_id) ctrl_outb(ctrl_inb(p->mapbase + _8TCSR) & ~0x40, p->mapbase + _8TCSR); - p->flags |= FLAG_IRQCONTEXT; + ctrl_outw(p->tcora, p->mapbase + TCORA); - if (!(p->flags & FLAG_SKIPEVENT)) { - if (clockevent_state_oneshot(&p->ced)) - ctrl_outw(0x0000, p->mapbase + _8TCR); - p->ced.event_handler(&p->ced); - } - p->flags &= ~(FLAG_SKIPEVENT | FLAG_IRQCONTEXT); + + if (clockevent_state_oneshot(&p->ced)) + ctrl_outw(0x0000, p->mapbase + _8TCR); + + p->ced.event_handler(&p->ced); return IRQ_HANDLED; }