[v2,02/18] media: venus: hfi_venus: Write to VIDC_CTRL_INIT after unmasking interrupts
Message ID | 20230228-topic-venus-v2-2-d95d14949c79@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp138130vqo; Thu, 4 May 2023 01:14:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ71ZwfpTJJvF6EX70dY8/t9Rd51nZ63FkCk6l5PKR5cIu/sRy5BwL3ydsJyexL0Sxg6oDyu X-Received: by 2002:a05:6a00:23d0:b0:63d:67e5:9731 with SMTP id g16-20020a056a0023d000b0063d67e59731mr1619008pfc.2.1683188050863; Thu, 04 May 2023 01:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683188050; cv=none; d=google.com; s=arc-20160816; b=qsM9grU8e+L+aDRg7opI/pO72dsXLs0q2sN6AMQqgM+n81YTg3HF96Pn0KsmqjSOeB rnk6o8ZYgx0puwLFrtO57BVtKFVXkPknatoavWfy01012FcIhCO+pkKhSw8+4v8Qg4Ex m59jYOaZ5595Y/7jRBVtM0NWbRYUC0L+vAyce/ESGBCuyZGBmoqnpm1vNx0gbsVfOMV7 TiYriKJWz80EXXT57BbgS1DwKXKwS21a0Yo51da3f/+TB3ulAE8oVBWvLvdK/IPYlBNk yYI9/cLykhcE83NK9R8aNiiklw0zqMNRpRhIAOjUTIpZ+RUbbP08OfyLGv/UA7hTjhrv qCmw== 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=wx5dYQRwBkTI+vIENabmZFidu+UG6bsoT2w/E9azkMk=; b=xWuIKeg+G51viRFTwgI5VIu5kabRWiZolKWrYfMhBgsMJKfiWVfc4iOvMF6j82MRgd lU3vRIpwXv2UB1JQ0hxv3zLrJPzjhFLQyPf7dRdwbGjSTXtUWTkPyevfQaVydLwnJk+n njZkjHBqs8vJp2SN1diKnSm69ifvtcOKoAJSaNzq52xEsNp1RQo8u+IIl1gP4xQVk8wx LLUf9fKzNtABONswdf6My/jTcEZ3eNpj06Jxp3oLLhli6IR3eiACD/T1e48blhJpnGQM cqDHa9ybQgDZueJBcweDAdxnzEOVo8aZBo1Yr97Wq/YNOYA56jDFhcBFAiPy1piwXC/e 6uvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ms5+Av3j; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v10-20020aa799ca000000b0063b8e23415esi35650630pfi.92.2023.05.04.01.13.56; Thu, 04 May 2023 01:14:10 -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=Ms5+Av3j; 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 S229944AbjEDIBp (ORCPT <rfc822;lhua1029@gmail.com> + 99 others); Thu, 4 May 2023 04:01:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229913AbjEDIBd (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 4 May 2023 04:01:33 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC5A09D for <linux-kernel@vger.kernel.org>; Thu, 4 May 2023 01:01:30 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4ecb137af7eso176216e87.2 for <linux-kernel@vger.kernel.org>; Thu, 04 May 2023 01:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683187289; x=1685779289; 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=wx5dYQRwBkTI+vIENabmZFidu+UG6bsoT2w/E9azkMk=; b=Ms5+Av3job8E1NirdFNKWCSJStO92kIfaxqw+VlDjqCaZhN/Efha3zMGCWN79gHpm6 AYoNhZnRWQ9mpboNWew9+7ajEw1d4K/Xe6khT7s1u3m7cb81rm8QRb1qyBClKM4Bwdvk XF1fy4+eiM9SKrtyWY7+hv1TyqVZhuSlHj7dsbVOcvP62ynjzhKFPx48lhLRjMvjiArs PM3nsodeZfLfyymZbj+LVVubsodwoxVLtg/5F2SC9T4T7WA2AP7NdrmgNRgFB+1Sc2zG p1GH22purCn1XKxIjU8l01PR8N/5xVG6bmsVO8uLsN0D/11cQ/5JBPi4rUk2bQePDbFp v9ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187289; x=1685779289; 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=wx5dYQRwBkTI+vIENabmZFidu+UG6bsoT2w/E9azkMk=; b=A6BCRKcK3FDITnwAMy7xWjM5DFpVswvH3JxY8GQ6mNGdo9F6S671vqWivbOg6+rTpy q1R8ynEB2eXX+I5PCDgdjOynyPGjcPt+NPXOlAKs7JeLlHhH7mwNE3n8QhIFxqlqVajz YCxT9jLPFRud3NEGiPcG0zcGrgzIP9VTFTFtitz9DaaSV2Ld/UIQ6LCSRtNol4VIINpt jPviFMg5j/ymrAWoDPbblDTEZwC/nqureYy4ihXR3Uvxh+hZvTECv3fG+zUpicx8BaYe NdrJ04JLkHhNHNsPiojZV07/dx9soGCMEI9ToP4q5aWaxjwewMPo8QZB+6qjOL4Jr4oC RkeQ== X-Gm-Message-State: AC+VfDwEQq5NhKdvY3f8hZvzz5U6K/N/fjukMuPjLPt/HHatL+O/DTh4 irbRBSFQ1g0bJeilvryNtfkvvQ== X-Received: by 2002:ac2:5237:0:b0:4ef:d573:c8a7 with SMTP id i23-20020ac25237000000b004efd573c8a7mr1613614lfl.32.1683187289004; Thu, 04 May 2023 01:01:29 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id n26-20020ac2491a000000b004edc512515fsm917165lfi.47.2023.05.04.01.01.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 01:01:28 -0700 (PDT) From: Konrad Dybcio <konrad.dybcio@linaro.org> Date: Thu, 04 May 2023 10:00:58 +0200 Subject: [PATCH v2 02/18] media: venus: hfi_venus: Write to VIDC_CTRL_INIT after unmasking interrupts MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230228-topic-venus-v2-2-d95d14949c79@linaro.org> References: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> In-Reply-To: <20230228-topic-venus-v2-0-d95d14949c79@linaro.org> To: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>, Vikash Garodia <quic_vgarodia@quicinc.com>, Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Mauro Carvalho Chehab <mchehab@kernel.org>, Dikshita Agarwal <dikshita@qti.qualcomm.com>, Bryan O'Donoghue <bryan.odonoghue@linaro.org>, Mansur Alisha Shaik <mansur@codeaurora.org>, Jonathan Marek <jonathan@marek.ca>, Hans Verkuil <hans.verkuil@cisco.com>, Dikshita Agarwal <quic_dikshita@quicinc.com> Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>, Stanimir Varbanov <stanimir.varbanov@linaro.org>, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten <marijn.suijten@somainline.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Vikash Garodia <quic_vgarodia@quicinc.com>, stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683187284; l=1480; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=0Uv5fE0exjmqzKoKkMe6XjqGKp8vRm4Af+NoaiadWoA=; b=p8XdYya25TcMY0FfaMTCVG6sx7I3fHtL6U+tbVXguByuFj0SbJNHB2/NIZMhEKfLrj5xnCFBx cYuHLgF7x4LD9tjzFro39MJA/tVrZd6hjnrRRYtXA4l4c3Km44/4ybo 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764950593690859068?= X-GMAIL-MSGID: =?utf-8?q?1764950593690859068?= |
Series |
Venus QoL / maintainability fixes
|
|
Commit Message
Konrad Dybcio
May 4, 2023, 8 a.m. UTC
The downstream driver signals the hardware to be enabled only after the
interrupts are unmasked, which... makes sense. Follow suit.
Cc: stable@vger.kernel.org # v4.12+
Fixes: d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
drivers/media/platform/qcom/venus/hfi_venus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 5/4/2023 1:30 PM, Konrad Dybcio wrote: > The downstream driver signals the hardware to be enabled only after the > interrupts are unmasked, which... makes sense. Follow suit. Rephrase the commit text, 1. No need to mention downstream driver, if something is buggy, fix it. 2. Avoid "..." and lets make it more formal. > Cc: stable@vger.kernel.org # v4.12+ > Fixes: d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files") > Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> > --- > drivers/media/platform/qcom/venus/hfi_venus.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c > index bff435abd59b..8fc8f46dc390 100644 > --- a/drivers/media/platform/qcom/venus/hfi_venus.c > +++ b/drivers/media/platform/qcom/venus/hfi_venus.c > @@ -453,7 +453,6 @@ static int venus_boot_core(struct venus_hfi_device *hdev) > void __iomem *wrapper_base = hdev->core->wrapper_base; > int ret = 0; > > - writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); > if (IS_V6(hdev->core)) { > mask_val = readl(wrapper_base + WRAPPER_INTR_MASK); > mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 | > @@ -464,6 +463,7 @@ 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); > > + writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); > while (!ctrl_status && count < max_tries) { > ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0); > if ((ctrl_status & CPU_CS_SCIACMDARG0_ERROR_STATUS_MASK) == 4) { Above code looks good. -Vikash
On 5.05.2023 14:33, Vikash Garodia wrote: > > On 5/4/2023 1:30 PM, Konrad Dybcio wrote: >> The downstream driver signals the hardware to be enabled only after the >> interrupts are unmasked, which... makes sense. Follow suit. > > Rephrase the commit text, > > 1. No need to mention downstream driver, if something is buggy, fix it. Generally I'd agree, however in this specific case the downstream driver is the only available source of knowledge about what the correct (or at least working) initialization sequence of this hw block is. > > 2. Avoid "..." and lets make it more formal. Ack Konrad > >> Cc: stable@vger.kernel.org # v4.12+ >> Fixes: d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files") >> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >> --- >> drivers/media/platform/qcom/venus/hfi_venus.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c >> index bff435abd59b..8fc8f46dc390 100644 >> --- a/drivers/media/platform/qcom/venus/hfi_venus.c >> +++ b/drivers/media/platform/qcom/venus/hfi_venus.c >> @@ -453,7 +453,6 @@ static int venus_boot_core(struct venus_hfi_device *hdev) >> void __iomem *wrapper_base = hdev->core->wrapper_base; >> int ret = 0; >> - writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); >> if (IS_V6(hdev->core)) { >> mask_val = readl(wrapper_base + WRAPPER_INTR_MASK); >> mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 | >> @@ -464,6 +463,7 @@ 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); >> + writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); >> while (!ctrl_status && count < max_tries) { >> ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0); >> if ((ctrl_status & CPU_CS_SCIACMDARG0_ERROR_STATUS_MASK) == 4) { > > Above code looks good. > > -Vikash >
On 5/6/2023 12:18 AM, Konrad Dybcio wrote: > > > On 5.05.2023 14:33, Vikash Garodia wrote: >> >> On 5/4/2023 1:30 PM, Konrad Dybcio wrote: >>> The downstream driver signals the hardware to be enabled only after the >>> interrupts are unmasked, which... makes sense. Follow suit. >> >> Rephrase the commit text, >> >> 1. No need to mention downstream driver, if something is buggy, fix it. > Generally I'd agree, however in this specific case the downstream > driver is the only available source of knowledge about what the correct > (or at least working) initialization sequence of this hw block is. Ideal way would be to refer the sequence of register programming from hardware programming guide (HPG). In this case, the commit can describe the change which is being done and reviewer/maintainer can certify the sequence from the HPG. Also downstream driver can be buggy too, so IMO, it is not the right reference. -Vikash >> >> 2. Avoid "..." and lets make it more formal. > Ack > > Konrad >> >>> Cc: stable@vger.kernel.org # v4.12+ >>> Fixes: d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files") >>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >>> --- >>> drivers/media/platform/qcom/venus/hfi_venus.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c >>> index bff435abd59b..8fc8f46dc390 100644 >>> --- a/drivers/media/platform/qcom/venus/hfi_venus.c >>> +++ b/drivers/media/platform/qcom/venus/hfi_venus.c >>> @@ -453,7 +453,6 @@ static int venus_boot_core(struct venus_hfi_device *hdev) >>> void __iomem *wrapper_base = hdev->core->wrapper_base; >>> int ret = 0; >>> - writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); >>> if (IS_V6(hdev->core)) { >>> mask_val = readl(wrapper_base + WRAPPER_INTR_MASK); >>> mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 | >>> @@ -464,6 +463,7 @@ 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); >>> + writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); >>> while (!ctrl_status && count < max_tries) { >>> ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0); >>> if ((ctrl_status & CPU_CS_SCIACMDARG0_ERROR_STATUS_MASK) == 4) { >> >> Above code looks good. >> >> -Vikash >>
diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index bff435abd59b..8fc8f46dc390 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -453,7 +453,6 @@ static int venus_boot_core(struct venus_hfi_device *hdev) void __iomem *wrapper_base = hdev->core->wrapper_base; int ret = 0; - writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); if (IS_V6(hdev->core)) { mask_val = readl(wrapper_base + WRAPPER_INTR_MASK); mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 | @@ -464,6 +463,7 @@ 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); + writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); while (!ctrl_status && count < max_tries) { ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0); if ((ctrl_status & CPU_CS_SCIACMDARG0_ERROR_STATUS_MASK) == 4) {