From patchwork Tue Jun 7 04:54:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caesar Wang X-Patchwork-Id: 9159849 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 6934960467 for ; Tue, 7 Jun 2016 04:57:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E54C26861 for ; Tue, 7 Jun 2016 04:57:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52A2F2833E; Tue, 7 Jun 2016 04:57:03 +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 DE04126861 for ; Tue, 7 Jun 2016 04:57:02 +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 1bA933-0003Ha-0B; Tue, 07 Jun 2016 04:55:29 +0000 Received: from mail-pf0-f193.google.com ([209.85.192.193]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bA92p-00020H-O1; Tue, 07 Jun 2016 04:55:16 +0000 Received: by mail-pf0-f193.google.com with SMTP id l188so2756962pfl.1; Mon, 06 Jun 2016 21:54:55 -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=daBak+YPvNqFCvGHYuKSEfu3zKPP3qm6ZjyDLLvP5DM=; b=iTQYonLlbmvieAMowjIbWCxQatbLrsua+vPetkUTTSXXows9BJeJ5Q4XCnUnZDuj7A GMHBkGFDHvst5No4V/RHMaL+7bD78H5ivTXu56GnIs6Gqx95FL+iMIYP0jPSHVlko+uo 5QeTx5T/563I2E0hKRZ0gRRPaMpN4vEpfyei1ptnrQ3nXCi4PA/zArOb74OSGDi8ztVM WW8FQu7aNd81U1PQlAegGors7rrEL0nZ+rZTSiHauZUbStNJhQv/HwYWGl7dJf+p4Gl+ MD2XHiInSkEfuZmS37V2tA//3ZntsovGajNp6cdOdQ42Edo5McbeXNsIXr4BIgSMi/30 OWqg== X-Gm-Message-State: ALyK8tJZ05Kxzxh2d568MPOnatoNpAvzFfBogZKSYYjkLDdj14wEyJWDU2xJ+mtJYoWcRg== X-Received: by 10.98.32.15 with SMTP id g15mr8548709pfg.67.1465275295062; Mon, 06 Jun 2016 21:54:55 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id kb15sm29074009pad.28.2016.06.06.21.54.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Jun 2016 21:54:54 -0700 (PDT) From: Caesar Wang To: daniel.lezcano@linaro.org, Heiko Stuebner Subject: [PATCH v2 2/4] clocksource: rockchip: add dynamic irq flag to the timer Date: Tue, 7 Jun 2016 12:54:31 +0800 Message-Id: <1465275273-22076-3-git-send-email-wxt@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465275273-22076-1-git-send-email-wxt@rock-chips.com> References: <1465275273-22076-1-git-send-email-wxt@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160606_215515_928860_A52A41FF X-CRM114-Status: GOOD ( 10.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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 possible cpus 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 --- Changes in v2: - s/cpu_all_mask/cpu_possible_mask/, As Daniel comments on https://patchwork.kernel.org/patch/9135053/. 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 b991b28..b510863 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_possible_mask; ce->rating = 250; rk_timer_interrupt_clear(ce);