From 175bec148a04747234fce8897c16014ab40c9fb6 Mon Sep 17 00:00:00 2001 From: Tao Zhang Date: Tue, 14 Jun 2022 19:46:45 +0800 Subject: [PATCH] soc: qcom: smp2p: Add remote_id into smp2p irq devname Changed smp2p irq devname from "smp2p" to "smp2p_", which makes the wakeup source distinguishable in irq wakeup prints. Change-Id: Id18819be3867df5070ad198c75980ea8f502dbe1 Signed-off-by: Tao Zhang --- drivers/soc/qcom/smp2p.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c index 23d6cbfded0d..c11387ba55b9 100644 --- a/drivers/soc/qcom/smp2p.c +++ b/drivers/soc/qcom/smp2p.c @@ -123,6 +123,7 @@ struct smp2p_entry { * @out: pointer to the outbound smem item * @smem_items: ids of the two smem items * @valid_entries: already scanned inbound entries + * @irq_devname: poniter to the smp2p irq devname * @local_pid: processor id of the inbound edge * @remote_pid: processor id of the outbound edge * @ipc_regmap: regmap for the outbound ipc @@ -147,6 +148,7 @@ struct qcom_smp2p { bool ssr_ack; bool negotiation_done; + char *irq_devname; unsigned local_pid; unsigned remote_pid; @@ -657,10 +659,15 @@ static int qcom_smp2p_probe(struct platform_device *pdev) qcom_smp2p_kick(smp2p); smp2p->irq = irq; + smp2p->irq_devname = kasprintf(GFP_KERNEL, "smp2p_%d", smp2p->remote_pid); + if (!smp2p->irq_devname) { + ret = -ENOMEM; + goto unwind_interfaces; + } ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, qcom_smp2p_intr, IRQF_ONESHOT, - "smp2p", (void *)smp2p); + smp2p->irq_devname, (void *)smp2p); if (ret) { dev_err(&pdev->dev, "failed to request interrupt\n"); goto unwind_interfaces; @@ -693,6 +700,8 @@ static int qcom_smp2p_probe(struct platform_device *pdev) list_for_each_entry(entry, &smp2p->outbound, node) qcom_smem_state_unregister(entry->state); + kfree(smp2p->irq_devname); + smp2p->out->valid_entries = 0; release_mbox: @@ -720,6 +729,8 @@ static int qcom_smp2p_remove(struct platform_device *pdev) mbox_free_channel(smp2p->mbox_chan); + kfree(smp2p->irq_devname); + smp2p->out->valid_entries = 0; return 0;