Skip to content

Commit e49380c

Browse files
quic-clewandersson
authored andcommitted
soc: qcom: smp2p: Use devname for interrupt descriptions
When using /proc/interrupts to collect statistics on smp2p interrupt counts, it is hard to distinguish the different instances of smp2p from each other. For example to debug a processor boot issue, the ready and handover interrupts are checked for sanity to ensure the firmware reached a specific initialization stage. Remove "smp2p" string from the irq request so that the irq will default to the device name. Add an .irq_print_chip() callback to print the irq chip name as the device name. These two changes allow for a unique name to be used in /proc/interrupts as shown below. / # cat /proc/interrupts | grep smp2p 18: ... ipcc 196610 Edge smp2p-adsp 20: ... ipcc 131074 Edge smp2p-modem 170: ... smp2p-modem 1 Edge q6v5 ready 178: ... smp2p-adsp 1 Edge q6v5 ready Signed-off-by: Chris Lew <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 05a21e8 commit e49380c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/soc/qcom/smp2p.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/platform_device.h>
1717
#include <linux/pm_wakeirq.h>
1818
#include <linux/regmap.h>
19+
#include <linux/seq_file.h>
1920
#include <linux/soc/qcom/smem.h>
2021
#include <linux/soc/qcom/smem_state.h>
2122
#include <linux/spinlock.h>
@@ -353,11 +354,19 @@ static int smp2p_set_irq_type(struct irq_data *irqd, unsigned int type)
353354
return 0;
354355
}
355356

357+
static void smp2p_irq_print_chip(struct irq_data *irqd, struct seq_file *p)
358+
{
359+
struct smp2p_entry *entry = irq_data_get_irq_chip_data(irqd);
360+
361+
seq_printf(p, " %8s", dev_name(entry->smp2p->dev));
362+
}
363+
356364
static struct irq_chip smp2p_irq_chip = {
357365
.name = "smp2p",
358366
.irq_mask = smp2p_mask_irq,
359367
.irq_unmask = smp2p_unmask_irq,
360368
.irq_set_type = smp2p_set_irq_type,
369+
.irq_print_chip = smp2p_irq_print_chip,
361370
};
362371

363372
static int smp2p_irq_map(struct irq_domain *d,
@@ -617,7 +626,7 @@ static int qcom_smp2p_probe(struct platform_device *pdev)
617626
ret = devm_request_threaded_irq(&pdev->dev, irq,
618627
NULL, qcom_smp2p_intr,
619628
IRQF_ONESHOT,
620-
"smp2p", (void *)smp2p);
629+
NULL, (void *)smp2p);
621630
if (ret) {
622631
dev_err(&pdev->dev, "failed to request interrupt\n");
623632
goto unwind_interfaces;

0 commit comments

Comments
 (0)