From: Guo Zihao <guozh23@xiaopeng.com>
To: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil@kernel.org>,
Sylvain Petinot <sylvain.petinot@foss.st.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Liu Chao <liuc63@xiaopeng.com>
Subject: Re: [PATCH] media: i2c: vgxy61: reject out of range MIPI CSI-2 lane numbers
Date: Tue, 22 Sep 2026 14:46:04 +0800 [thread overview]
Message-ID: <20260922064604.847150-1-guozh23@xiaopeng.com> (raw)
In-Reply-To: <0729208e-e1ab-4960-aa03-810bd4915001@foss.st.com>
Hi Benjamin,
Thanks for the review. The maintainers are in copy now.
On the lane checking: l_nb is the number of lanes, while clock_lane and
data_lanes[] are the lane indices. The check at line 1453 accepts
num_data_lanes being 1, 2 or 4, but an endpoint such as
data-lanes = <1 2 3 99>;
has a valid count of 4 and an out of range index in the last entry. The
indices are stored as unsigned char in struct v4l2_mbus_config_mipi_csi2,
so an endpoint value of 99 arrives as 99, and anything from 5 up writes
past the five element phy2log array.
For clock_lane the write to phy2log[clock_lane] at line 1461 happens
before the log2phy[0] != 0 check at line 1480. vd55g1 and vd56g3, which
build the same kind of map from the same properties, check clock_lane
before the map is built rather than after.
v2 keeps both checks.
On the tooling question: yes, this was written with the help of an LLM,
and v2 carries the Assisted-by tag as the process documentation asks. I
went through the code and the reasoning myself before sending it.
Regards,
Guo
next prev parent reply other threads:[~2026-09-22 6:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 6:03 Guo Zihao
2026-09-21 9:09 ` Benjamin Mugnier
2026-09-22 6:46 ` Guo Zihao [this message]
2026-09-22 8:16 ` Benjamin Mugnier
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=20260922064604.847150-1-guozh23@xiaopeng.com \
--to=guozh23@xiaopeng.com \
--cc=benjamin.mugnier@foss.st.com \
--cc=hverkuil@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=liuc63@xiaopeng.com \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=sylvain.petinot@foss.st.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
all inboxes | Powered by JetHome®