Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp40516rwd; Wed, 17 May 2023 14:18:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6eJ4HMqPjyREPa+9Fntuk9EljZjAWnHlrO0XcGgzspZxdSQ7yPE32ovunwPpYDcFQwWweq X-Received: by 2002:a05:6a20:3d87:b0:101:e680:d423 with SMTP id s7-20020a056a203d8700b00101e680d423mr35447494pzi.28.1684358330110; Wed, 17 May 2023 14:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684358330; cv=none; d=google.com; s=arc-20160816; b=uW6brKKkT74GcbFpJBSww25zPxrAaCoz5zLQtwBbaOJxUNvwe4h6MQBWGTBS0g6cmo Yo4D9WLrvrinosU31IXIiZWbqbT6VtlvBugIo75HbuQc+82i/9cDB76Lnznyl/zGW8va LTbmI/Wx/FTttQI79xpN0ip2RQhlgBuFl72Em/1xNiYAs04KJbB6kWXT8Gm+cy7F9A/Z NH8t9AR5TRHIHtN08e0wcD8DuWiUzSdb5yUtyX/uxPaqsAhjDXkt9/BxSRmouUReIBcJ ie+OrfG1eYwvP9jeAtqREitC9A03IBxdKcducx4tLI5mvvHs96X/8FTsYzkdsj/E/9om fKpA== 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=tD8sADHcRsSq9QkDCRoE5JuqMpJE24bgCDvH91fnaag=; b=JRi1AyoKpJj8YRnZ0AMOv6nBAYMDubYblyQ2GGQgQP+KjtlBFlLPGb0iEuU9cVxq/B mSy9VxgnOeWFD1Vm1OkSKLdV3Y7hSELGRBq/6F8zscqsE+/wr/PDQ9vhAgPTpQ0uqH9p 9BTwOK2T3OG5BuZq9CNNnJ0M8PkzL9XhHKxfQpDbjaKkAlchC5dl0xyYS7nbGzTw427e tMA14lxj9ueSgFa9MqLN838PsKgwOazmQYPpFX6WC3Og9lRwykdThNFcni2AP3qV8RmS VQUqBaK0ApY0unOZPj32OngM1KG+DQ9rvpVAHVSUVhQ4+TcOFcYmEIu7w73Vh6stHvFj jovg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fWK4a3Tx; 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 w21-20020a639355000000b005303b3df73bsi20543388pgm.320.2023.05.17.14.18.12; Wed, 17 May 2023 14:18:50 -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=fWK4a3Tx; 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 S230013AbjEQVPY (ORCPT + 99 others); Wed, 17 May 2023 17:15:24 -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 S229915AbjEQVO5 (ORCPT ); Wed, 17 May 2023 17:14:57 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9FB8A5F8 for ; Wed, 17 May 2023 14:14:44 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2af16426065so1121981fa.0 for ; Wed, 17 May 2023 14:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358084; x=1686950084; 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=tD8sADHcRsSq9QkDCRoE5JuqMpJE24bgCDvH91fnaag=; b=fWK4a3TxhnR4+vQWwKc78ULZk+l86K9r2wgGO6X4lcc9RvVrbaXbO5dXP3zbbpB2yk zrP5bqY/OoAwP6hAl59TRupUlWJ5wuP3TjNCzNT6HOTig4g1u9ZvaA3DPmGzFb8Lp6pD Pkfgc1GXRcuCxuI0+F2/R+vYZlgEoPZ13y5MCQF29S6KEyS/7pMjUKzKrFl57tDJ6X/1 zuxWu3dAxbRhKVQ84UXTV+kDGau6C0PTgoXI7oBr4I9d9d5GSIWf5hMUE3T82ERohHS3 +qhxvIWW/5iCPliEYUSZbQ9Pmw8FZLGZnyVA30knI/Sbub8b/89E/ivqE2s2R8fWkfdw qkWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358084; x=1686950084; 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=tD8sADHcRsSq9QkDCRoE5JuqMpJE24bgCDvH91fnaag=; b=dgg653KuJKbdqXvNmVXUWa+p0CQNWKgH0TmnC+iWSBIslYrlqGOSnYKQ0n7jodqr+5 D8Wi52vbELUX+mhlLZ7ST+iP9nb2YnQUoaaKbBh9qY8k3ItiEeaWTTsrbVBBocs2ujOa uTw6THyGt3UbtrVwJRBDegDKWAfTm+G5nReAXtWD2rBVUsjaxUXVBLYkL8/v77IilAi7 3M1Wxd9Ob+BArhJgB9MqLCK2n5OPJzl3P6/BCbf5Xa/nzm8Aq1JUZ3KI7oxbcdZZjMoR k7m7xCvIpN/iEm4eczFo7XuT0W5ECRaJoWz0sCinS/yydw3SaOXixb9JUZVRI3/2Sqyz qAAQ== X-Gm-Message-State: AC+VfDzjiOMBqEeAaAvTVxlRQpDzTnuiG7g5FUnIu+U8DR0Tw5WvIkB6 3tGqoKhiYq3M0UI7cns7sh/39Q== X-Received: by 2002:a2e:81ce:0:b0:2ac:829f:487e with SMTP id s14-20020a2e81ce000000b002ac829f487emr10903563ljg.21.1684358084503; Wed, 17 May 2023 14:14:44 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:44 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:25 +0200 Subject: [PATCH v3 12/17] media: venus: firmware: Correct IS_V6() checks MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230228-topic-venus-v3-12-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=2239; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=hZ+hgztR9wHWbz6QthMQ1eS50eS1f+OVy6D5ufbrrY8=; b=+RHQ9L/G1CxdtabVF8ID0djAkMzXA+4Uw4nLISy3nZw7hJ1zjcr/tvzoO2cg/oqgCnbcq0bV+ PG8dhBwIRkMDRCcw28F2yE07u7O0KnqbnLcY8Y8RuzxkGr4o22PgAja 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=unavailable 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 Most of these checks should have checked for TZ presence (or well, absence), as we shouldn't really be doing things that the black box does for us on non-CrOS platforms. The IS_V6() check in venus_shutdown_no_tz() should have checked whether the core version is IRIS2_1 (so, SC7280). Correct that. Reviewed-by: Bryan O'Donoghue Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/firmware.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c index 572b649c56f3..ceb917f2e0d4 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -29,7 +29,11 @@ static void venus_reset_cpu(struct venus_core *core) u32 fw_size = core->fw.mapped_mem_size; void __iomem *wrapper_base; - if (IS_V6(core)) + /* + * When there's no Qualcomm TZ (like on Chromebooks), the OS is + * responsible for bringing up the hardware instead. + */ + if (!core->use_tz) wrapper_base = core->wrapper_tz_base; else wrapper_base = core->wrapper_base; @@ -41,7 +45,7 @@ static void venus_reset_cpu(struct venus_core *core) writel(fw_size, wrapper_base + WRAPPER_NONPIX_START_ADDR); writel(fw_size, wrapper_base + WRAPPER_NONPIX_END_ADDR); - if (IS_V6(core)) { + if (!core->use_tz) { /* Bring XTSS out of reset */ writel(0, wrapper_base + WRAPPER_TZ_XTSS_SW_RESET); } else { @@ -67,7 +71,7 @@ int venus_set_hw_state(struct venus_core *core, bool resume) if (resume) { venus_reset_cpu(core); } else { - if (IS_V6(core)) + if (!core->use_tz) writel(WRAPPER_XTSS_SW_RESET_BIT, core->wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); else @@ -179,7 +183,7 @@ static int venus_shutdown_no_tz(struct venus_core *core) void __iomem *wrapper_base = core->wrapper_base; void __iomem *wrapper_tz_base = core->wrapper_tz_base; - if (IS_V6(core)) { + if (IS_IRIS2_1(core)) { /* Assert the reset to XTSS */ reg = readl(wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); reg |= WRAPPER_XTSS_SW_RESET_BIT; -- 2.40.1