Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp57605rwd; Wed, 17 May 2023 14:38:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5/VrVYWsgcrLVjqYLbAW3rx8DgWpm3p6WT3O+KVMipSpULUyqSDCXL2okZuP+2evBXY08F X-Received: by 2002:a05:6a00:b4e:b0:64d:1185:241a with SMTP id p14-20020a056a000b4e00b0064d1185241amr602542pfo.5.1684359484858; Wed, 17 May 2023 14:38:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684359484; cv=none; d=google.com; s=arc-20160816; b=xxkLwVoOgH4GfLeHQqPCHLnAcQPqS5n/HvAg237ZyoaTSntEf8gFOsnTHAOj9Y19w2 U4UKyy38d1Xl/b3DjBxlXbhWdVnwImu+VvZ+bI+2l9zzfId8KIRga4Sw9o8zlzxY5d2b i9/4uXHRe8+P7Io10AB9PTPxAK36pemL/cDg8xcP8XCxoAHF8p7JblQD1FzsUAxBwfwn TnNw+PeKWp8l3/DXVQt9LDO9zYrqNzgKGU+1vc7ApTZYWnfdwmP+kzhpBX6q0sAcHdbU /B90c7Ly3sz98c2LTtcgEQ6+/DtUSSqhO2nOSwxVLFlvrksAsPcGEFOBe73xodLY9/6g N+IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=/SMIxbzQsbA3j3Sn/cFi6oIH9U6UOcuGopU1jwYoxzI=; b=qcmBdGKwFNItxqXwtd0Jl2dCrfKmBph/rXSJ9B9FPhDwebVz4Ql5ApMDCVentvwAiX etsQbzWUAImxzXJFgoL337P0iaW+IMNd7ZZkftFgGy3Ws5D80x5iBrnhI5p0aOJMHVCv DjrIJurx+puTIutV4UK5vmVOT84+m58GPln3+ZlNpF7RkBuCAnP4T5ZBTjUrCrWttp2T rPDpQtPil5zwg03XDHNecTpXAfKe/SiTGBvgtQrSxAeNlLBgXIaf8iofT3I/aA1TB81V 6itJcyCZffuOg06IwNx33T2oHeilVBKIW+iaHJP6igr8FqqWneDNmoIWpTxvTTUiebDz Um7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ENZ141sn; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv187-20020a632ec4000000b0050fb1a00d3dsi21843677pgb.46.2023.05.17.14.37.50; Wed, 17 May 2023 14:38:04 -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=@linaro.org header.s=google header.b=ENZ141sn; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229943AbjEQVOu (ORCPT + 99 others); Wed, 17 May 2023 17:14:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229879AbjEQVOh (ORCPT ); Wed, 17 May 2023 17:14:37 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7058869A for ; Wed, 17 May 2023 14:14:35 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2ac8ee9cf7aso13434441fa.2 for ; Wed, 17 May 2023 14:14:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358075; x=1686950075; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=/SMIxbzQsbA3j3Sn/cFi6oIH9U6UOcuGopU1jwYoxzI=; b=ENZ141snmw41TacxRPtH82IJeitzBbxUTAe2ew4flCFkoHjNyObBMHingajjyBeIkC rm2gIHCIpKWJwYdss5Fclm9rzqfdqsUMGZz5cyMZjgGz5mSSYhhdAtifYM8yn0r4qTy2 cKV8eiSqjqIRX2n26e0LSQGsPkbyVznqiSjHWm0zozqvD+2iBmb3pSsD3mWN1JOCA6GW VjP76btQMEFgm4dH8A6OmEITY16Z3c2AEm0T5U7TXF3ob1SA677eA+g70Ah33jOL3Y/4 Jhmvr6x686628QKBAIB5ogyP61oh+tiX4bChuNzlMX15U11tY2NWC6VSMeSpNwNRfQUI a6pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358075; x=1686950075; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/SMIxbzQsbA3j3Sn/cFi6oIH9U6UOcuGopU1jwYoxzI=; b=NFrleXR56HGVrFhI8rtTNd9biOOtv2k+Gencl6Zb7tLShAYZwdt6CKrOqfb2DMjbdt tIi41/9F/iaUeKNOUOj7939KjmPcLE9CAt4sI1xcwomqsDPj9EnV6ULYkL1BbwqXPBwv OuYhU2/EGMQHywX5iW64dwkIiyAGIU8prHOilUqkhXQpnnH5MWWC+LCZrP/CUyEnbZK8 G2MDmGcxE8s7YIhPpsZizciL/64qupUSKXO3H2nu1pZgpprUAPyN/5E3pLSPOXgB88D5 FvpHgqQ13YVxcIvQKtjEGzVFvjVMJqkD890l81Yo5TO3G/QTFLgDFIDvwuZPVFooXZi7 nlqQ== X-Gm-Message-State: AC+VfDwnflKDyDC/HR80lo7ulSJu99TWcNwALixwcaQbfs6jUG+WfkH2 Y3a8aoup/fL6Z/Nky+Hfdwfvqw== X-Received: by 2002:a2e:910f:0:b0:2ad:9139:c871 with SMTP id m15-20020a2e910f000000b002ad9139c871mr10062316ljg.19.1684358075353; Wed, 17 May 2023 14:14:35 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:35 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:19 +0200 Subject: [PATCH v3 06/17] media: venus: hfi_venus: Sanitize venus_boot_core() per-VPU-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230228-topic-venus-v3-6-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=1788; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=R/8X6NFLn14XxMVcEJ6kABO5lC3geO3MpBjA7WOBG7c=; b=hShc6PwEdR8dj70dMIWq8olCXlH/tw/vxVtWQbs/94pYFCPJAGVgfuKYA5jN6hzFHDj1f6GFL Kw9hTFCgUCWCr5D9gX2iYQ6Vr5TYoFbshK8FoSL9qpYWm3IdJCAFlnI X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 8fc8f46dc390..5af24e98caf0 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,10 +480,11 @@ 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); + + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) writel(0x0, cpu_cs_base + CPU_CS_X2RPMH_V6); - } return ret; } -- 2.40.1