From patchwork Tue Jun 7 14:49:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bader X-Patchwork-Id: 99216 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 0EF00B6F8B for ; Wed, 8 Jun 2011 00:50:00 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QTxbM-0002Ml-DX; Tue, 07 Jun 2011 14:49:52 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QTxbG-0002Gh-St for kernel-team@lists.ubuntu.com; Tue, 07 Jun 2011 14:49:46 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QTxbG-0004gP-O1; Tue, 07 Jun 2011 14:49:46 +0000 Received: from p5b2e52a5.dip.t-dialin.net ([91.46.82.165] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1QTxbG-00035a-HL; Tue, 07 Jun 2011 14:49:46 +0000 From: Stefan Bader To: stable@kernel.org Subject: [PATCH 2/3] genirq: Add IRQF_FORCE_RESUME Date: Tue, 7 Jun 2011 16:49:42 +0200 Message-Id: <1307458183-17544-3-git-send-email-stefan.bader@canonical.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1307458183-17544-1-git-send-email-stefan.bader@canonical.com> References: <1307458183-17544-1-git-send-email-stefan.bader@canonical.com> Cc: Ian Campbell , kernel-team@lists.ubuntu.com, Jeremy Fitzhardinge , Thomas Gleixner , Konrad Rzeszutek Wilk X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From: Thomas Gleixner commit dc5f219e88294b93009eef946251251ffffb6d60 upstream Xen needs to reenable interrupts which are marked IRQF_NO_SUSPEND in the resume path. Add a flag to force the reenabling in the resume code. Tested-and-acked-by: Ian Campbell Signed-off-by: Thomas Gleixner Signed-off-by: Stefan Bader --- include/linux/interrupt.h | 3 ++- kernel/irq/manage.c | 11 ++++++++++- kernel/irq/pm.c | 3 --- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index c49d6f5..4528f29 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -53,7 +53,7 @@ * Used by threaded interrupts which need to keep the * irq line disabled until the threaded handler has been run. * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend - * + * IRQF_FORCE_RESUME - Force enable it on resume even if IRQF_NO_SUSPEND is set */ #define IRQF_DISABLED 0x00000020 #define IRQF_SAMPLE_RANDOM 0x00000040 @@ -65,6 +65,7 @@ #define IRQF_IRQPOLL 0x00001000 #define IRQF_ONESHOT 0x00002000 #define IRQF_NO_SUSPEND 0x00004000 +#define IRQF_FORCE_RESUME 0x00008000 #define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 5fad88b..d40ecd5 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -265,8 +265,17 @@ EXPORT_SYMBOL(disable_irq); void __enable_irq(struct irq_desc *desc, unsigned int irq, bool resume) { - if (resume) + if (resume) { + if (!(desc->status & IRQ_SUSPENDED)) { + if (!desc->action) + return; + if (!(desc->action->flags & IRQF_FORCE_RESUME)) + return; + /* Pretend that it got disabled ! */ + desc->depth++; + } desc->status &= ~IRQ_SUSPENDED; + } switch (desc->depth) { case 0: diff --git a/kernel/irq/pm.c b/kernel/irq/pm.c index a0bb09e..0067abb 100644 --- a/kernel/irq/pm.c +++ b/kernel/irq/pm.c @@ -53,9 +53,6 @@ void resume_device_irqs(void) for_each_irq_desc(irq, desc) { unsigned long flags; - if (!(desc->status & IRQ_SUSPENDED)) - continue; - spin_lock_irqsave(&desc->lock, flags); __enable_irq(desc, irq, true); spin_unlock_irqrestore(&desc->lock, flags);