Porting kernel from 28.1.0 to 28.2.1: /dev/videoX capture devices missing

Hi,

we are porting the TX2 kernel over from 28.1.0 to 28.2.1 and did run into a problem for which i like to ask you for your help. The problem is that some of our video capture devices aren’t created anymore, which is because the video4linux VI graph building code has been rewritten and does not seem to fit anymore to our device tree.

Probably we have a little bit special topology, where we are using a SPI multiplexer / switch, which allows us to access our 3 FPGAs via I2C management subdevices (mvcrcam 11-0041 VIDA, mvcrcam 10-0041 VIDB, mvcrcam 9-0041 VIDC), VIDA and VIDB have 2 channels each and VIDC has 1 channel, i. e. there should be 5 capture devices /dev/video0-4 in total, which are successfully linked with 28.1.0, but the problem is that with 28.2.1 the second channels of VIDA and VIDB are missing, i. e. only /dev/video0-2 get created.

Our simplified device tree looks like this:

/ {
    host1x {
        tegra_vi:vi@15700000 {
            ports {
                port@0 {
                    vi_in0: endpoint {
                        remote-endpoint = <&csi_out0>;
                    };
                };
                port@1 {
                    vi_in1: endpoint {
                        remote-endpoint = <&csi_out1>;
                    };
                };
                port@2 {
                    vi_in2: endpoint {
                        remote-endpoint = <&csi_out2>;
                    };
                };
                port@3 {
                    vi_in3: endpoint {
                        remote-endpoint = <&csi_out3>;
                    };
                };
                port@4 {
                    vi_in4: endpoint {
                        remote-endpoint = <&csi_out4>;
                    };
                };
            };
        };

        nvcsi@150c0000 {
            channel@0 {
                ports {
                    port@0 {
                        csi_in0: endpoint@0 {
                            remote-endpoint = <&vida_out0>;
                        };
                    };
                    port@1 {
                        csi_out0: endpoint@1 {
                            remote-endpoint = <&vi_in0>;
                        };
                    };
                };
            };
            channel@1 {
                ports {
                    port@0 {
                        csi_in1: endpoint@2 {
                            remote-endpoint = <&vida_out1>;
                        };
                    };
                    port@1 {
                        csi_out1: endpoint@3 {
                            remote-endpoint = <&vi_in1>;
                        };
                    };
                };
            };
            channel@2 {
                ports {
                    port@0 {
                        csi_in2: endpoint@4 {
                            remote-endpoint = <&vidb_out0>;
                        };
                    };
                    port@1 {
                        csi_out2: endpoint@5 {
                            remote-endpoint = <&vi_in2>;
                        };
                    };
                };
            };
            channel@3 {
                ports {
                    port@0 {
                        csi_in3: endpoint@6 {
                            remote-endpoint = <&vidb_out1>;
                        };
                    };
                    port@1 {
                        csi_out3: endpoint@7 {
                            remote-endpoint = <&vi_in3>;
                        };
                    };
                };
            };
            channel@4 {
                ports {
                    port@0 {
                        csi_in4: endpoint@8 {
                            remote-endpoint = <&vidc_out0>;
                        };
                    };
                    port@1 {
                        csi_out4: endpoint@9 {
                            remote-endpoint = <&vi_in4>;
                        };
                    };
                };
            };
        };
    };

    spi {
        multiplexer {
            i2c@11 {
                vidcmvcr@41 {
                    ports {
                        port@0 {
                            vidc_out0: endpoint {
                                remote-endpoint = <&csi_in4>;
                             };
                        };
                    }; 
                };
            };
            i2c@22 {
                vidbmvcr@41 {
                    ports {
                        port@0 {
                            vidb_out0: endpoint {
                                remote-endpoint = <&csi_in2>;
                            };
                        };
                        port@1 {
                            vidb_out1: endpoint {
                                remote-endpoint = <&csi_in3>;
                            };
                        };
                    }; 
                };
            };
            i2c@44 {
                vida: vidamvcr@41 {
                    ports {
                        port@0 {
                            vida_out0: endpoint {
                                remote-endpoint = <&csi_in0>;
                            };
                        };
                        port@1 {
                            vida_out1: endpoint {
                                remote-endpoint = <&csi_in1>;
                            };
                        };
                    };
                };
            };
        };
    };
};

