From: <Balakrishnan.S@microchip.com>
To: <ehristev@kernel.org>, <mchehab@kernel.org>
Cc: <hverkuil@kernel.org>, <sakari.ailus@linux.intel.com>,
<linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 07/10] media: microchip-isc: fix pfe_cfg0_bps comment
Date: Mon, 22 Jun 2026 11:32:26 +0000 [thread overview]
Message-ID: <ab562e26-2cb7-45ee-96fd-53103ed9001f@microchip.com> (raw)
In-Reply-To: <6ffd489e-8f24-47b2-bbfb-ac464798883f@kernel.org>
Hi Eugen,
On 21/06/26 11:57 am, Eugen Hristev wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> On 6/16/26 14:51, Balakrishnan Sambath wrote:
>> The @pfe_cfg0_bps comment claimed the field holds the "number of
>> hardware data lines connected to the ISC". It does not. The field
>> stores the pre-shifted PFE_CFG0 BPS value (e.g. ISC_PFE_CFG0_BPS_EIGHT,
>> which is 0x4 << 28) and is ORed straight into the PFE_CFG0 register
>> word in microchip-isc-base.c.
>>
>> The old wording invites a reader to treat it as a small bit-depth
>> integer (8, 10, 12) and compare or do arithmetic on it directly, which
>> silently breaks since the value is shifted into bits 30:28. Document
>> what the field really holds and how to read the bit-depth back out with
>> FIELD_GET(ISC_PFE_CFG0_BPS_MASK, ...).
>
> In this commit message I would focus on the correct meaning of
> pfe_cfg0_bps and stop inferring what a reader *might* have understood.
> Let's just fix it to be right, explain the right way, and forget the
> wrong way.
Sure. Will fix the comment to just say what the field holds.
>
> But it looks like we could improve this to hold an actual meaningful
> data here, instead of a preshifted value, and rather shift it to the
> register when the hardware needs it.
Yes that seems better. Will store the actual bps value and shift it at
the PFE_CFG0 write where its needed, will that work ?
If so will fix both in next version.
Thanks,
Balakrishnan
>
> Eugen
>
>>
>> Signed-off-by: Balakrishnan Sambath <balakrishnan.s@microchip.com>
>> ---
>> drivers/media/platform/microchip/microchip-isc.h | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/platform/microchip/microchip-isc.h b/drivers/media/platform/microchip/microchip-isc.h
>> index f5e322c2e36b..b084459f4583 100644
>> --- a/drivers/media/platform/microchip/microchip-isc.h
>> +++ b/drivers/media/platform/microchip/microchip-isc.h
>> @@ -62,7 +62,11 @@ struct isc_subdev_entity {
>> * @mbus_code: V4L2 media bus format code.
>> * @cfa_baycfg: If this format is RAW BAYER, indicate the type of bayer.
>> this is either BGBG, RGRG, etc.
>> - * @pfe_cfg0_bps: Number of hardware data lines connected to the ISC
>> + * @pfe_cfg0_bps: Pre-shifted ISC_PFE_CFG0 BPS field value (e.g.
>> + ISC_PFE_CFG0_BPS_EIGHT), not a plain bit-depth integer.
>> + OR it directly into the PFE_CFG0 register word, or use
>> + FIELD_GET(ISC_PFE_CFG0_BPS_MASK, ...) to obtain the
>> + 3-bit BPS field value.
>> * @raw: If the format is raw bayer.
>> */
>>
>>
>
next prev parent reply other threads:[~2026-06-22 11:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 11:50 [PATCH 00/10] media: microchip-isc: AWB, stream-stop and endpoint-ref fixes Balakrishnan Sambath
2026-06-16 11:50 ` [PATCH 01/10] media: microchip-isc: fix awb_mutex and lock lifecycle Balakrishnan Sambath
2026-06-16 11:50 ` [PATCH 02/10] media: microchip-isc: take a reference on the parsed endpoints Balakrishnan Sambath
2026-06-16 11:50 ` [PATCH 03/10] media: microchip-isc: synchronize the IRQ before disabling clocks on stop Balakrishnan Sambath
2026-06-19 8:01 ` Eugen Hristev
2026-06-16 11:50 ` [PATCH 04/10] media: microchip-isc: disable histogram and flush AWB work " Balakrishnan Sambath
2026-06-21 6:23 ` Eugen Hristev
2026-06-22 11:27 ` Balakrishnan.S
2026-06-16 11:51 ` [PATCH 05/10] media: microchip-isc: clean up histogram on the start_streaming error path Balakrishnan Sambath
2026-06-16 11:51 ` [PATCH 06/10] media: microchip-isc: do not touch WB registers when not streaming Balakrishnan Sambath
2026-06-16 11:51 ` [PATCH 07/10] media: microchip-isc: fix pfe_cfg0_bps comment Balakrishnan Sambath
2026-06-21 6:27 ` Eugen Hristev
2026-06-22 11:32 ` Balakrishnan.S [this message]
2026-06-23 6:29 ` Eugen Hristev
2026-06-16 11:51 ` [PATCH 08/10] media: microchip-isc: fix PM runtime leak in AWB work handler Balakrishnan Sambath
2026-06-16 11:51 ` [PATCH 09/10] media: microchip-isc: fix SBGGR10 Bayer pattern Balakrishnan Sambath
2026-06-16 11:51 ` [PATCH 10/10] media: microchip-isc: fix WB offset and gain register field masking Balakrishnan Sambath
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=ab562e26-2cb7-45ee-96fd-53103ed9001f@microchip.com \
--to=balakrishnan.s@microchip.com \
--cc=ehristev@kernel.org \
--cc=hverkuil@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.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