From patchwork Mon Aug 26 15:36:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 2849663 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6168E9F271 for ; Mon, 26 Aug 2013 15:38:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3630C20384 for ; Mon, 26 Aug 2013 15:38:12 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD9BD2037B for ; Mon, 26 Aug 2013 15:38:10 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VDyrL-0006UT-Oi; Mon, 26 Aug 2013 15:37:40 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VDyrB-0002al-I8; Mon, 26 Aug 2013 15:37:29 +0000 Received: from mail-ea0-f169.google.com ([209.85.215.169]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VDyqr-0002Y4-JC for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2013 15:37:10 +0000 Received: by mail-ea0-f169.google.com with SMTP id k11so1712553eaj.28 for ; Mon, 26 Aug 2013 08:36:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pRrkYvwq1QMXPp3ed9gOikj3RhU2RTb3661ywqSe57U=; b=llhWYVSiycqnwfosznj80/EWlKVYy4A4Gcpca86Ehe2fDl03WfxgtUvXkkE6N1oxSk WQK6b5MHIfWgJwH7/GZbV1d4elRCniPIzdmerxDiX3Cl1+Cgf1NWXAlALN3r4jlEMtr7 ju/S34rrp6FqlenAlEnj2yOo1eZ/D6IknLI0nXz8wcg5a2vjQKjZY3qb805NMPtpItjS 7wzJu+c7L52esZkux5lwT9GIgxx5QQ8AeHUig4HA5o9A8IMCuq7LY/WCKQpFxQFJSU4Q wypfUNREh2I6JpVaVMOlIEWo5nmRX8rjvatNTT7pyMYbJjmjAxYjH+chi99z2btkpWii sMbg== X-Gm-Message-State: ALoCoQlWGZ9S2EoNVBLaSiQUxH9tmOqFe+zw6+rC4PnqESHL/+3rXIFtjavhgD5fAOUMqkEzi7Po X-Received: by 10.14.42.3 with SMTP id i3mr224980eeb.95.1377531407851; Mon, 26 Aug 2013 08:36:47 -0700 (PDT) Received: from tn-HP3-PC.semihalf.com (cardhu.semihalf.com. [213.17.239.108]) by mx.google.com with ESMTPSA id i1sm22244200eeg.0.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 26 Aug 2013 08:36:47 -0700 (PDT) From: Tomasz Nowicki To: linaro-acpi@lists.linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] kernel, irq: Use interrupt prioritization infrastructure during interrupt setup. Date: Mon, 26 Aug 2013 17:36:24 +0200 Message-Id: <1377531385-19369-3-git-send-email-tomasz.nowicki@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1377531385-19369-1-git-send-email-tomasz.nowicki@linaro.org> References: <1377531385-19369-1-git-send-email-tomasz.nowicki@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130826_113709_753679_A2716C3D X-CRM114-Status: GOOD ( 13.57 ) X-Spam-Score: -2.6 (--) Cc: tomasz.nowicki@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.6 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 Once interrupt is shared all actions co-related to given interrupt need to have IRQF_HIGH_PRIORITY flag which means that actions have the same priority. Signed-off-by: Tomasz Nowicki --- include/linux/interrupt.h | 1 + kernel/irq/manage.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 5fa5afe..a566e54 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -71,6 +71,7 @@ #define IRQF_FORCE_RESUME 0x00008000 #define IRQF_NO_THREAD 0x00010000 #define IRQF_EARLY_RESUME 0x00020000 +#define IRQF_HIGH_PRIORITY 0x00040000 #define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 514bcfd..7c80295 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -1006,11 +1007,12 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) * the same type (level, edge, polarity). So both flag * fields must have IRQF_SHARED set and the bits which * set the trigger type must match. Also all must - * agree on ONESHOT. + * agree on ONESHOT and IRQF_HIGH_PRIORITY. */ if (!((old->flags & new->flags) & IRQF_SHARED) || ((old->flags ^ new->flags) & IRQF_TRIGGER_MASK) || - ((old->flags ^ new->flags) & IRQF_ONESHOT)) + ((old->flags ^ new->flags) & IRQF_ONESHOT) || + ((old->flags ^ new->flags) & IRQF_HIGH_PRIORITY)) goto mismatch; /* All handlers must agree on per-cpuness */ @@ -1115,6 +1117,16 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) if (new->flags & IRQF_ONESHOT) desc->istate |= IRQS_ONESHOT; + if (new->flags & IRQF_HIGH_PRIORITY) { + ret = irq_set_priority(desc, IRQP_HIGH); + if (ret) + goto out_mask; + } else { + ret = irq_set_priority(desc, IRQP_DEFAULT); + if (ret && ret != ENOSYS) + goto out_mask; + } + if (irq_settings_can_autoenable(desc)) irq_startup(desc, true); else