With 28.1.0, media-ctl shows the following port bindings:

entity 6: mvcrcam 11-0041  --> entity 5: 150c0000.nvcsi-0 --> entity 9: vi-output, mvcrcam 11-0041 (/dev/video0)
entity 6: mvcrcam 11-0041  --> entity 4: 150c0000.nvcsi-1 --> entity 10: vi-output, mvcrcam 11-0041 (/dev/video1)
entity 7: mvcrcam 10-0041  --> entity 3: 150c0000.nvcsi-2 --> entity 11: vi-output, mvcrcam 10-0041 (/dev/video2)
entity 7: mvcrcam 10-0041  --> entity 2: 150c0000.nvcsi-3 --> entity 12: vi-output, mvcrcam 10-0041 (/dev/video3)
entity 8: mvcrcam 9-0041    --> entity 1: 150c0000.nvcsi-4 --> entity 13: vi-output, mvcrcam 9-0041 (/dev/video4)

~ # media-ctl -p -d /dev/media0
Media controller API version 0.1.0

Media device information
------------------------
driver          tegra-vi4
model           NVIDIA Tegra Video Input Device
serial          
bus info        
hw revision     0x3
driver version  0.0.0

Device topology
- entity 1: 150c0000.nvcsi-4 (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
	pad0: Sink
		<- "mvcrcam 9-0041":0 [ENABLED]
	pad1: Source
		-> "vi-output, mvcrcam 9-0041":0 [ENABLED]

- entity 2: 150c0000.nvcsi-3 (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
	pad0: Sink
		<- "mvcrcam 10-0041":0 [ENABLED]
	pad1: Source
		-> "vi-output, mvcrcam 10-0041":0 [ENABLED]

- entity 3: 150c0000.nvcsi-2 (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev2
	pad0: Sink
		<- "mvcrcam 10-0041":0 [ENABLED]
	pad1: Source
		-> "vi-output, mvcrcam 10-0041":0 [ENABLED]

- entity 4: 150c0000.nvcsi-1 (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev3
	pad0: Sink
		<- "mvcrcam 11-0041":0 [ENABLED]
	pad1: Source
		-> "vi-output, mvcrcam 11-0041":0 [ENABLED]

- entity 5: 150c0000.nvcsi-0 (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev4
	pad0: Sink
		<- "mvcrcam 11-0041":0 [ENABLED]
	pad1: Source
		-> "vi-output, mvcrcam 11-0041":0 [ENABLED]

- entity 6: mvcrcam 11-0041 (1 pad, 2 links)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev5
	pad0: Source
		[fmt:UYVY8_2X8/1280x720 field:none]
		-> "150c0000.nvcsi-0":0 [ENABLED]
		-> "150c0000.nvcsi-1":0 [ENABLED]

- entity 7: mvcrcam 10-0041 (1 pad, 2 links)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev6
	pad0: Source
		[fmt:UYVY8_2X8/1280x720 field:none]
		-> "150c0000.nvcsi-2":0 [ENABLED]
		-> "150c0000.nvcsi-3":0 [ENABLED]

- entity 8: mvcrcam 9-0041 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev7
	pad0: Source
		[fmt:UYVY8_2X8/1280x720 field:none]
		-> "150c0000.nvcsi-4":0 [ENABLED]

- entity 9: vi-output, mvcrcam 11-0041 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
	pad0: Sink
		<- "150c0000.nvcsi-0":1 [ENABLED]

- entity 10: vi-output, mvcrcam 11-0041 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video1
	pad0: Sink
		<- "150c0000.nvcsi-1":1 [ENABLED]

- entity 11: vi-output, mvcrcam 10-0041 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video2
	pad0: Sink
		<- "150c0000.nvcsi-2":1 [ENABLED]

- entity 12: vi-output, mvcrcam 10-0041 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video3
	pad0: Sink
		<- "150c0000.nvcsi-3":1 [ENABLED]

- entity 13: vi-output, mvcrcam 9-0041 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video4
	pad0: Sink
		<- "150c0000.nvcsi-4":1 [ENABLED]

And with 28.2.1, media-ctl shows the following port bindings:

entity 3: mvcrcam 11-0041 --> entity 2: 150c0000.nvcsi-0 --> entity 9: vi-output, mvcrcam 11-0041 (/dev/video0)
entity 6: mvcrcam 10-0041 --> entity 5: 150c0000.nvcsi-2 --> entity 10: vi-output, mvcrcam 10-0041 (/dev/video1)
entity 8: mvcrcam 9-0041   --> entity 7: 150c0000.nvcsi-4 --> entity 11: vi-output, mvcrcam 9-0041 (/dev/video2)
The following entities are broken:
entity 1: 150c0000.nvcsi-1: it has a sink (entity 3: mvcrcam 11-0041), but does not have a source
entity 4: 150c0000.nvcsi-3: it has a sink (entity 6: mvcrcam 10-0041), but does not have a source

~ # media-ctl -p -d /dev/media0
Media controller API version 0.1.0

Media device information
------------------------
driver          tegra-vi4
model           NVIDIA Tegra Video Input Device
serial          
bus info        
hw revision     0x3
driver version  0.0.0

Device topology
- entity 1: 150c0000.nvcsi-1 (2 pads, 1 link)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
	pad0: Sink
		<- "mvcrcam 11-0041":0 [ENABLED]
	pad1: Source

- entity 2: 150c0000.nvcsi-0 (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
	pad0: Sink
		<- "mvcrcam 11-0041":0 [ENABLED]
	pad1: Source
		-> "vi-output, mvcrcam 11-0041":0 [ENABLED]

- entity 3: mvcrcam 11-0041 (1 pad, 2 links)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev2
	pad0: Source
		[fmt:UYVY8_2X8/1280x720 field:none]
		-> "150c0000.nvcsi-0":0 [ENABLED]
		-> "150c0000.nvcsi-1":0 [ENABLED]

- entity 4: 150c0000.nvcsi-3 (2 pads, 1 link)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev3
	pad0: Sink
		<- "mvcrcam 10-0041":0 [ENABLED]
	pad1: Source

- entity 5: 150c0000.nvcsi-2 (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev4
	pad0: Sink
		<- "mvcrcam 10-0041":0 [ENABLED]
	pad1: Source
		-> "vi-output, mvcrcam 10-0041":0 [ENABLED]

- entity 6: mvcrcam 10-0041 (1 pad, 2 links)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev5
	pad0: Source
		[fmt:UYVY8_2X8/1280x720 field:none]
		-> "150c0000.nvcsi-2":0 [ENABLED]
		-> "150c0000.nvcsi-3":0 [ENABLED]

- entity 7: 150c0000.nvcsi-4 (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev6
	pad0: Sink
		<- "mvcrcam 9-0041":0 [ENABLED]
	pad1: Source
		-> "vi-output, mvcrcam 9-0041":0 [ENABLED]

- entity 8: mvcrcam 9-0041 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev7
	pad0: Source
		[fmt:UYVY8_2X8/1280x720 field:none]
		-> "150c0000.nvcsi-4":0 [ENABLED]

- entity 9: vi-output, mvcrcam 11-0041 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
	pad0: Sink
		<- "150c0000.nvcsi-0":1 [ENABLED]

- entity 10: vi-output, mvcrcam 10-0041 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video1
	pad0: Sink
		<- "150c0000.nvcsi-2":1 [ENABLED]

- entity 11: vi-output, mvcrcam 9-0041 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video2
	pad0: Sink
		<- "150c0000.nvcsi-4":1 [ENABLED]

With turned on debug prints in drivers/media/platform/tegra/camera/vi/graph.c i get the following:

[    2.919166] tegra-vi4 15700000.vi: tegra_vi_graph_init: handling endpoint /host1x/vi@15700000/ports/port@0/endpoint
[    2.919205] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: parsing node /host1x/nvcsi@150c0000/channel@0
[    2.919208] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@0/ports/port@0/endpoint@0
[    2.919288] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: parsing node /spi/multiplexer/i2c@44/vidamvcr@41
[    2.919295] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /spi/multiplexer/i2c@44/vidamvcr@41/ports/port@0/endpoint
[    2.919318] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /spi/multiplexer/i2c@44/vidamvcr@41/ports/port@1/endpoint
[    2.919337] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: parsing node /host1x/nvcsi@150c0000/channel@1
[    2.919340] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@1/ports/port@0/endpoint@2
[    2.919369] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@1/ports/port@1/endpoint@3
[    2.919390] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@0/ports/port@1/endpoint@1
[    2.919411] tegra-vi4 15700000.vi: tegra_vi_graph_notify_bound: subdev 150c0000.nvcsi-1 bound
[    2.919414] tegra-vi4 15700000.vi: tegra_vi_graph_notify_bound: subdev 150c0000.nvcsi-0 bound
[    2.919417] tegra-vi4 15700000.vi: tegra_vi_graph_notify_bound: subdev mvcrcam 11-0041 bound
[    2.919419] tegra-vi4 15700000.vi: tegra_vi_graph_notify_complete: notify complete, all subdevs registered
[    2.919421] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: creating links for entity 150c0000.nvcsi-0
[    2.919423] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: processing endpoint /host1x/nvcsi@150c0000/channel@0/ports/port@0/endpoint@0
[    2.919453] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: skipping sink port /host1x/nvcsi@150c0000/channel@0:0
[    2.919456] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: processing endpoint /host1x/nvcsi@150c0000/channel@0/ports/port@1/endpoint@1
[    2.919475] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: skipping channel port /host1x/nvcsi@150c0000/channel@0:1
[    2.919477] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: creating links for entity mvcrcam 11-0041
[    2.919481] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: processing endpoint /spi/multiplexer/i2c@44/vidamvcr@41/ports/port@0/endpoint
[    2.919500] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: creating mvcrcam 11-0041:0 -> 150c0000.nvcsi-0:0 link
[    2.919502] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: processing endpoint /spi/multiplexer/i2c@44/vidamvcr@41/ports/port@1/endpoint
[    2.919521] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: creating mvcrcam 11-0041:0 -> 150c0000.nvcsi-1:0 link
[    2.919524] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: creating links for entity 150c0000.nvcsi-1
[    2.919526] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: processing endpoint /host1x/nvcsi@150c0000/channel@1/ports/port@0/endpoint@2
[    2.919553] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: skipping sink port /host1x/nvcsi@150c0000/channel@1:0
[    2.919555] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: processing endpoint /host1x/nvcsi@150c0000/channel@1/ports/port@1/endpoint@3
[    2.919574] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: skipping channel port /host1x/nvcsi@150c0000/channel@1:1
[    2.919576] tegra-vi4 15700000.vi: tegra_vi_graph_build_links: creating links for channels
[    2.919578] tegra-vi4 15700000.vi: tegra_vi_graph_build_links: processing endpoint /host1x/vi@15700000/ports/port@0/endpoint
[    2.919595] tegra-vi4 15700000.vi: tegra_vi_graph_build_links: creating link for channel 15700000.vi-output-0
[    2.919598] tegra-vi4 15700000.vi: tegra_vi_graph_build_links: creating 150c0000.nvcsi-0:1 -> (null):0 link
[    2.919604] mvcrcam 11-0041: getting format : 1280x720 8 8198
[    2.919835] tegra-vi4 15700000.vi: tegra_vi_graph_init: handling endpoint /host1x/vi@15700000/ports/port@1/endpoint
[    2.919857] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: parsing node /host1x/nvcsi@150c0000/channel@1
[    2.919859] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@1/ports/port@0/endpoint@2
[    2.919895] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: parsing node /spi/multiplexer/i2c@44/vidamvcr@41
[    2.919899] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /spi/multiplexer/i2c@44/vidamvcr@41/ports/port@0/endpoint
[    2.919917] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: parsing node /host1x/nvcsi@150c0000/channel@0
[    2.919919] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@0/ports/port@0/endpoint@0
[    2.919945] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@0/ports/port@1/endpoint@1
[    2.919964] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /spi/multiplexer/i2c@44/vidamvcr@41/ports/port@1/endpoint
[    2.919981] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@1/ports/port@1/endpoint@3
[    2.920002] tegra-vi4 15700000.vi: tegra_vi_graph_init: handling endpoint /host1x/vi@15700000/ports/port@2/endpoint
[    2.920021] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: parsing node /host1x/nvcsi@150c0000/channel@2
[    2.920024] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@2/ports/port@0/endpoint@4
[    2.920053] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: parsing node /spi/multiplexer/i2c@22/vidbmvcr@41
[    2.920058] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /spi/multiplexer/i2c@22/vidbmvcr@41/ports/port@0/endpoint
[    2.920078] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /spi/multiplexer/i2c@22/vidbmvcr@41/ports/port@1/endpoint
[    2.920097] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: parsing node /host1x/nvcsi@150c0000/channel@3
[    2.920100] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@3/ports/port@0/endpoint@6
[    2.920128] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@3/ports/port@1/endpoint@7
[    2.920148] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@2/ports/port@1/endpoint@5
[    2.920167] tegra-vi4 15700000.vi: tegra_vi_graph_notify_bound: subdev 150c0000.nvcsi-3 bound
[    2.920169] tegra-vi4 15700000.vi: tegra_vi_graph_notify_bound: subdev 150c0000.nvcsi-2 bound
[    2.920172] tegra-vi4 15700000.vi: tegra_vi_graph_notify_bound: subdev mvcrcam 10-0041 bound
[    2.920173] tegra-vi4 15700000.vi: tegra_vi_graph_notify_complete: notify complete, all subdevs registered
[    2.920175] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: creating links for entity 150c0000.nvcsi-2
[    2.920177] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: processing endpoint /host1x/nvcsi@150c0000/channel@2/ports/port@0/endpoint@4
[    2.920205] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: skipping sink port /host1x/nvcsi@150c0000/channel@2:0
[    2.920207] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: processing endpoint /host1x/nvcsi@150c0000/channel@2/ports/port@1/endpoint@5
[    2.920225] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: skipping channel port /host1x/nvcsi@150c0000/channel@2:1
[    2.920228] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: creating links for entity mvcrcam 10-0041
[    2.920231] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: processing endpoint /spi/multiplexer/i2c@22/vidbmvcr@41/ports/port@0/endpoint
[    2.920250] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: creating mvcrcam 10-0041:0 -> 150c0000.nvcsi-2:0 link
[    2.920252] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: processing endpoint /spi/multiplexer/i2c@22/vidbmvcr@41/ports/port@1/endpoint
[    2.920271] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: creating mvcrcam 10-0041:0 -> 150c0000.nvcsi-3:0 link
[    2.920273] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: creating links for entity 150c0000.nvcsi-3
[    2.920275] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: processing endpoint /host1x/nvcsi@150c0000/channel@3/ports/port@0/endpoint@6
[    2.920301] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: skipping sink port /host1x/nvcsi@150c0000/channel@3:0
[    2.920303] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: processing endpoint /host1x/nvcsi@150c0000/channel@3/ports/port@1/endpoint@7
[    2.920323] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: skipping channel port /host1x/nvcsi@150c0000/channel@3:1
[    2.920325] tegra-vi4 15700000.vi: tegra_vi_graph_build_links: creating links for channels
[    2.920327] tegra-vi4 15700000.vi: tegra_vi_graph_build_links: processing endpoint /host1x/vi@15700000/ports/port@2/endpoint
[    2.920344] tegra-vi4 15700000.vi: tegra_vi_graph_build_links: creating link for channel 15700000.vi-output-2
[    2.920346] tegra-vi4 15700000.vi: tegra_vi_graph_build_links: creating 150c0000.nvcsi-2:1 -> (null):0 link
[    2.920350] mvcrcam 10-0041: getting format : 1280x720 8 8198
[    2.920563] tegra-vi4 15700000.vi: tegra_vi_graph_init: handling endpoint /host1x/vi@15700000/ports/port@3/endpoint
[    2.920585] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: parsing node /host1x/nvcsi@150c0000/channel@3
[    2.920588] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@3/ports/port@0/endpoint@6
[    2.920617] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: parsing node /spi/multiplexer/i2c@22/vidbmvcr@41
[    2.920621] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /spi/multiplexer/i2c@22/vidbmvcr@41/ports/port@0/endpoint
[    2.920639] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: parsing node /host1x/nvcsi@150c0000/channel@2
[    2.920641] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@2/ports/port@0/endpoint@4
[    2.920668] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@2/ports/port@1/endpoint@5
[    2.920687] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /spi/multiplexer/i2c@22/vidbmvcr@41/ports/port@1/endpoint
[    2.920705] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@3/ports/port@1/endpoint@7
[    2.920725] tegra-vi4 15700000.vi: tegra_vi_graph_init: handling endpoint /host1x/vi@15700000/ports/port@4/endpoint
[    2.920745] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: parsing node /host1x/nvcsi@150c0000/channel@4
[    2.920748] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@4/ports/port@0/endpoint@8
[    2.920779] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: parsing node /spi/multiplexer/i2c@11/vidcmvcr@41
[    2.920786] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /spi/multiplexer/i2c@11/vidcmvcr@41/ports/port@0/endpoint
[    2.920806] tegra-vi4 15700000.vi: tegra_vi_graph_parse_one: handling endpoint /host1x/nvcsi@150c0000/channel@4/ports/port@1/endpoint@9
[    2.920825] tegra-vi4 15700000.vi: tegra_vi_graph_notify_bound: subdev 150c0000.nvcsi-4 bound
[    2.920829] tegra-vi4 15700000.vi: tegra_vi_graph_notify_bound: subdev mvcrcam 9-0041 bound
[    2.920831] tegra-vi4 15700000.vi: tegra_vi_graph_notify_complete: notify complete, all subdevs registered
[    2.920832] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: creating links for entity 150c0000.nvcsi-4
[    2.920834] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: processing endpoint /host1x/nvcsi@150c0000/channel@4/ports/port@0/endpoint@8
[    2.920862] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: skipping sink port /host1x/nvcsi@150c0000/channel@4:0
[    2.920865] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: processing endpoint /host1x/nvcsi@150c0000/channel@4/ports/port@1/endpoint@9
[    2.920883] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: skipping channel port /host1x/nvcsi@150c0000/channel@4:1
[    2.920885] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: creating links for entity mvcrcam 9-0041
[    2.920889] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: processing endpoint /spi/multiplexer/i2c@11/vidcmvcr@41/ports/port@0/endpoint
[    2.920907] tegra-vi4 15700000.vi: tegra_vi_graph_build_one: creating mvcrcam 9-0041:0 -> 150c0000.nvcsi-4:0 link
[    2.920909] tegra-vi4 15700000.vi: tegra_vi_graph_build_links: creating links for channels
[    2.920911] tegra-vi4 15700000.vi: tegra_vi_graph_build_links: processing endpoint /host1x/vi@15700000/ports/port@4/endpoint
[    2.920928] tegra-vi4 15700000.vi: tegra_vi_graph_build_links: creating link for channel 15700000.vi-output-4
[    2.920931] tegra-vi4 15700000.vi: tegra_vi_graph_build_links: creating 150c0000.nvcsi-4:1 -> (null):0 link

Looking at the debug prints, i think the reason that the VIDA/VIDB second port capture devices aren’t created anymore is as follows:
When the new 28.2.1 device tree parsing code builds the graph by traversing over the vi@15700000 ports, it looks at the parent nodes and binds all endpoints it can find from there. Everything bound gets removed from the subdevice list, also when no actual capture device had been created from tegra_vi_graph_notify_complete(). When in our case it parses over port@0 and port@1, which are related via the same VIDA management subdevice mvcrcam 11-0041, and it arrives at /host1x/vi@15700000/ports/port@1, it finds the same VIDA endpoints it found before for port@0, and as subdevice 150c0000.nvcsi-1 had already been bound / removed before when handling port@0, the capture device isn’t created for port@1.

I see that if we changed our topology to use 5 instead of 3 I2C management devices and adjust the device tree accordingly, the capture devices would also be created with 28.2.1, but we would like it better if we could stick to it.
Can you suggest to me how the device tree would have to be changed to also work with 28.2.1, or would you say that our topology isn’t supported anymore by 28.2.1 and it has to be changed?

Regards,
Goran