Re: [PATCH] staging: media: tegra-video: vi: fix probe failure on skipped last port

From: Luca Ceresoli

Date: Mon Jul 27 2026 - 10:01:17 EST


Hello Hao-Qun,

On Mon Jul 27, 2026 at 2:43 PM CEST, Hao-Qun Huang wrote:
> On Mon Jul 27, 2026 at 1:10 PM CEST, Luca Ceresoli wrote:
>> Do you have a real use case where ths failure happens?
>
> No, I found it by reading the code. I went back and checked the in-tree
> tegra DTs that have vi ports: lg-x3 (p880), nexus7-grouper and
> asus-transformer all link the port through to a CSI channel endpoint with
> data-lanes, which parses fine, and asus-tf600t has no remote-endpoint so
> it skips on the !parent path, which leaves ret alone. So no in-tree board
> hits this.
>
>> Also, mixing two different return values may solve a bug but makes for more
>> intricated. I'd rather second a fix based on moving the whole foreach loop
>> body into a subfunction, and make the foreach loop body as simple as
>> calling the subfunction and handling returned errors. This would fix the
>> code making it more readbale.
>
> Agreed. This one was already committed to media.git/next on Jul 18
> though,

Ah, I missed that, I got no e-mail notification about the patch being
applied.

> so I would rather send the subfunction split as a cleanup on top
> than respin it, which also keeps the stable backport small. I have that
> version building here and can post it.

Yes, I'd appreciate that.

> If you would rather have the committed patch dropped and replaced by a v2
> with the refactor, say so and I will send that instead.

No need, thanks.

Best regards,
Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com