[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bb25208e-a6a6-4a81-9dd5-5c5eb1cf16b4@oss.qualcomm.com>
Date: Wed, 24 Sep 2025 16:57:07 +0200
From: Konrad Dybcio <konrad.dybcio@....qualcomm.com>
To: Jingyi Wang <jingyi.wang@....qualcomm.com>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>
Cc: linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
Chris Lew <chris.lew@....qualcomm.com>
Subject: Re: [PATCH 2/2] soc: qcom: smp2p: Add support for smp2p v2
On 9/24/25 6:18 AM, Jingyi Wang wrote:
> From: Chris Lew <chris.lew@....qualcomm.com>
>
> Some remoteproc need smp2p v2 support, mirror the version written by the
> remote if the remote supports v2. This is needed if the remote does not
> have backwards compatibility with v1. And reset entry last value on SSR for
> smp2p v2.
>
> Signed-off-by: Chris Lew <chris.lew@....qualcomm.com>
> Co-developed-by: Jingyi Wang <jingyi.wang@....qualcomm.com>
> Signed-off-by: Jingyi Wang <jingyi.wang@....qualcomm.com>
> ---
[...]
> +static int qcom_smp2p_in_version(struct qcom_smp2p *smp2p)
> +{
> + unsigned int smem_id = smp2p->smem_items[SMP2P_INBOUND];
> + unsigned int pid = smp2p->remote_pid;
> + struct smp2p_smem_item *in;
> + size_t size;
> +
> + in = qcom_smem_get(pid, smem_id, &size);
> + if (IS_ERR(in))
> + return 0;
> +
> + return in->version;
are in and out versions supposed to be out of sync in case of
error?
> +}
> +
> static void qcom_smp2p_start_in(struct qcom_smp2p *smp2p)
> {
> unsigned int smem_id = smp2p->smem_items[SMP2P_INBOUND];
> @@ -516,6 +542,7 @@ static int qcom_smp2p_alloc_outbound_item(struct qcom_smp2p *smp2p)
> struct smp2p_smem_item *out;
> unsigned smem_id = smp2p->smem_items[SMP2P_OUTBOUND];
> unsigned pid = smp2p->remote_pid;
> + u8 in_version;
> int ret;
>
> ret = qcom_smem_alloc(pid, smem_id, sizeof(*out));
> @@ -537,12 +564,14 @@ static int qcom_smp2p_alloc_outbound_item(struct qcom_smp2p *smp2p)
> out->valid_entries = 0;
> out->features = SMP2P_ALL_FEATURES;
>
> + in_version = qcom_smp2p_in_version(smp2p);
> +
> /*
> * Make sure the rest of the header is written before we validate the
> * item by writing a valid version number.
> */
> wmb();
> - out->version = 1;
> + out->version = (in_version) ? in_version : 1;
= in_version ?: 1
Konrad
Powered by blists - more mailing lists