From patchwork Sun Nov 8 22:36:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 56174 Delivered-To: patch@linaro.org Received: by 10.112.1.169 with SMTP id 9csp162277lbn; Sun, 8 Nov 2015 14:39:02 -0800 (PST) X-Received: by 10.66.100.199 with SMTP id fa7mr34574277pab.149.1447022342345; Sun, 08 Nov 2015 14:39:02 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qu10si17945119pbb.181.2015.11.08.14.39.01; Sun, 08 Nov 2015 14:39:02 -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 S1752295AbbKHWie (ORCPT + 28 others); Sun, 8 Nov 2015 17:38:34 -0500 Received: from mail-wi0-f180.google.com ([209.85.212.180]:34674 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751708AbbKHWhi (ORCPT ); Sun, 8 Nov 2015 17:37:38 -0500 Received: by wikq8 with SMTP id q8so58084448wik.1 for ; Sun, 08 Nov 2015 14:37:37 -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=erttoJ8DjY8pk0D0FYPqznfDENlPU6LP72BkZcrg1Gc=; b=H4qtu1GV5sOc5bKHzHSDMAeYudHruV9m8uYp8e0Cf5MS2KfU1bczgFB+x/t4LasCNs kBS/EbPGJccsU0c2Ddkl8E5h5MaLZaXl70gqEypLIDAJdyy1mBG/TZ9i/JDWK/1EQPOa L56DK0a15jNTVHrax3EBQyBEA2LxoFoUnF1+p6Q8VPHKKUqEROvRZTCeogbcWKHbecRv itEaaXs0enHLBPy2K6s/7kvka+vZT8xcceyH7RcHkwxnDY46BSIbsSZ5aB9a1647VSW/ l4AfybzbkUJUPEdHte/u+6Y3JuN79mB1pTBlE/zz2YTB3kiQfkXzePTmY5zInXlvct37 SmXA== 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=erttoJ8DjY8pk0D0FYPqznfDENlPU6LP72BkZcrg1Gc=; b=RvzGxHmnEv2pinbtXMG+kqyQFrhaqXGywYn3+ylRSjPDfgksYGnEkF/8OwIiJ8+o9Z hhDMAO3UeL/TpjgqrPfnVgHbetdT/V76W247rG9oFjk3tHc0h+zw1tuAuSma/PoWPrIx ttmWw5VB/vy9nEkax5A+nwfPHHbzKcOGt7dgPL2qkNJvhq0gxEeSN1otgr1yhayyEcHf xZrprl3qpYdZaiLirmFx4bH6B6Zzo8XryfNyV+C8Z8medlSCUWH47Y1KaNfL9yopfK+a 14xTC9oMXpOqdlLeNb2ivy0ES/kHfnl77DidSE8l6TDpf1pEGempszj+RiA8JmVkN3cL m+HQ== X-Gm-Message-State: ALoCoQlprv35u+c+2d94do5SYnXjJqbK/rD950CsHBgoR5f3CcAz+oF+JpIHGYkQ6Xl8eglaWVsT X-Received: by 10.194.84.4 with SMTP id u4mr26327687wjy.149.1447022257759; Sun, 08 Nov 2015 14:37:37 -0800 (PST) Received: from localhost.localdomain ([78.210.255.2]) by smtp.gmail.com with ESMTPSA id n17sm10912746wmg.17.2015.11.08.14.37.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Nov 2015 14:37:37 -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 08/10] clocksource/drivers/h8300_timer8: Remove irq and lock legacy code Date: Sun, 8 Nov 2015 23:36:37 +0100 Message-Id: <1447022199-4648-8-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 time framawork takes care of disabling the interrupts and takes a lock to prevent races. Remove the legacy code in the driver taking care of the races. Signed-off-by: Daniel Lezcano --- drivers/clocksource/h8300_timer8.c | 16 ---------------- 1 file changed, 16 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 ba219cf..0885014 100644 --- a/drivers/clocksource/h8300_timer8.c +++ b/drivers/clocksource/h8300_timer8.c @@ -31,7 +31,6 @@ struct timer8_priv { struct clock_event_device ced; unsigned long mapbase; - raw_spinlock_t lock; unsigned long flags; unsigned int rate; unsigned int tcora; @@ -78,10 +77,8 @@ static irqreturn_t timer8_interrupt(int irq, void *dev_id) static void timer8_set_next(struct timer8_priv *p, unsigned long delta) { - unsigned long flags; unsigned long now; - raw_spin_lock_irqsave(&p->lock, flags); if (delta >= 0x10000) dev_warn(&p->pdev->dev, "delta out of range\n"); now = timer8_get_counter(p); @@ -91,8 +88,6 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta) ctrl_outw(delta, p->mapbase + TCORA); else ctrl_outw(now + 1, p->mapbase + TCORA); - - raw_spin_unlock_irqrestore(&p->lock, flags); } static int timer8_enable(struct timer8_priv *p) @@ -108,9 +103,6 @@ static int timer8_enable(struct timer8_priv *p) static int timer8_start(struct timer8_priv *p) { int ret = 0; - unsigned long flags; - - raw_spin_lock_irqsave(&p->lock, flags); if (!(p->flags & FLAG_STARTED)) ret = timer8_enable(p); @@ -120,20 +112,12 @@ static int timer8_start(struct timer8_priv *p) p->flags |= FLAG_STARTED; out: - raw_spin_unlock_irqrestore(&p->lock, flags); - return ret; } static void timer8_stop(struct timer8_priv *p) { - unsigned long flags; - - raw_spin_lock_irqsave(&p->lock, flags); - ctrl_outw(0x0000, p->mapbase + _8TCR); - - raw_spin_unlock_irqrestore(&p->lock, flags); } static inline struct timer8_priv *ced_to_priv(struct clock_event_device *ced)