]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
s390: show statistics for MSI IRQs
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Tue, 14 Feb 2017 17:13:09 +0000 (18:13 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 29 Apr 2019 08:47:01 +0000 (10:47 +0200)
Improve /proc/interrupts on s390 to show statistics for individual
MSI interrupts.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/irq.h
arch/s390/kernel/irq.c
arch/s390/pci/pci_irq.c
drivers/s390/cio/cio.c

index afaf5e3c57fd8b66b59b220699131c4ee70018cb..d159439440542504b4190ad831adccbf9d182680 100644 (file)
@@ -47,7 +47,6 @@ enum interruption_class {
        IRQEXT_CMC,
        IRQEXT_FTP,
        IRQIO_CIO,
-       IRQIO_QAI,
        IRQIO_DAS,
        IRQIO_C15,
        IRQIO_C70,
@@ -55,12 +54,13 @@ enum interruption_class {
        IRQIO_VMR,
        IRQIO_LCS,
        IRQIO_CTC,
-       IRQIO_APB,
        IRQIO_ADM,
        IRQIO_CSC,
+       IRQIO_VIR,
+       IRQIO_QAI,
+       IRQIO_APB,
        IRQIO_PCI,
        IRQIO_MSI,
-       IRQIO_VIR,
        IRQIO_VAI,
        IRQIO_GAL,
        NMI_NMI,
index 0cd5a5f96729dad40540016bf2d32acc1ff18893..f586f94d39476d34eb7897d0f59f0a7765758ae1 100644 (file)
@@ -73,7 +73,6 @@ static const struct irq_class irqclass_sub_desc[] = {
        {.irq = IRQEXT_CMC, .name = "CMC", .desc = "[EXT] CPU-Measurement: Counter"},
        {.irq = IRQEXT_FTP, .name = "FTP", .desc = "[EXT] HMC FTP Service"},
        {.irq = IRQIO_CIO,  .name = "CIO", .desc = "[I/O] Common I/O Layer Interrupt"},
-       {.irq = IRQIO_QAI,  .name = "QAI", .desc = "[I/O] QDIO Adapter Interrupt"},
        {.irq = IRQIO_DAS,  .name = "DAS", .desc = "[I/O] DASD"},
        {.irq = IRQIO_C15,  .name = "C15", .desc = "[I/O] 3215"},
        {.irq = IRQIO_C70,  .name = "C70", .desc = "[I/O] 3270"},
@@ -81,14 +80,15 @@ static const struct irq_class irqclass_sub_desc[] = {
        {.irq = IRQIO_VMR,  .name = "VMR", .desc = "[I/O] Unit Record Devices"},
        {.irq = IRQIO_LCS,  .name = "LCS", .desc = "[I/O] LCS"},
        {.irq = IRQIO_CTC,  .name = "CTC", .desc = "[I/O] CTC"},
-       {.irq = IRQIO_APB,  .name = "APB", .desc = "[I/O] AP Bus"},
        {.irq = IRQIO_ADM,  .name = "ADM", .desc = "[I/O] EADM Subchannel"},
        {.irq = IRQIO_CSC,  .name = "CSC", .desc = "[I/O] CHSC Subchannel"},
-       {.irq = IRQIO_PCI,  .name = "PCI", .desc = "[I/O] PCI Interrupt" },
-       {.irq = IRQIO_MSI,  .name = "MSI", .desc = "[I/O] MSI Interrupt" },
        {.irq = IRQIO_VIR,  .name = "VIR", .desc = "[I/O] Virtual I/O Devices"},
-       {.irq = IRQIO_VAI,  .name = "VAI", .desc = "[I/O] Virtual I/O Devices AI"},
-       {.irq = IRQIO_GAL,  .name = "GAL", .desc = "[I/O] GIB Alert"},
+       {.irq = IRQIO_QAI,  .name = "QAI", .desc = "[AIO] QDIO Adapter Interrupt"},
+       {.irq = IRQIO_APB,  .name = "APB", .desc = "[AIO] AP Bus"},
+       {.irq = IRQIO_PCI,  .name = "PCI", .desc = "[AIO] PCI Interrupt"},
+       {.irq = IRQIO_MSI,  .name = "MSI", .desc = "[AIO] MSI Interrupt"},
+       {.irq = IRQIO_VAI,  .name = "VAI", .desc = "[AIO] Virtual I/O Devices AI"},
+       {.irq = IRQIO_GAL,  .name = "GAL", .desc = "[AIO] GIB Alert"},
        {.irq = NMI_NMI,    .name = "NMI", .desc = "[NMI] Machine Check"},
        {.irq = CPU_RST,    .name = "RST", .desc = "[CPU] CPU Restart"},
 };
@@ -116,6 +116,34 @@ void do_IRQ(struct pt_regs *regs, int irq)
        set_irq_regs(old_regs);
 }
 
+static void show_msi_interrupt(struct seq_file *p, int irq)
+{
+       struct irq_desc *desc;
+       unsigned long flags;
+       int cpu;
+
+       irq_lock_sparse();
+       desc = irq_to_desc(irq);
+       if (!desc)
+               goto out;
+
+       raw_spin_lock_irqsave(&desc->lock, flags);
+       seq_printf(p, "%3d: ", irq);
+       for_each_online_cpu(cpu)
+               seq_printf(p, "%10u ", kstat_irqs_cpu(irq, cpu));
+
+       if (desc->irq_data.chip)
+               seq_printf(p, " %8s", desc->irq_data.chip->name);
+
+       if (desc->action)
+               seq_printf(p, "  %s", desc->action->name);
+
+       seq_putc(p, '\n');
+       raw_spin_unlock_irqrestore(&desc->lock, flags);
+out:
+       irq_unlock_sparse();
+}
+
 /*
  * show_interrupts is needed by /proc/interrupts.
  */
@@ -128,7 +156,7 @@ int show_interrupts(struct seq_file *p, void *v)
        if (index == 0) {
                seq_puts(p, "           ");
                for_each_online_cpu(cpu)
-                       seq_printf(p, "CPU%d       ", cpu);
+                       seq_printf(p, "CPU%-8d", cpu);
                seq_putc(p, '\n');
        }
        if (index < NR_IRQS_BASE) {
@@ -139,9 +167,10 @@ int show_interrupts(struct seq_file *p, void *v)
                seq_putc(p, '\n');
                goto out;
        }
-       if (index > NR_IRQS_BASE)
+       if (index < nr_irqs) {
+               show_msi_interrupt(p, index);
                goto out;
-
+       }
        for (index = 0; index < NR_ARCH_IRQS; index++) {
                seq_printf(p, "%s: ", irqclass_sub_desc[index].name);
                irq = irqclass_sub_desc[index].irq;
index 4bfd902f27f44eb0219da4af01d39f0f5e360ff9..e7e3eab9a2b8d12bda124b0f19ee46dd720919aa 100644 (file)
@@ -112,7 +112,7 @@ static int zpci_set_irq_affinity(struct irq_data *data, const struct cpumask *de
 }
 
 static struct irq_chip zpci_irq_chip = {
-       .name = "zPCI",
+       .name = "PCI-MSI",
        .irq_unmask = pci_msi_unmask_irq,
        .irq_mask = pci_msi_mask_irq,
        .irq_set_affinity = zpci_set_irq_affinity,
index de744ca158fdf7044b6a07035546fb98fa5d80b9..18f5458f90e8f34fa77528da67382f6e5f9355a9 100644 (file)
@@ -564,7 +564,7 @@ static irqreturn_t do_cio_interrupt(int irq, void *dummy)
 }
 
 static struct irqaction io_interrupt = {
-       .name    = "IO",
+       .name    = "I/O",
        .handler = do_cio_interrupt,
 };