[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <069ef490-6d50-2e1a-ea01-3c40f829b7fe@linaro.org>
Date: Mon, 6 Mar 2023 11:19:04 +0100
From: Konrad Dybcio <konrad.dybcio@...aro.org>
To: Luca Weiss <luca@...tu.xyz>, ~postmarketos/upstreaming@...ts.sr.ht,
phone-devel@...r.kernel.org, Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Loic Poulain <loic.poulain@...aro.org>
Cc: linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] soc: qcom: rmtfs: handle optional qcom,vmid correctly
On 5.03.2023 11:32, Luca Weiss wrote:
> Older platforms don't have qcom,vmid set
Ugh, "evolution" :P
, handle -EINVAL return value
> correctly. And since num_vmids is passed to of_property_read_u32_array
> later we should make sure it has a sane value before continuing.
>
> Fixes: e656cd0bcf3d ("soc: qcom: rmtfs: Optionally map RMTFS to more VMs")
> Signed-off-by: Luca Weiss <luca@...tu.xyz>
> ---
This needs to be sanctioned by bindings, (i.e. if !oldplatform
require qcom,vmid), as without this property new ones will simply
lock up..
But this change is correct on its own
Reviewed-by: Konrad Dybcio <konrad.dybcio@...aro.org>
Konrad
> drivers/soc/qcom/rmtfs_mem.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/soc/qcom/rmtfs_mem.c b/drivers/soc/qcom/rmtfs_mem.c
> index 218397ab0c36f..fb6e4def8c78b 100644
> --- a/drivers/soc/qcom/rmtfs_mem.c
> +++ b/drivers/soc/qcom/rmtfs_mem.c
> @@ -229,7 +229,10 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
> }
>
> num_vmids = of_property_count_u32_elems(node, "qcom,vmid");
> - if (num_vmids < 0) {
> + if (num_vmids == -EINVAL) {
> + /* qcom,vmid is optional */
> + num_vmids = 0;
> + } else if (num_vmids < 0) {
> dev_err(&pdev->dev, "failed to count qcom,vmid elements: %d\n", num_vmids);
> goto remove_cdev;
> } else if (num_vmids > NUM_MAX_VMIDS) {
>
Powered by blists - more mailing lists