]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
soc: qcom: smp2p: Use devname for interrupt descriptions
authorChris Lew <quic_clew@quicinc.com>
Thu, 27 Jun 2024 10:48:30 +0000 (16:18 +0530)
committerBjorn Andersson <andersson@kernel.org>
Tue, 2 Jul 2024 03:31:14 +0000 (22:31 -0500)
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 <quic_clew@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20240627104831.4176799-2-quic_sudeepgo@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/soc/qcom/smp2p.c

index a21241cbeec7bab72ab89eec731f7fbf2aaec502..696c2a8387d0737d4f5b7fe5cae2755e1c0d73be 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/platform_device.h>
 #include <linux/pm_wakeirq.h>
 #include <linux/regmap.h>
+#include <linux/seq_file.h>
 #include <linux/soc/qcom/smem.h>
 #include <linux/soc/qcom/smem_state.h>
 #include <linux/spinlock.h>
@@ -353,11 +354,19 @@ static int smp2p_set_irq_type(struct irq_data *irqd, unsigned int type)
        return 0;
 }
 
+static void smp2p_irq_print_chip(struct irq_data *irqd, struct seq_file *p)
+{
+       struct smp2p_entry *entry = irq_data_get_irq_chip_data(irqd);
+
+       seq_printf(p, " %8s", dev_name(entry->smp2p->dev));
+}
+
 static struct irq_chip smp2p_irq_chip = {
        .name           = "smp2p",
        .irq_mask       = smp2p_mask_irq,
        .irq_unmask     = smp2p_unmask_irq,
        .irq_set_type   = smp2p_set_irq_type,
+       .irq_print_chip = smp2p_irq_print_chip,
 };
 
 static int smp2p_irq_map(struct irq_domain *d,
@@ -617,7 +626,7 @@ static int qcom_smp2p_probe(struct platform_device *pdev)
        ret = devm_request_threaded_irq(&pdev->dev, irq,
                                        NULL, qcom_smp2p_intr,
                                        IRQF_ONESHOT,
-                                       "smp2p", (void *)smp2p);
+                                       NULL, (void *)smp2p);
        if (ret) {
                dev_err(&pdev->dev, "failed to request interrupt\n");
                goto unwind_interfaces;