From patchwork Sun Sep 6 04:23:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yingliang X-Patchwork-Id: 7130621 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 442879F380 for ; Sun, 6 Sep 2015 04:28:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5BB0E20806 for ; Sun, 6 Sep 2015 04:28:22 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 7266520802 for ; Sun, 6 Sep 2015 04:28:21 +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 1ZYRX8-0006lt-8q; Sun, 06 Sep 2015 04:26:26 +0000 Received: from szxga03-in.huawei.com ([119.145.14.66]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZYRX4-0006gf-Uk for linux-arm-kernel@lists.infradead.org; Sun, 06 Sep 2015 04:26:23 +0000 Received: from 172.24.1.51 (EHLO szxeml430-hub.china.huawei.com) ([172.24.1.51]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BMJ78206; Sun, 06 Sep 2015 12:24:08 +0800 (CST) Received: from localhost (10.177.19.219) by szxeml430-hub.china.huawei.com (10.82.67.185) with Microsoft SMTP Server id 14.3.235.1; Sun, 6 Sep 2015 12:23:59 +0800 From: Yang Yingliang To: , Subject: [RFC PATCH v1 1/4] genirq: Introduce irq_settings_set_move_pcntxt() helper Date: Sun, 6 Sep 2015 12:23:38 +0800 Message-ID: <1441513421-8092-2-git-send-email-yangyingliang@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1441513421-8092-1-git-send-email-yangyingliang@huawei.com> References: <1441513421-8092-1-git-send-email-yangyingliang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.19.219] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090201.55EBBFEB.0052, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 515c92bf8c939fc2447d3a6ce36c22a9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150905_212623_348825_9B7490F9 X-CRM114-Status: GOOD ( 11.16 ) X-Spam-Score: -4.2 (----) 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: Mark Rutland , Russell King - ARM Linux , Marc Zyngier , Will Deacon , Hanjun Guo , Yang Yingliang , Thomas Gleixner , Jiang Liu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It's expected to use the helper when interrupt can be moved in process. Cc: Jiang Liu Cc: Thomas Gleixner Cc: Marc Zyngier Cc: Mark Rutland Cc: Will Deacon Cc: Russell King - ARM Linux Cc: Hanjun Guo Signed-off-by: Yang Yingliang --- include/linux/irq.h | 1 + kernel/irq/irqdesc.c | 12 ++++++++++++ kernel/irq/settings.h | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/include/linux/irq.h b/include/linux/irq.h index 6f8b340..f4ecfb9 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -514,6 +514,7 @@ static inline void irq_set_chip_and_handler(unsigned int irq, struct irq_chip *c } extern int irq_set_percpu_devid(unsigned int irq); +extern int irq_set_move_pcntxt(unsigned int irq); extern void __irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained, diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 0a2a4b6..c036a1a 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -580,6 +580,18 @@ int irq_set_percpu_devid(unsigned int irq) return 0; } +int irq_set_move_pcntxt(unsigned int irq) +{ + struct irq_desc *desc = irq_to_desc(irq); + + if (!desc) + return -EINVAL; + + irq_settings_set_move_pcntxt(desc); + + return 0; +} + void kstat_incr_irq_this_cpu(unsigned int irq) { kstat_incr_irqs_this_cpu(irq_to_desc(irq)); diff --git a/kernel/irq/settings.h b/kernel/irq/settings.h index 3320b84..ea58bc2 100644 --- a/kernel/irq/settings.h +++ b/kernel/irq/settings.h @@ -135,6 +135,11 @@ static inline void irq_settings_set_noprobe(struct irq_desc *desc) desc->status_use_accessors |= _IRQ_NOPROBE; } +static inline void irq_settings_set_move_pcntxt(struct irq_desc *desc) +{ + desc->status_use_accessors |= _IRQ_MOVE_PCNTXT; +} + static inline bool irq_settings_can_move_pcntxt(struct irq_desc *desc) { return desc->status_use_accessors & _IRQ_MOVE_PCNTXT;