From patchwork Sat Apr 16 01:35:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 8860941 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B1025BF29F for ; Sat, 16 Apr 2016 01:37:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E5C4E201B9 for ; Sat, 16 Apr 2016 01:37:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 162B82024D for ; Sat, 16 Apr 2016 01:37:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751914AbcDPBf7 (ORCPT ); Fri, 15 Apr 2016 21:35:59 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:48871 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751537AbcDPBf4 (ORCPT ); Fri, 15 Apr 2016 21:35:56 -0400 Received: from [107.17.164.132] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1arF9P-00055Q-51; Sat, 16 Apr 2016 01:35:55 +0000 From: Christoph Hellwig To: tglx@linutronix.de, linux-block@vger.kernel.org, linux-pci@vger.kernel.org Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/8] genirq: add a helper to program the pre-set affinity mask into the controller Date: Fri, 15 Apr 2016 18:35:48 -0700 Message-Id: <1460770552-31260-5-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1460770552-31260-1-git-send-email-hch@lst.de> References: <1460770552-31260-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SUSPICIOUS_RECIPS, 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 Signed-off-by: Christoph Hellwig --- include/linux/interrupt.h | 2 ++ kernel/irq/manage.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 67bc1e1f..ae345da 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -713,4 +713,6 @@ extern char __softirqentry_text_end[]; #define __softirq_entry #endif +void irq_program_affinity(unsigned int irq); + #endif diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index cc1cc64..02552a4 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -240,6 +240,20 @@ int __irq_set_affinity(unsigned int irq, const struct cpumask *mask, bool force) return ret; } +void irq_program_affinity(unsigned int irq) +{ + struct irq_desc *desc = irq_to_desc(irq); + struct irq_data *data = irq_desc_get_irq_data(desc); + unsigned long flags; + + if (WARN_ON_ONCE(!desc)) + return; + + raw_spin_lock_irqsave(&desc->lock, flags); + irq_set_affinity_locked(data, desc->irq_common_data.affinity, false); + raw_spin_unlock_irqrestore(&desc->lock, flags); +} + int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m) { unsigned long flags;