From patchwork Sat May 30 03:19:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "majun (F)" X-Patchwork-Id: 6512321 Return-Path: X-Original-To: patchwork-linux-arm@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 3F0DAC0020 for ; Sat, 30 May 2015 03:23:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5387E20814 for ; Sat, 30 May 2015 03:23:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 79162207BE for ; Sat, 30 May 2015 03:23:34 +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 1YyXKa-0002AS-Mt; Sat, 30 May 2015 03:21:04 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YyXJm-0000nS-7u for linux-arm-kernel@lists.infradead.org; Sat, 30 May 2015 03:20:15 +0000 Received: from 172.24.2.119 (EHLO szxeml426-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CMC81042; Sat, 30 May 2015 11:19:15 +0800 (CST) Received: from [127.0.0.1] (10.177.236.124) by szxeml426-hub.china.huawei.com (10.82.67.181) with Microsoft SMTP Server id 14.3.158.1; Sat, 30 May 2015 11:19:12 +0800 Message-ID: <55692C2D.50005@huawei.com> Date: Sat, 30 May 2015 11:19:09 +0800 From: "majun (F)" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: catalin Marinas , LKML , linux-arm-kernel , Will Deacon , Mark Rutland , Marc Zyngier Subject: [PATCH 2/4]: Change msi to support the Mbigen interrupt X-Originating-IP: [10.177.236.124] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150529_202014_668170_7B5A6045 X-CRM114-Status: GOOD ( 12.03 ) X-Spam-Score: -2.3 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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, T_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 This patch is applied to support the interrupts from Mbigen. As a interrupt controller, Mbigen is used as a child domain of MSI domain just like pci device. Change log: --add IRQ_DOMAIN_FLAG_MBIGEN to presents the interrupt from mbigen --add function is_mbigen_domain to check the interrupt domain --modified irq_chip_write_msi_msg to use the different message write function for interrupt from mbigen Signed-off-by: Ma Jun --- include/linux/irqdomain.h | 2 +- include/linux/msi.h | 1 + kernel/irq/msi.c | 22 +++++++++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) mode change 100644 => 100755 include/linux/msi.h mode change 100644 => 100755 kernel/irq/msi.c diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 676d730..cb6b33a 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -136,7 +136,7 @@ enum { /* Core calls alloc/free recursive through the domain hierarchy. */ IRQ_DOMAIN_FLAG_AUTO_RECURSIVE = (1 << 1), - + IRQ_DOMAIN_FLAG_MBIGEN = (1 << 2), /* * Flags starting from IRQ_DOMAIN_FLAG_NONCORE are reserved * for implementation specific purposes and ignored by the diff --git a/include/linux/msi.h b/include/linux/msi.h old mode 100644 new mode 100755 index 8ac4a68..3e2b6c7 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -239,5 +239,6 @@ irq_hw_number_t pci_msi_domain_calc_hwirq(struct pci_dev *dev, int pci_msi_domain_check_cap(struct irq_domain *domain, struct msi_domain_info *info, struct device *dev); #endif /* CONFIG_PCI_MSI_IRQ_DOMAIN */ +bool is_mbigen_domain(struct irq_data *data); #endif /* LINUX_MSI_H */ diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c old mode 100644 new mode 100755 index 474de5c..1dba07e --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -31,11 +31,31 @@ void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg) } EXPORT_SYMBOL_GPL(get_cached_msi_msg); +bool is_mbigen_domain(struct irq_data *data) +{ + int virq; + struct irq_domain *domain; + struct irq_data *source_irq_data; + + virq = data->irq; + source_irq_data = irq_get_irq_data(virq); + domain = source_irq_data->domain; + + if (domain->flags & IRQ_DOMAIN_FLAG_MBIGEN) + return true; + else + return false; + +} + #ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN static inline void irq_chip_write_msi_msg(struct irq_data *data, struct msi_msg *msg) { - data->chip->irq_write_msi_msg(data, msg); + if (is_mbigen_domain(data)) + data->chip->irq_write_mbi_msg(data, msg); + else + data->chip->irq_write_msi_msg(data, msg); } /**