Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp472246rwd; Thu, 1 Jun 2023 02:52:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7SbPW9G1RnHlHQkw+24WQexEvqVqFkUnBtFiNIzE8hw2Aidn3YxdytuCAnJ+/6SwzvmNRh X-Received: by 2002:a05:6a00:1988:b0:63d:2d99:2e7c with SMTP id d8-20020a056a00198800b0063d2d992e7cmr10105257pfl.0.1685613149844; Thu, 01 Jun 2023 02:52:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685613149; cv=none; d=google.com; s=arc-20160816; b=j8AlsK4fodPHL1YR7ThagfOXazwlEqkXIzwSg46ra8UZ49+Y1rvkZ0MuAalNmDSxpZ IwhovJFrrEJN4iQ4zxLyqIwFBkc68TjdeGrCj6hbN8XqC5p1FiwOsirAhnqxWm6mVVvr T52iAUYldB8fHBVNRiYj3mbOsGPOFuk2WNNbzwCjqDxPL687ofGjudXiaLD6b0l8P+xY yCi/JpKM6krmZJD5DRx4toj+lkhUhmUOLt9hlvtjRingYj/GRqCB885tX9dlCihtjDWe Oj7mrKJ6cJqM2PYlm4wI6WyZ41QIzASpqzq+FC4QmRBDIiWLS8JOjj34Ua8Sdqf7V0jX SXYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Hgbf3woOoF0tvi6jSiGPRe7Xj3L8FRe/vc2hBfX2dho=; b=v/+STMX0CPFYkwp6vGVWEBs+GRoxR8uJKwrwHIwhuUGg8gS1MGIEXU3sY/3lqLbRav LEq18/cV7WXyzu9a+dXnVK4hwYEy2ac7Zecfxq1fxPurjJiz/qXNyYRQYckw5VtmLY1O TGzRCdv+3xdSQppUWB0EDOK+fjxEOalmKa0S/m3AwqdXAj8TmncWxMbBDuwd95cSrsRK T2YjOvUs4Xe4HEDW+S7WK746T7NAtYkubbjHvzGoGyxoKnnUTlgasaFKH20sZIC4QE29 zoQHFPjDeY0ITHHz3t7pLD42IOrwUAmXhsLzeZp0XNV/Cc7nPnIToWmkqBve/0KH+rzY PlAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="S//rtBGA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z22-20020aa79f96000000b0064f3917aedesi3909155pfr.176.2023.06.01.02.52.16; Thu, 01 Jun 2023 02:52:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="S//rtBGA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232874AbjFAJeO (ORCPT + 99 others); Thu, 1 Jun 2023 05:34:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232163AbjFAJeM (ORCPT ); Thu, 1 Jun 2023 05:34:12 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4A0FAA; Thu, 1 Jun 2023 02:34:10 -0700 (PDT) Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3515CI1L008219; Thu, 1 Jun 2023 09:33:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=Hgbf3woOoF0tvi6jSiGPRe7Xj3L8FRe/vc2hBfX2dho=; b=S//rtBGAZO2+WLswCGC0/HiVBCeHGikHTNJAgeSCzekykYHuOPKBrhtrPJ4efF4H8g0c k01jXWUJULLZt4PcUYgu+91xqz1vf1uMsJq4xxjlWsaQMeJs7IKFgUxJzCBwT2DKvrCf MxgTYs6otag+mUzkRZrcus1vaO7wNfkgp1j7AbvYorOsEKMJk9o3GVDX6RDY+TCsRMWT b9Bmo+sZRvvkUAkmk8fQdDlixnOT/RqSLG5RU8UZ+gFEQ6NE8W3MWH81thYsjuD7OvYj qDw21hBySiwmMGC1OVTacWQdHcJhiwyIwWGoT3JmcT4FHvynwFSoip6vsPRQnvA3Csse Ng== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qxkbu0q2x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Jun 2023 09:33:38 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3519Xbex032015 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 1 Jun 2023 09:33:37 GMT Received: from [10.50.56.241] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Thu, 1 Jun 2023 02:33:31 -0700 Message-ID: <85b17da3-d547-a8d3-8356-20c9fe511b92@quicinc.com> Date: Thu, 1 Jun 2023 15:03:28 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH v4 06/17] media: venus: hfi_venus: Sanitize venus_boot_core() per-VPU-version Content-Language: en-US To: Konrad Dybcio , Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , "Mauro Carvalho Chehab" , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil CC: Mauro Carvalho Chehab , Stanimir Varbanov , , , , "Marijn Suijten" References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> <20230228-topic-venus-v4-6-feebb2f6e9b8@linaro.org> From: Dikshita Agarwal In-Reply-To: <20230228-topic-venus-v4-6-feebb2f6e9b8@linaro.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 2B30Lxjv6mJyC8Q-W-KxeS77gczyboqW X-Proofpoint-GUID: 2B30Lxjv6mJyC8Q-W-KxeS77gczyboqW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-01_06,2023-05-31_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 spamscore=0 malwarescore=0 phishscore=0 clxscore=1015 priorityscore=1501 suspectscore=0 impostorscore=0 mlxlogscore=999 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2306010085 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/30/2023 6:00 PM, Konrad Dybcio wrote: > The current assumption of IS_V6 is overgeneralized. Adjust the logic > to take the VPU hardware version into account. > > Signed-off-by: Konrad Dybcio > --- > drivers/media/platform/qcom/venus/hfi_venus.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c > index 5506a0d196ef..9e36ef9076a0 100644 > --- a/drivers/media/platform/qcom/venus/hfi_venus.c > +++ b/drivers/media/platform/qcom/venus/hfi_venus.c > @@ -447,19 +447,20 @@ static int venus_boot_core(struct venus_hfi_device *hdev) > { > struct device *dev = hdev->core->dev; > static const unsigned int max_tries = 100; > - u32 ctrl_status = 0, mask_val; > + u32 ctrl_status = 0, mask_val = 0; > unsigned int count = 0; > void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; > void __iomem *wrapper_base = hdev->core->wrapper_base; > int ret = 0; > > - if (IS_V6(hdev->core)) { > + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) { > mask_val = readl(wrapper_base + WRAPPER_INTR_MASK); > mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 | > WRAPPER_INTR_MASK_A2HCPU_MASK); > } else { > mask_val = WRAPPER_INTR_MASK_A2HVCODEC_MASK; > } > + > writel(mask_val, wrapper_base + WRAPPER_INTR_MASK); > writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3); > > @@ -479,7 +480,7 @@ static int venus_boot_core(struct venus_hfi_device *hdev) > if (count >= max_tries) > ret = -ETIMEDOUT; > > - if (IS_V6(hdev->core)) { > + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) { > writel(0x1, cpu_cs_base + CPU_CS_H2XSOFTINTEN_V6); > writel(0x0, cpu_cs_base + CPU_CS_X2RPMH_V6); > } > Reviewed-by: Dikshita Agarwal