Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753275AbbKIKJk (ORCPT ); Mon, 9 Nov 2015 05:09:40 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:33476 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752085AbbKIKHX (ORCPT ); Mon, 9 Nov 2015 05:07:23 -0500 From: Daniel Lezcano To: daniel.lezcano@linaro.org Cc: ysato@users.sourceforge.jp, tglx@linutronix.de, linux-kernel@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp (moderated list:H8/300 ARCHITECTURE) Subject: [PATCH 08/15] clocksource/drivers/h8300_timer8: Remove pointless irq re-entrant safe code Date: Mon, 9 Nov 2015 11:06:46 +0100 Message-Id: <1447063614-4662-8-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447063614-4662-1-git-send-email-daniel.lezcano@linaro.org> References: <1447063614-4662-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1614 Lines: 54 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(-) 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; } -- 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/