From patchwork Fri Feb 8 19:28:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 2117991 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id D923EE00C6 for ; Fri, 8 Feb 2013 19:32:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946795Ab3BHTbd (ORCPT ); Fri, 8 Feb 2013 14:31:33 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:34184 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760407Ab3BHTa3 (ORCPT ); Fri, 8 Feb 2013 14:30:29 -0500 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 r18JSVQ4022987 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 8 Feb 2013 19:28:32 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r18JSStd006613 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Feb 2013 19:28:31 GMT Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r18JSSaO010169; Fri, 8 Feb 2013 13:28:28 -0600 Received: from linux-siqj.site (/10.132.127.230) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 08 Feb 2013 11:28:28 -0800 From: Yinghai Lu To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Bjorn Helgaas , "Rafael J. Wysocki" Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Yinghai Lu , Joerg Roedel , Konrad Rzeszutek Wilk , Sebastian Andrzej Siewior Subject: [PATCH v2 05/26] x86, irq: Show pci device name for msi in /proc/interrupt Date: Fri, 8 Feb 2013 11:28:02 -0800 Message-Id: <1360351703-20571-6-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360351703-20571-1-git-send-email-yinghai@kernel.org> References: <1360351703-20571-1-git-send-email-yinghai@kernel.org> X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org We could find out which device is using that MSI/MSI-X. Use irq_print_chip() to append pci device name. Signed-off-by: Yinghai Lu Cc: Joerg Roedel Cc: Konrad Rzeszutek Wilk Cc: Sebastian Andrzej Siewior --- arch/x86/kernel/apic/io_apic.c | 9 ++++++--- drivers/iommu/irq_remapping.c | 8 ++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index f8d4d8d..8b03875 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -3089,8 +3089,11 @@ msi_set_affinity(struct irq_data *data, const struct cpumask *mask, bool force) 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" : ""); + struct pci_dev *dev = data->msi_desc->dev; + + seq_printf(p, " %s%s-edge@%s", data->chip->name, + data->msi_desc->msi_attrib.is_msix ? "-X" : "", + dev_name(&dev->dev)); } /* @@ -3130,7 +3133,7 @@ int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, setup_remapped_irq(irq, irq_get_chip_data(irq), chip); - irq_set_chip_and_handler_name(irq, chip, handle_edge_irq, "edge"); + irq_set_chip_and_handler(irq, chip, handle_edge_irq); dev_printk(KERN_DEBUG, &dev->dev, "irq %d for MSI%s\n", irq, msidesc->msi_attrib.is_msix ? "-X" : ""); diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c index e245ab0..ca595f7 100644 --- a/drivers/iommu/irq_remapping.c +++ b/drivers/iommu/irq_remapping.c @@ -365,10 +365,18 @@ static void ir_ack_apic_level(struct irq_data *data) static void ir_print_prefix(struct irq_data *data, struct seq_file *p) { + struct pci_dev *dev = NULL; + seq_printf(p, " IR-%s%s", data->chip->name, data->msi_desc ? (data->msi_desc->msi_attrib.is_msix ? "-X" : "") : ""); + + if (data->msi_desc) + dev = data->msi_desc->dev; + + if (dev) + seq_printf(p, "-edge@%s", dev_name(&dev->dev)); } static void __init irq_remap_modify_chip_defaults(struct irq_chip *chip)