[18/18] media: venus: hfi_venus: Restrict writing SCIACMDARG3 to Venus V1/V2

Message ID 20230228-topic-venus-v1-18-58c2c88384e9@linaro.org
State New
Headers
Series Venus QoL / maintainability fixes |

Commit Message

Konrad Dybcio Feb. 28, 2023, 3:24 p.m. UTC
  This write was last present on msm-3.10, which means before HFI3XX
platforms were introduced. Guard it with an appropriate if condition.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/hfi_venus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Bryan O'Donoghue Feb. 28, 2023, 3:57 p.m. UTC | #1
On 28/02/2023 15:24, Konrad Dybcio wrote:
> This write was last present on msm-3.10, which means before HFI3XX
> platforms were introduced. Guard it with an appropriate if condition.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>   drivers/media/platform/qcom/venus/hfi_venus.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
> index c2d134e04c30..deeceb86414d 100644
> --- a/drivers/media/platform/qcom/venus/hfi_venus.c
> +++ b/drivers/media/platform/qcom/venus/hfi_venus.c
> @@ -463,7 +463,8 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
>   	}
>   
>   	writel(mask_val, wrapper_base + WRAPPER_INTR_MASK);
> -	writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3);
> +	if (IS_V1(hdev->core))
> +		writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3);
>   
>   	writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT);
>   	while (!ctrl_status && count < max_tries) {
> 

Looks good.

Which platforms have you tested this change on ? Can you include that 
detail in the commit log ?

---
bod
  
Konrad Dybcio Feb. 28, 2023, 4:09 p.m. UTC | #2
On 28.02.2023 16:57, Bryan O'Donoghue wrote:
> On 28/02/2023 15:24, Konrad Dybcio wrote:
>> This write was last present on msm-3.10, which means before HFI3XX
>> platforms were introduced. Guard it with an appropriate if condition.
>>
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
>>   drivers/media/platform/qcom/venus/hfi_venus.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
>> index c2d134e04c30..deeceb86414d 100644
>> --- a/drivers/media/platform/qcom/venus/hfi_venus.c
>> +++ b/drivers/media/platform/qcom/venus/hfi_venus.c
>> @@ -463,7 +463,8 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
>>       }
>>         writel(mask_val, wrapper_base + WRAPPER_INTR_MASK);
>> -    writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3);
>> +    if (IS_V1(hdev->core))
>> +        writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3);
>>         writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT);
>>       while (!ctrl_status && count < max_tries) {
>>
> 
> Looks good.
> 
> Which platforms have you tested this change on ?
8250

Can you include that detail in the commit log ?
Sure!

Konrad
> 
> ---
> bod
  

Patch

diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
index c2d134e04c30..deeceb86414d 100644
--- a/drivers/media/platform/qcom/venus/hfi_venus.c
+++ b/drivers/media/platform/qcom/venus/hfi_venus.c
@@ -463,7 +463,8 @@  static int venus_boot_core(struct venus_hfi_device *hdev)
 	}
 
 	writel(mask_val, wrapper_base + WRAPPER_INTR_MASK);
-	writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3);
+	if (IS_V1(hdev->core))
+		writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3);
 
 	writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT);
 	while (!ctrl_status && count < max_tries) {