From patchwork Fri Dec 18 14:17:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 58684 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp1056271lbb; Fri, 18 Dec 2015 06:19:42 -0800 (PST) X-Received: by 10.66.192.7 with SMTP id hc7mr5605694pac.48.1450448377130; Fri, 18 Dec 2015 06:19:37 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wv16si15245155pac.158.2015.12.18.06.19.36; Fri, 18 Dec 2015 06:19:37 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933143AbbLROTc (ORCPT + 29 others); Fri, 18 Dec 2015 09:19:32 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:37316 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964804AbbLROT2 (ORCPT ); Fri, 18 Dec 2015 09:19:28 -0500 Received: by mail-wm0-f51.google.com with SMTP id p187so66502823wmp.0 for ; Fri, 18 Dec 2015 06:19:27 -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=r9lT+YSn9Gu/2LfjiA8Gk6QCTWxNiYJGlbLe88ZOfcM=; b=TWftykbgGdGQi5yChhDiB9/eKgWYXjlfGdWEGrpZk/TKZRD0NME/3ygpxnOWBwDL3i rB5sGKxW105QH7HEflDA+j6LXI0SSaJzW59gsYe10IwpMQA5fLZcyd58kAxkk3i93q7l EKDpdM/iV/d13fqVykGDD85FOkxpjeBjcf6i4= 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=r9lT+YSn9Gu/2LfjiA8Gk6QCTWxNiYJGlbLe88ZOfcM=; b=H558BYVfINA3UdFz0Ogrbrl4b4yaDr2ovZaDfSRrfbKzzxA8pkM7MbeAunqZAr30vm 91iEy54tfyx33GlTIV/LBweOonM+Dh///7SYOT1gW/Z8XZPJTfwFROhrWIXO0Vj2Yj/5 o9YG7JdJWvtz5/Q3w6KoPWvQZWFwWqXNmk4GVFa177YQsm1kd+qL95+FT8gQuF4+nMXP lMVjVQ4rzU8psk2puwJ5xj/khIffLOgaFROaU+mb6ZVdriGN3eNjPks8LzeeLVfWrjaw S6UL2pjdKP1dCQ/8UAuogU9l5nc5aQWocuH8opDm/EvxgqFkhgKMrWnSIrUyJt+kXAqd ibKQ== X-Gm-Message-State: ALoCoQnrh/Xj829BOjwxkxHOFh+jV2MjaQAW5dGj+m2AXCcBWJxq7GF5rNr27udFIMI+8iw90Yasr5/t1UHZKNJJkvo/eQsNKg== X-Received: by 10.194.172.35 with SMTP id az3mr5020148wjc.64.1450448366872; Fri, 18 Dec 2015 06:19:26 -0800 (PST) Received: from localhost.localdomain ([78.210.255.2]) by smtp.gmail.com with ESMTPSA id ql10sm15010027wjc.23.2015.12.18.06.19.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Dec 2015 06:19:26 -0800 (PST) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mingo@kernel.org, Yoshinori Sato , uclinux-h8-devel@lists.sourceforge.jp (moderated list:H8/300 ARCHITECTURE) Subject: [PATCH 45/69] clocksource/drivers/h8300_timer8: Remove pointless irq re-entrant safe code Date: Fri, 18 Dec 2015 15:17:58 +0100 Message-Id: <1450448302-27429-45-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450448302-27429-1-git-send-email-daniel.lezcano@linaro.org> References: <5672CB9E.7090707@linaro.org> <1450448302-27429-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 3eedeff..7111b99 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; }