From: Chris Lew <quic_clew@quicinc.com>
To: Bjorn Andersson <quic_bjorande@quicinc.com>,
Sudeepgoud Patil <quic_sudeepgo@quicinc.com>
Cc: <andersson@kernel.org>, <mathieu.poirier@linaro.org>,
<linux-kernel@vger.kernel.org>, <quic_deesin@quicinc.com>,
<linux-arm-msm@vger.kernel.org>,
<linux-remoteproc@vger.kernel.org>,
"Konrad Dybcio" <konrad.dybcio@linaro.org>
Subject: Re: [PATCH V2 1/2] soc: qcom: smp2p: Add remote name into smp2p irq devname
Date: Tue, 11 Jun 2024 10:53:01 -0700 [thread overview]
Message-ID: <85187e9d-4806-4871-9a06-ab860ddd726e@quicinc.com> (raw)
In-Reply-To: <Zmh2CzGpJrmzs+6K@hu-bjorande-lv.qualcomm.com>
On 6/11/2024 9:06 AM, Bjorn Andersson wrote:
> On Tue, Jun 11, 2024 at 06:03:50PM +0530, Sudeepgoud Patil wrote:
>> Add smp2p irq devname which fetches remote name from respective
>> smp2p dtsi node, which makes the wakeup source distinguishable
>> in irq wakeup prints.
>>
>> Signed-off-by: Sudeepgoud Patil <quic_sudeepgo@quicinc.com>
>> ---
>> drivers/soc/qcom/smp2p.c | 14 +++++++++++++-
>> 1 file changed, 13 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c
>> index a21241cbeec7..a77fee048b38 100644
>> --- a/drivers/soc/qcom/smp2p.c
>> +++ b/drivers/soc/qcom/smp2p.c
>> @@ -122,6 +122,7 @@ struct smp2p_entry {
>> * @ssr_ack_enabled: SMP2P_FEATURE_SSR_ACK feature is supported and was enabled
>> * @ssr_ack: current cached state of the local ack bit
>> * @negotiation_done: whether negotiating finished
>> + * @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
>> @@ -146,6 +147,7 @@ struct qcom_smp2p {
>> bool ssr_ack;
>> bool negotiation_done;
>>
>> + char *irq_devname;
>> unsigned local_pid;
>> unsigned remote_pid;
>>
>> @@ -614,10 +616,16 @@ static int qcom_smp2p_probe(struct platform_device *pdev)
>> /* Kick the outgoing edge after allocating entries */
>> qcom_smp2p_kick(smp2p);
>>
>> + smp2p->irq_devname = kasprintf(GFP_KERNEL, "%s", pdev->dev.of_node->name);
>
> That's a lot of extra instructions for copying a string, which doesn't
> need to be copied because of_node->name is const char and the argument
> to devm_request_threaded_irq() is const char.
>
> So, kstrdup_const() is what you're looking for.
>
> You can then go devm_kstrdup_const() and avoid the kfree() (then
> kfree_const()) below.
>
>
> That said, looking at /proc/interrupts, I think it would make sense to
> make this devm_kasprintf(..., "smp2p-%s", name);
>
Is it ok to rely on the "of_node->name"? I think device tree tends to
always have the node name as "smp2p-%s" already, so ("smp2p-%s", name)
would result in "smp2p-smp2p-adsp".
Also Sudeepgoud, I think this will update the irqname in
/proc/interrupts for the ipcc irqchip entry. It would also be helpful if
we could differentiate the instances of smp2p irqchips as well. That way
we can see what processors the 'ready' and 'fatal' interrupts apply to
in /proc/interrupts.
Can you refer to my internal patch that adds .irq_print_chip() and
incorporate those changes here?
> Regards,
> Bjorn
>
>> + 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;
>> @@ -650,6 +658,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:
>> @@ -677,6 +687,8 @@ static void qcom_smp2p_remove(struct platform_device *pdev)
>>
>> mbox_free_channel(smp2p->mbox_chan);
>>
>> + kfree(smp2p->irq_devname);
>> +
>> smp2p->out->valid_entries = 0;
>> }
>>
>> --
>>
next prev parent reply other threads:[~2024-06-11 17:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-11 12:33 [PATCH V2 0/2] Add tracepoint support and remote name mapping to smp2p Sudeepgoud Patil
2024-06-11 12:33 ` [PATCH V2 1/2] soc: qcom: smp2p: Add remote name into smp2p irq devname Sudeepgoud Patil
2024-06-11 16:06 ` Bjorn Andersson
2024-06-11 17:53 ` Chris Lew [this message]
2024-06-11 19:19 ` Bjorn Andersson
2024-06-11 12:33 ` [PATCH V2 2/2] soc: qcom: smp2p: Introduce tracepoint support Sudeepgoud Patil
2024-06-11 23:05 ` Chris Lew
2024-06-12 9:12 ` Deepak Kumar Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=85187e9d-4806-4871-9a06-ab860ddd726e@quicinc.com \
--to=quic_clew@quicinc.com \
--cc=andersson@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=quic_bjorande@quicinc.com \
--cc=quic_deesin@quicinc.com \
--cc=quic_sudeepgo@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®