From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: Depeng Shao <quic_depengs@quicinc.com>,
rfoss@kernel.org, todor.too@gmail.com, mchehab@kernel.org,
robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org
Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel@quicinc.com, Yongsheng Li <quic_yon@quicinc.com>
Subject: Re: [PATCH 13/13] media: qcom: camss: Add support for VFE hardware version Titan 780
Date: Thu, 15 Aug 2024 17:16:54 +0100 [thread overview]
Message-ID: <a748e4b2-70f6-4bc4-b48a-21816848fee2@linaro.org> (raw)
In-Reply-To: <8e38308a-4198-420e-ac4d-718299033eb5@quicinc.com>
On 15/08/2024 14:33, Depeng Shao wrote:
> Hi Bryan,
>
> On 8/15/2024 12:23 AM, Bryan O'Donoghue wrote:
>
>>> @@ -674,15 +675,17 @@ int vfe_reset(struct vfe_device *vfe)
>>> {
>>> unsigned long time;
>>> - reinit_completion(&vfe->reset_complete);
>>> + if (vfe->res->hw_ops->global_reset) {
>>> + reinit_completion(&vfe->reset_complete);
>>> - vfe->res->hw_ops->global_reset(vfe);
>>> + vfe->res->hw_ops->global_reset(vfe);
>>> - time = wait_for_completion_timeout(&vfe->reset_complete,
>>> - msecs_to_jiffies(VFE_RESET_TIMEOUT_MS));
>>> - if (!time) {
>>> - dev_err(vfe->camss->dev, "VFE reset timeout\n");
>>> - return -EIO;
>>> + time = wait_for_completion_timeout(&vfe->reset_complete,
>>> + msecs_to_jiffies(VFE_RESET_TIMEOUT_MS));
>>> + if (!time) {
>>> + dev_err(vfe->camss->dev, "VFE reset timeout\n");
>>> + return -EIO;
>>> + }
>>
>> Per my comment on the CSID - this feels like a fix you are introducing
>> here in the guise of a silicon add.
>>
>> Please break it up.
>>
>> If you have a number of fixes to core functionality they need to be
>>
>> 1. Granular and individual
>> 2. Indivdually scrutable with their own patch and descritption
>> 3. git cherry-pickable
>> 4. Have a Fixes tag
>> 5. And be cc'd to stable@vger.kernel.org
>>
>> Can't accept either the fixes or the silicon add if the two live mixed
>> up in one patch.
>>
>
> This isn't a bug fix, adding a null pointer checking just because vfe780
> doesn't have enable_irq/global_reset/isr/vfe_halt hw_ops, so adding the
> null checking for these hw_ops in this patch and adding them in one patch.
> The original code doesn't have any bug.
Right but you could just have
static void vfe_global_reset(struct vfe_device *vfe)
{
/* VFE780 has no global reset, simply report a completion */
complete(&vfe->reset_complete);
}
const struct vfe_hw_ops vfe_ops_780 = {
.global_reset = vfe_global_reset,
}
Instead of having a bunch of special cases in the top level code.
>
>>> diff --git a/drivers/media/platform/qcom/camss/camss-vfe.h b/drivers/
>>> media/platform/qcom/camss/camss-vfe.h
>>> index fcbf4f609129..9dec5bc0d1b1 100644
>>> --- a/drivers/media/platform/qcom/camss/camss-vfe.h
>>> +++ b/drivers/media/platform/qcom/camss/camss-vfe.h
>>> @@ -243,6 +243,7 @@ extern const struct vfe_hw_ops vfe_ops_4_7;
>>> extern const struct vfe_hw_ops vfe_ops_4_8;
>>> extern const struct vfe_hw_ops vfe_ops_170;
>>> extern const struct vfe_hw_ops vfe_ops_480;
>>> +extern const struct vfe_hw_ops vfe_ops_780;
>>> int vfe_get(struct vfe_device *vfe);
>>> void vfe_put(struct vfe_device *vfe);
>>> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/
>>> media/platform/qcom/camss/camss.c
>>> index 7ee102948dc4..92a0fa02e415 100644
>>> --- a/drivers/media/platform/qcom/camss/camss.c
>>> +++ b/drivers/media/platform/qcom/camss/camss.c
>>> @@ -1666,6 +1666,125 @@ static const struct camss_subdev_resources
>>> csid_res_8550[] = {
>>> }
>>> };
>>> +static const struct camss_subdev_resources vfe_res_8550[] = {
>>> + /* VFE0 */
>>> + {
>>> + .regulators = {},
>>> + .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb_clk",
>>> "vfe0_fast_ahb",
>>> + "vfe0", "cpas_vfe0", "camnoc_axi" },
>>
>> Should the camnoc AXI clock go here or in the CSID ?
>>
>
> camnoc is responsible for ddr writing, so it is needed for the WM in vfe.
Right, I don't recall if you specified the clock for CSID and VFE but
just for the record it should appear in only the one block.. VFE sounds
good to me.
>
>
>>> + /* VFE4 lite */
>>> + {
>>> + .regulators = {},
>>> + .clock = { "gcc_axi_hf", "cpas_ahb", "cpas_fast_ahb_clk",
>>> "vfe_lite_ahb",
>>> + "vfe_lite", "cpas_ife_lite", "camnoc_axi" },
>>> + .clock_rate = { { 0, 0, 0, 0, 0 },
>>> + { 0, 0, 0, 0, 80000000 },
>>> + { 300000000, 300000000, 400000000, 400000000,
>>> 400000000 },
>>> + { 300000000, 300000000, 400000000, 400000000,
>>> 400000000 },
>>
>> I realise you're specifying all of the operating points here but the
>> clock only needs to appear once i.e.
>>
>> 1 x 300 MHz
>> 1 x 400 MHz
>> 1 x 480 MHz
>>
>> etc.
>>
>
> Sure, will update in next series.
>
>>> + { 400000000, 480000000, 480000000, 480000000,
>>> 480000000 },
>>> + { 300000000, 300000000, 400000000, 400000000,
>>> 400000000 },
>>> + { 300000000, 300000000, 400000000, 400000000,
>>> 400000000 } },
>>> + .reg = { "vfe_lite1" },
>>> + .interrupt = { "vfe_lite1" },
>>> + .vfe = {
>>> + .line_num = 4,
>>> + .is_lite = true,
>>> + .hw_ops = &vfe_ops_780,
>>> + .formats_rdi = &vfe_formats_rdi_845,
>>> + .formats_pix = &vfe_formats_pix_845
>>> + }
>>> + },
>>> +};
>
>>> +void camss_reg_update(struct camss *camss, int hw_id, int port_id,
>>> bool is_clear)
>>> +{
>>> + struct csid_device *csid;
>>> +
>>> + if (hw_id < camss->res->csid_num) {
>>
>> Does this cause do anything ? Is it just defensive programming ? Can
>> the hw_id index exceed the number of CSIDs defined and if so why ?
>>
>> Smells wrong.
>>
>
> It is just a defensive programming, just like some null pointer checking.
Right so, please drop then. We require the indexes to be in range in
order to merge, our job is to make sure this is so.
Lets just reason about the code and make sure the indexes are right.
---
bod
next prev parent reply other threads:[~2024-08-15 16:16 UTC|newest]
Thread overview: 99+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-12 14:41 [PATCH v4 00/13] media: qcom: camss: Add sm8550 support Depeng Shao
2024-08-12 14:41 ` [PATCH 01/13] media: qcom: camss: csiphy-3ph: Fix trivial indentation fault in defines Depeng Shao
2024-08-12 14:41 ` [PATCH 02/13] media: qcom: camss: csiphy-3ph: Remove redundant PHY init sequence control loop Depeng Shao
2024-08-12 14:41 ` [PATCH 03/13] media: qcom: camss: csiphy-3ph: Rename struct Depeng Shao
2024-08-12 14:41 ` [PATCH 04/13] media: qcom: camss: csiphy: Add an init callback to CSI PHY devices Depeng Shao
2024-08-19 0:17 ` Vladimir Zapolskiy
2024-09-04 14:20 ` Depeng Shao
2024-09-04 14:51 ` Bryan O'Donoghue
2024-08-12 14:41 ` [PATCH 05/13] media: qcom: camss: csiphy-3ph: Move CSIPHY variables to data field inside csiphy struct Depeng Shao
2024-08-19 0:01 ` Vladimir Zapolskiy
2024-08-28 14:11 ` Depeng Shao
2024-08-12 14:41 ` [PATCH 06/13] media: qcom: camss: csiphy-3ph: Use an offset variable to find common control regs Depeng Shao
2024-08-18 23:59 ` Vladimir Zapolskiy
2024-08-12 14:41 ` [PATCH 07/13] dt-bindings: media: camss: Add qcom,sm8550-camss binding Depeng Shao
2024-08-16 7:01 ` Krzysztof Kozlowski
2024-08-16 7:45 ` Depeng Shao
2024-09-30 7:17 ` Krzysztof Kozlowski
2024-09-05 15:20 ` Vladimir Zapolskiy
2024-09-05 15:54 ` Depeng Shao
2024-09-06 15:56 ` Vladimir Zapolskiy
2024-09-25 15:13 ` Depeng Shao
2024-09-30 7:16 ` Krzysztof Kozlowski
2024-09-30 8:46 ` Vladimir Zapolskiy
2024-09-30 8:55 ` Bryan O'Donoghue
2024-09-30 9:15 ` Vladimir Zapolskiy
2024-09-30 7:26 ` Krzysztof Kozlowski
2024-09-30 8:32 ` Vladimir Zapolskiy
2024-09-30 9:03 ` Bryan O'Donoghue
2024-09-12 8:22 ` Vladimir Zapolskiy
2024-09-12 11:41 ` Bryan O'Donoghue
2024-09-12 12:44 ` Vladimir Zapolskiy
2024-09-12 15:11 ` Bryan O'Donoghue
2024-09-12 20:57 ` Vladimir Zapolskiy
2024-09-12 22:41 ` Bryan O'Donoghue
2024-09-13 5:06 ` Vladimir Zapolskiy
2024-09-17 22:40 ` Bryan O'Donoghue
2024-09-17 23:16 ` Vladimir Zapolskiy
2024-09-25 15:40 ` Depeng Shao
2024-09-30 9:26 ` Depeng Shao
2024-10-08 13:50 ` Vladimir Zapolskiy
2024-10-08 14:06 ` Bryan O'Donoghue
2024-10-08 15:47 ` Depeng Shao
2024-09-30 10:21 ` Bryan O'Donoghue
2024-09-13 4:17 ` Dmitry Baryshkov
2024-09-12 13:48 ` Neil Armstrong
2024-08-12 14:41 ` [PATCH 08/13] media: qcom: camss: csid: Move common code into csid core Depeng Shao
2024-08-14 23:53 ` Bryan O'Donoghue
2024-08-24 12:50 ` Vladimir Zapolskiy
2024-08-12 14:41 ` [PATCH 09/13] media: qcom: camss: vfe: Move common code into vfe core Depeng Shao
2024-08-15 0:09 ` Bryan O'Donoghue
2024-08-16 13:07 ` Depeng Shao
2024-08-24 13:06 ` Vladimir Zapolskiy
2024-08-28 0:07 ` Bryan O'Donoghue
2024-09-02 13:11 ` Depeng Shao
2024-08-12 14:41 ` [PATCH 10/13] media: qcom: camss: Add sm8550 compatible Depeng Shao
2024-08-13 12:57 ` Bryan O'Donoghue
2024-08-12 14:41 ` [PATCH 11/13] media: qcom: camss: csiphy-3ph: Add Gen2 v2.1.2 two-phase MIPI CSI-2 DPHY support Depeng Shao
2024-08-12 14:41 ` [PATCH 12/13] media: qcom: camss: Add CSID Gen3 support for sm8550 Depeng Shao
2024-08-14 16:08 ` Bryan O'Donoghue
2024-08-15 15:14 ` Depeng Shao
2024-08-15 16:10 ` Bryan O'Donoghue
2024-08-16 11:34 ` Bryan O'Donoghue
2024-08-16 13:11 ` Depeng Shao
2024-08-16 14:21 ` Bryan O'Donoghue
2024-08-19 13:23 ` Depeng Shao
2024-08-16 14:45 ` Bryan O'Donoghue
2024-08-19 13:18 ` Depeng Shao
2024-08-16 14:49 ` Bryan O'Donoghue
2024-08-24 13:19 ` Vladimir Zapolskiy
2024-09-30 9:23 ` Vladimir Zapolskiy
2024-09-30 9:38 ` Depeng Shao
2024-08-12 14:41 ` [PATCH 13/13] media: qcom: camss: Add support for VFE hardware version Titan 780 Depeng Shao
2024-08-14 11:13 ` Vladimir Zapolskiy
2024-08-14 13:10 ` Depeng Shao
2024-08-14 23:20 ` Vladimir Zapolskiy
2024-08-15 14:42 ` Depeng Shao
2024-08-15 14:57 ` Vladimir Zapolskiy
2024-08-15 15:43 ` Depeng Shao
2024-08-15 21:31 ` Vladimir Zapolskiy
2024-08-16 12:42 ` Depeng Shao
2024-08-20 14:01 ` Vladimir Zapolskiy
2024-08-14 16:23 ` Bryan O'Donoghue
2024-08-15 13:33 ` Depeng Shao
2024-08-15 16:16 ` Bryan O'Donoghue [this message]
2024-08-15 0:16 ` Bryan O'Donoghue
2024-08-15 14:24 ` Depeng Shao
2024-08-15 0:25 ` Bryan O'Donoghue
2024-08-15 14:21 ` Depeng Shao
2024-08-15 16:17 ` Bryan O'Donoghue
2024-09-29 1:28 ` Depeng Shao
2024-09-29 23:57 ` Bryan O'Donoghue
2024-09-30 5:37 ` Depeng Shao
2024-08-19 11:05 ` Bryan O'Donoghue
2024-08-19 13:07 ` Depeng Shao
2024-08-21 11:11 ` Vladimir Zapolskiy
2024-08-24 13:31 ` Vladimir Zapolskiy
2024-08-27 13:16 ` Bryan O'Donoghue
2024-08-13 12:35 ` [PATCH v4 00/13] media: qcom: camss: Add sm8550 support Bryan O'Donoghue
2024-08-13 12:42 ` Depeng Shao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a748e4b2-70f6-4bc4-b48a-21816848fee2@linaro.org \
--to=bryan.odonoghue@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kernel@quicinc.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=quic_depengs@quicinc.com \
--cc=quic_yon@quicinc.com \
--cc=rfoss@kernel.org \
--cc=robh@kernel.org \
--cc=todor.too@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).