Re: [PATCH 3/8] media: iris: Add support for multiple TZ CP configs

Konrad Dybcio
2025-09-25T09:01:20Z

On 9/25/25 1:14 AM, Vikash Garodia wrote:
> vpu4 needs an additional configuration w.r.t CP regions. Make the CP
> configuration as array such that the multiple configuration can be
> managed per platform.
>
> Co-developed-by: Vishnu Reddy <quic_bvisredd@quicinc.com>
> Signed-off-by: Vishnu Reddy <quic_bvisredd@quicinc.com>
> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
> ---

[...]

> - ret = qcom_scm_mem_protect_video_var(cp_config->cp_start,
> - cp_config->cp_size,
> - cp_config->cp_nonpixel_start,
> - cp_config->cp_nonpixel_size);
> - if (ret) {
> - dev_err(core->dev, "protect memory failed\n");
> - qcom_scm_pas_shutdown(core->iris_platform_data->pas_id);
> - return ret;
> + for (i = 0; i < core->iris_platform_data->tz_cp_config_data_size; i++) {
> + cp_config = &core->iris_platform_data->tz_cp_config_data[i];
> + ret = qcom_scm_mem_protect_video_var(cp_config->cp_start,
> + cp_config->cp_size,
> + cp_config->cp_nonpixel_start,
> + cp_config->cp_nonpixel_size);
> + if (ret) {
> + dev_err(core->dev, "protect memory failed\n");
> + qcom_scm_pas_shutdown(core->iris_platform_data->pas_id);
> + return ret;
> + }
> }

Do we need to do any "un-protecting" when unrolling from an error?

Konrad