Skip to content

Commit e2724be

Browse files
legoatergregkh
authored andcommitted
powerpc/xive: Drop check on irq_data in xive_core_debug_show()
[ Upstream commit a74ce59 ] When looping on IRQ descriptor, irq_data is always valid. Fixes: 930914b ("powerpc/xive: Add a debugfs file to dump internal XIVE state") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Greg Kurz <groug@kaod.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20210331144514.892250-6-clg@kaod.org Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent a38b778 commit e2724be

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

‎arch/powerpc/sysdev/xive/common.c‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,6 +1606,8 @@ static void xive_debug_show_irq(struct seq_file *m, u32 hw_irq, struct irq_data
16061606
u32 target;
16071607
u8 prio;
16081608
u32 lirq;
1609+
struct xive_irq_data *xd;
1610+
u64 val;
16091611

16101612
if (!is_xive_irq(chip))
16111613
return;
@@ -1619,17 +1621,14 @@ static void xive_debug_show_irq(struct seq_file *m, u32 hw_irq, struct irq_data
16191621
seq_printf(m, "IRQ 0x%08x : target=0x%x prio=%02x lirq=0x%x ",
16201622
hw_irq, target, prio, lirq);
16211623

1622-
if (d) {
1623-
struct xive_irq_data *xd = irq_data_get_irq_handler_data(d);
1624-
u64 val = xive_esb_read(xd, XIVE_ESB_GET);
1625-
1626-
seq_printf(m, "flags=%c%c%c PQ=%c%c",
1627-
xd->flags & XIVE_IRQ_FLAG_STORE_EOI ? 'S' : ' ',
1628-
xd->flags & XIVE_IRQ_FLAG_LSI ? 'L' : ' ',
1629-
xd->flags & XIVE_IRQ_FLAG_H_INT_ESB ? 'H' : ' ',
1630-
val & XIVE_ESB_VAL_P ? 'P' : '-',
1631-
val & XIVE_ESB_VAL_Q ? 'Q' : '-');
1632-
}
1624+
xd = irq_data_get_irq_handler_data(d);
1625+
val = xive_esb_read(xd, XIVE_ESB_GET);
1626+
seq_printf(m, "flags=%c%c%c PQ=%c%c",
1627+
xd->flags & XIVE_IRQ_FLAG_STORE_EOI ? 'S' : ' ',
1628+
xd->flags & XIVE_IRQ_FLAG_LSI ? 'L' : ' ',
1629+
xd->flags & XIVE_IRQ_FLAG_H_INT_ESB ? 'H' : ' ',
1630+
val & XIVE_ESB_VAL_P ? 'P' : '-',
1631+
val & XIVE_ESB_VAL_Q ? 'Q' : '-');
16331632
seq_puts(m, "\n");
16341633
}
16351634

0 commit comments

Comments
 (0)