Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rishikesh Donadkar" <r-donadkar@ti.com>
Cc: conor+dt@kernel.org, media-ci@linuxtv.org, robh@kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [RFC PATCH 3/8] media: i2c: ds90ub960: Add 10-bit RGBIr formats
Date: Fri, 25 Sep 2026 13:41:07 +0000	[thread overview]
Message-ID: <20260925134108.162571F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260925133001.2780868-4-r-donadkar@ti.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] media: v4l: UAPI macro collision for new RGBIr formats
- [Low] media: i2c: ds90ub960: dead code due to duplicate format entries
--

commit 4873d66b1c092adcf631de1fb4047b7f2d564358
Author: Jai Luthra <jai.luthra@linux.dev>

media: i2c: ds90ub960: Add 10-bit RGBIr formats
    
This commit adds 10-bit RGBIr formats to the ds90ub960 media driver. It defines
new 4x4 RGBIr bayer formats by appending them to the supported formats list.

> diff --git a/drivers/media/i2c/ds90ub960.c b/drivers/media/i2c/ds90ub960.c
> index 7d7ba6d349fc4..c86b18e0b4b33 100644
> --- a/drivers/media/i2c/ds90ub960.c
> +++ b/drivers/media/i2c/ds90ub960.c
> @@ -664,6 +664,24 @@ static const struct ub960_format_info ub960_formats[] = {
>  	{ .code = MEDIA_BUS_FMT_SGBRG12_1X12, .bpp = 12, .datatype = MIPI_CSI2_DT_RAW12, },
>  	{ .code = MEDIA_BUS_FMT_SGRBG12_1X12, .bpp = 12, .datatype = MIPI_CSI2_DT_RAW12, },
>  	{ .code = MEDIA_BUS_FMT_SRGGB12_1X12, .bpp = 12, .datatype = MIPI_CSI2_DT_RAW12, },
> +
> +	{ .code	= MEDIA_BUS_FMT_SRGGB8_1X8, .bpp = 8, .datatype = MIPI_CSI2_DT_RAW8, },
> +	{ .code	= MEDIA_BUS_FMT_SGRBG8_1X8, .bpp = 8, .datatype = MIPI_CSI2_DT_RAW8, },
> +	{ .code	= MEDIA_BUS_FMT_SGBRG8_1X8, .bpp = 8, .datatype = MIPI_CSI2_DT_RAW8, },
> +	{ .code	= MEDIA_BUS_FMT_SBGGR8_1X8, .bpp = 8, .datatype = MIPI_CSI2_DT_RAW8, },
> +	{ .code	= MEDIA_BUS_FMT_SRGGB10_1X10, .bpp = 10, .datatype = MIPI_CSI2_DT_RAW10, },
> +	{ .code	= MEDIA_BUS_FMT_SGRBG10_1X10, .bpp = 10, .datatype = MIPI_CSI2_DT_RAW10, },
> +	{ .code	= MEDIA_BUS_FMT_SGBRG10_1X10, .bpp = 10, .datatype = MIPI_CSI2_DT_RAW10, },
> +	{ .code	= MEDIA_BUS_FMT_SBGGR10_1X10, .bpp = 10, .datatype = MIPI_CSI2_DT_RAW10, },

[Severity: Low]
Are these format entries unreachable?

Since these 8 standard Bayer 8-bit and 10-bit formats are already present
earlier in the ub960_formats array, appending them here duplicates the exact
same format codes.

Because ub960_find_format() returns the first match it finds sequentially,
these appended duplicates will never be reached, introducing dead code.

> +
> +	{ .code	= MEDIA_BUS_FMT_SRGGI10_1X10, .bpp = 10, .datatype = MIPI_CSI2_DT_RAW10, },
> +	{ .code	= MEDIA_BUS_FMT_SGRIG10_1X10, .bpp = 10, .datatype = MIPI_CSI2_DT_RAW10, },
> +	{ .code	= MEDIA_BUS_FMT_SBGGI10_1X10, .bpp = 10, .datatype = MIPI_CSI2_DT_RAW10, },
> +	{ .code	= MEDIA_BUS_FMT_SGBIG10_1X10, .bpp = 10, .datatype = MIPI_CSI2_DT_RAW10, },

[Severity: High]
Do these new RGBIr format IDs collide with existing UAPI definitions?

Looking at include/uapi/linux/media-bus-format.h, the newly added 10-bit RGBIr
media bus formats are assigned UAPI values 0x3021 through 0x3024:

include/uapi/linux/media-bus-format.h:
    #define MEDIA_BUS_FMT_SRGGI10_1X10      0x3021
    #define MEDIA_BUS_FMT_SGRIG10_1X10      0x3022
    #define MEDIA_BUS_FMT_SBGGI10_1X10      0x3023
    #define MEDIA_BUS_FMT_SGBIG10_1X10      0x3024

These exact hex values are already assigned to the 20-bit Bayer formats
(MEDIA_BUS_FMT_SBGGR20_1X20 through MEDIA_BUS_FMT_SRGGB20_1X20) further up in
the file.

This causes an unresolvable collision in the public userspace API, where the
kernel and userspace will be unable to distinguish between the 10-bit RGBIr
and 20-bit Bayer formats during format identification.

> +	{ .code	= MEDIA_BUS_FMT_SGIRG10_1X10, .bpp = 10, .datatype = MIPI_CSI2_DT_RAW10, },
> +	{ .code	= MEDIA_BUS_FMT_SIGGR10_1X10, .bpp = 10, .datatype = MIPI_CSI2_DT_RAW10, },
> +	{ .code	= MEDIA_BUS_FMT_SGIBG10_1X10, .bpp = 10, .datatype = MIPI_CSI2_DT_RAW10, },
> +	{ .code	= MEDIA_BUS_FMT_SIGGB10_1X10, .bpp = 10, .datatype = MIPI_CSI2_DT_RAW10, },
>  };
>  
>  static const struct ub960_format_info *ub960_find_format(u32 code)

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260925133001.2780868-1-r-donadkar@ti.com?part=3

  reply	other threads:[~2026-09-25 13:41 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25 13:29 [RFC PATCH 0/8] Add OmniVision OV2312 RGB-IR sensor driver Rishikesh Donadkar
2026-09-25 13:29 ` [RFC PATCH 1/8] dt-bindings: media: Add bindings for Omnivision OV2312 Rishikesh Donadkar
2026-09-25 13:40   ` sashiko-bot
2026-09-26 14:51   ` Laurent Pinchart
2026-09-25 13:29 ` [RFC PATCH 2/8] media: v4l: Add 10-bit RGBIr formats Rishikesh Donadkar
2026-09-25 13:39   ` sashiko-bot
2026-09-26 14:30   ` Sakari Ailus
2026-09-26 14:40     ` Laurent Pinchart
2026-09-27  5:09       ` Rishikesh Donadkar
2026-09-27  5:08     ` Rishikesh Donadkar
2026-09-27  5:59       ` Sakari Ailus
2026-09-25 13:29 ` [RFC PATCH 3/8] media: i2c: ds90ub960: " Rishikesh Donadkar
2026-09-25 13:41   ` sashiko-bot [this message]
2026-09-25 13:29 ` [RFC PATCH 4/8] media: cadence: csi2rx: Add RAW10 " Rishikesh Donadkar
2026-09-26 14:52   ` Laurent Pinchart
2026-09-27  5:20     ` Rishikesh Donadkar
2026-09-27 14:19       ` Laurent Pinchart
2026-09-25 13:29 ` [RFC PATCH 5/8] media: ti: j721e-csi2rx: " Rishikesh Donadkar
2026-09-25 13:29 ` [RFC PATCH 6/8] media: i2c: ov2312: add Omnivison OV2312 driver Rishikesh Donadkar
2026-09-25 13:44   ` sashiko-bot
2026-10-02 16:16   ` Mirela Rabulea
2026-10-03  2:05     ` Jai Luthra
2026-10-05 18:12       ` Mirela Rabulea
2026-10-06  5:19     ` Rishikesh Donadkar
2026-10-06 12:33       ` [EXT] " Mirela Rabulea
2026-10-06  7:36     ` Sakari Ailus
2026-10-06 13:55       ` Mirela Rabulea
2026-10-06 15:37         ` Laurent Pinchart
2026-10-07  7:16           ` Mirela Rabulea
2026-09-25 13:30 ` [RFC PATCH 7/8] arm64: dts: ti: k3-am62a7: FPDLink overlays for LI OV2312 Rishikesh Donadkar
2026-09-25 13:43   ` sashiko-bot
2026-09-26 14:57   ` Laurent Pinchart
2026-09-27  5:23     ` Rishikesh Donadkar
2026-09-25 13:30 ` [RFC PATCH 8/8] arm64: defconfig: Enable OV2312 Rishikesh Donadkar
2026-09-26 14:55   ` Laurent Pinchart

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=20260925134108.162571F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=media-ci@linuxtv.org \
    --cc=r-donadkar@ti.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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