From patchwork Sun Aug 11 02:45:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 2842668 Return-Path: X-Original-To: patchwork-linux-acpi@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 896529F271 for ; Sun, 11 Aug 2013 02:57:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B9A6B202EC for ; Sun, 11 Aug 2013 02:57:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CBA44202EA for ; Sun, 11 Aug 2013 02:57:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751885Ab3HKCq5 (ORCPT ); Sat, 10 Aug 2013 22:46:57 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:34500 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751805Ab3HKCqK (ORCPT ); Sat, 10 Aug 2013 22:46:10 -0400 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r7B2jdhS014446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 11 Aug 2013 02:45:40 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7B2jc9K008920 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 11 Aug 2013 02:45:38 GMT Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7B2jbnT023090; Sun, 11 Aug 2013 02:45:37 GMT Received: from linux-siqj.site.site (/75.36.254.102) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 10 Aug 2013 19:45:37 -0700 From: Yinghai Lu To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Tony Luck , Bjorn Helgaas , "Rafael J. Wysocki" Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Yinghai Lu , Joerg Roedel , Konrad Rzeszutek Wilk , Sebastian Andrzej Siewior Subject: [PATCH 07/28] x86, irq: Show MSI-X in /proc/interrupt Date: Sat, 10 Aug 2013 19:45:18 -0700 Message-Id: <1376189139-31856-9-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1376189139-31856-1-git-send-email-yinghai@kernel.org> References: <1376189139-31856-1-git-send-email-yinghai@kernel.org> X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_HI, 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 Now MSI-X is shown as MSI in /proc/interrupt. We could use new added irq_print_chip() interface to append -X for MSI-X. After this patch, we will have PCI-MSI-X-edge IR-PCI-MSI-X-edge for MSI-X instead of PCI-MSI-edge IR-PCI-MSI-edge in the /proc/interrupt. -v2: do not need to check if msi_desc is null in msi_irq_print_chip(). Signed-off-by: Yinghai Lu Cc: Joerg Roedel Cc: Konrad Rzeszutek Wilk Cc: Sebastian Andrzej Siewior --- arch/x86/kernel/apic/io_apic.c | 7 +++++++ drivers/iommu/irq_remapping.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 119fdf8..cf320fb 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -3087,6 +3087,12 @@ msi_set_affinity(struct irq_data *data, const struct cpumask *mask, bool force) return IRQ_SET_MASK_OK_NOCOPY; } +static void msi_irq_print_chip(struct irq_data *data, struct seq_file *p) +{ + seq_printf(p, " %s%s", data->chip->name, + data->msi_desc->msi_attrib.is_msix ? "-X" : ""); +} + /* * IRQ Chip for MSI PCI/PCI-X/PCI-Express Devices, * which implement the MSI or MSI-X Capability Structure. @@ -3098,6 +3104,7 @@ struct irq_chip msi_chip = { .irq_ack = ack_apic_edge, .irq_set_affinity = msi_set_affinity, .irq_retrigger = ioapic_retrigger_irq, + .irq_print_chip = msi_irq_print_chip, }; int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c index 8e4e3af..6893d75 100644 --- a/drivers/iommu/irq_remapping.c +++ b/drivers/iommu/irq_remapping.c @@ -372,7 +372,10 @@ static void ir_ack_apic_level(struct irq_data *data) static void ir_print_prefix(struct irq_data *data, struct seq_file *p) { - seq_printf(p, " IR-%s", data->chip->name); + seq_printf(p, " IR-%s%s", data->chip->name, + data->msi_desc ? + (data->msi_desc->msi_attrib.is_msix ? "-X" : "") + : ""); } static void __init irq_remap_modify_chip_defaults(struct irq_chip *chip)