From patchwork Wed May 25 09:50:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caesar Wang X-Patchwork-Id: 9135053 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7166E60221 for ; Wed, 25 May 2016 09:51:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6580628110 for ; Wed, 25 May 2016 09:51:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A5E3282D7; Wed, 25 May 2016 09:51:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E7A3228110 for ; Wed, 25 May 2016 09:51:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b5VTV-0000Pp-E5; Wed, 25 May 2016 09:51:37 +0000 Received: from mail-pa0-f65.google.com ([209.85.220.65]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b5VSg-0007sP-EI; Wed, 25 May 2016 09:50:48 +0000 Received: by mail-pa0-f65.google.com with SMTP id f8so4707147pag.0; Wed, 25 May 2016 02:50:28 -0700 (PDT) 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=jrgScownvIDFywQqSvMeedysmUvpWrpiU5aZhvJDVQI=; b=YxaQrSvlu2wPqmPO68+pLegWYhjCZsyCdGiAVdoV0glLc3QnuFtvhVpojhXLPUh9OT /bvV4kWqbSZ2kJKxsZGGKU+6E91A+V4v57SMZSEAfbw/hNTDZaTcgpsxEsJI9ODoL/fW /LfXF8wTEJNPdFV8tg6efrshm+jpZdz4fAgX2WZ67cZXGYtG8hPaNO8VUZRDPtAC7o1j S3tnnFOwvsfaYr6C4L6jfJWGO5SqgMQbCvyF1QhLX0f2OPGIGRKwU1NaL18zVdfw9pRI h3nSSH6CF5P15ouSdT+tNpaw2pliLzxRBrwAimiGvRPH7MaQPkQo2sXQ42x7r20By27f Zkfg== X-Gm-Message-State: ALyK8tLRzD4AK1DQXxUfgBpy5aFgsafsUrh9Z6hcpEqT4rXGAdib+u5RXR3hdmJ7A2gURA== X-Received: by 10.66.237.66 with SMTP id va2mr4389914pac.2.1464169828352; Wed, 25 May 2016 02:50:28 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id t8sm11406898paw.16.2016.05.25.02.50.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 May 2016 02:50:27 -0700 (PDT) From: Caesar Wang To: daniel.lezcano@linaro.org, Heiko Stuebner Subject: [PATCH 3/5] clocksource: rockchip: add dynamic irq flag to the timer Date: Wed, 25 May 2016 17:50:00 +0800 Message-Id: <1464169802-6033-4-git-send-email-wxt@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464169802-6033-1-git-send-email-wxt@rock-chips.com> References: <1464169802-6033-1-git-send-email-wxt@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160525_025046_695658_5B725703 X-CRM114-Status: GOOD ( 10.61 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: huangtao@rock-chips.com, dianders@chromium.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, smbarber@google.com, cf@rock-chips.com, briannorris@google.com, Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Caesar Wang MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Huang Tao The rockchip timer is broadcast timer. Add CLOCK_EVT_FEAT_DYNIRQ flag and set cpumask to all cpu to save power by avoid unnecessary wakeups and IPIs. Signed-off-by: Huang Tao Cc: Daniel Lezcano Cc: Thomas Gleixner Cc: Heiko Stuebner Tested-by: Jianqun Xu Signed-off-by: Caesar Wang --- drivers/clocksource/rockchip_timer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/rockchip_timer.c b/drivers/clocksource/rockchip_timer.c index b93fed6..f3dfb1a 100644 --- a/drivers/clocksource/rockchip_timer.c +++ b/drivers/clocksource/rockchip_timer.c @@ -150,12 +150,13 @@ static void __init rk_timer_init(struct device_node *np) } ce->name = TIMER_NAME; - ce->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; + ce->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT | + CLOCK_EVT_FEAT_DYNIRQ; ce->set_next_event = rk_timer_set_next_event; ce->set_state_shutdown = rk_timer_shutdown; ce->set_state_periodic = rk_timer_set_periodic; ce->irq = irq; - ce->cpumask = cpumask_of(0); + ce->cpumask = cpu_all_mask; ce->rating = 250; ret = request_irq(irq, rk_timer_interrupt, IRQF_TIMER, TIMER_NAME, ce);