What is the function of isomgr? When porting the camera driver, I encountered an issue with the failed registration of isomgr

Error message in the kernel log:

nx@nvidia:~$ dmesg | grep isomgr
[    1.476785] misc tegra_camera_ctrl: tegra_camera_isomgr_register isp_iso_bw=1500000, vi_iso_bw=12500000, max_bw=12500000
[    1.476797] misc tegra_camera_ctrl: tegra_camera_isomgr_register: unable to register to isomgr
[    1.476847] misc tegra_camera_ctrl: tegra_camera_probe: failed to register CAMERA as isomgr client

The code related to the device tree and the tegra-camera-platform driver is as follows:

static int tegra_camera_isomgr_register(struct tegra_camera_info *info,
					struct device *dev)
{
#if defined(CONFIG_TEGRA_ISOMGR)
	int ret = 0;
	u32 num_csi_lanes = 0;
	u32 max_lane_speed = 0;
	u32 bits_per_pixel = 0;
	u32 vi_bpp = 0;
	u64 vi_iso_bw = 0;
	u32 vi_margin_pct = 0;
	u32 max_pixel_rate = 0;
	u32 isp_bpp = 0;
	u64 isp_iso_bw = 0;
	u32 isp_margin_pct = 0;
	u32 tpg_max_iso = 0;
	struct device_node *np = dev->of_node;

	dev_dbg(info->dev, "%s++\n", __func__);

	ret |= of_property_read_u32(np, "num_csi_lanes", &num_csi_lanes);
	ret |= of_property_read_u32(np, "max_lane_speed", &max_lane_speed);
	ret |= of_property_read_u32(np, "min_bits_per_pixel", &bits_per_pixel);
	ret |= of_property_read_u32(np, "vi_peak_byte_per_pixel", &vi_bpp);
	ret |= of_property_read_u32(np, "vi_bw_margin_pct", &vi_margin_pct);
	ret |= of_property_read_u32(np, "max_pixel_rate", &max_pixel_rate);
	ret |= of_property_read_u32(np, "isp_peak_byte_per_pixel", &isp_bpp);
	ret |= of_property_read_u32(np, "isp_bw_margin_pct", &isp_margin_pct);

	if (ret)
		dev_info(info->dev, "%s: some fields not in DT.\n", __func__);

	/*
	 * Use per-camera specifics to calculate ISO BW needed,
	 * which is smaller than the per-asic max.
	 *
	 * The formula for VI ISO BW is based on total number
	 * of active csi lanes when all cameras on the camera
	 * board are active.
	 *
	 * The formula for ISP ISO BW is based on max number
	 * of ISP's used in ISO mode given number of camera(s)
	 * on the camera board and the number of ISP's on the ASIC.
	 *
	 * The final ISO BW is based on the max of the two.
	 */
	if (!bits_per_pixel) {
		dev_err(info->dev, "bits_per_pixel is invalid\n");
		return -EINVAL;
	}
	vi_iso_bw = ((num_csi_lanes * max_lane_speed) / bits_per_pixel)
				* vi_bpp * (100 + vi_margin_pct) / 100;
	isp_iso_bw = max_pixel_rate * isp_bpp * (100 + isp_margin_pct) / 100;
	if (vi_iso_bw > isp_iso_bw)
		info->max_bw = vi_iso_bw;
	else
		info->max_bw = isp_iso_bw;

	if (!info->max_bw) {
		dev_err(info->dev, "%s: BW must be non-zero\n", __func__);
		return -EINVAL;
	}

	ret = of_property_read_u32(np, "tpg_max_iso", &tpg_max_iso);
	if (ret)
		tpg_max_iso = 0;
	else {
		dev_info(info->dev, "%s tpg_max_iso = %uKBs\n", __func__,
				tpg_max_iso);
		info->max_bw = max_t(u64, info->max_bw, tpg_max_iso);
	}

	dev_info(info->dev, "%s isp_iso_bw=%llu, vi_iso_bw=%llu, max_bw=%llu\n",
				__func__, isp_iso_bw, vi_iso_bw, info->max_bw);

	/* Register with max possible BW for CAMERA usecases.*/
	info->isomgr_handle = tegra_isomgr_register(
					TEGRA_ISO_CLIENT_TEGRA_CAMERA,
					info->max_bw,
					NULL,	/* tegra_isomgr_renegotiate */
					NULL);	/* *priv */

	if (IS_ERR(info->isomgr_handle)) {
		dev_err(info->dev,
			"%s: unable to register to isomgr\n",
				__func__);
		return -ENOMEM;
	}
#endif

	return 0;
}

The related code for the device tree file is as follows:

		num_csi_lanes = <10>;	//lyh
		max_lane_speed = <5000000>;
		//max_lane_speed = <1500000>;
		min_bits_per_pixel = <10>;
		//min_bits_per_pixel = <8>;
		vi_peak_byte_per_pixel = <2>;
		vi_bw_margin_pct = <25>;
		max_pixel_rate = <240000>;
		isp_peak_byte_per_pixel = <5>;
		isp_bw_margin_pct = <25>;

hello liuyuhangpro,

it’s manager to reserve bandwidth for camera use-case.
this looks like camera register has failed. we may dig into complete probing process for the root cause.
please also sharing the complete kernel logs, such as… $ dmesg > klogs.txt

BTW,
you may see-also developer guide, Verifying the V4L2 Sensor Driver for troubleshooting.

klogs.txt (87.3 KB)
This is the complete kernel log. Please help me analyze the reasons for the registration failure.

is your camera device named mvfpga_v2?
also, will you see the same failure by reverting max_lane_speed for using default values?

The camera device name is mvfpga. If I change max_lane_speed to the default 1500000, the system fails to boot successfully. I will send the boot information after making the switch.

The printout information from booting the kernel with this set of parameters.
klogs_use_def_max_speed.log (46.3 KB)

		num_csi_lanes = <10>;	//lyh
		max_lane_speed = <1500000>;
		//max_lane_speed = <1500000>;
		min_bits_per_pixel = <10>;
		//min_bits_per_pixel = <8>;
		vi_peak_byte_per_pixel = <2>;
		vi_bw_margin_pct = <25>;
		max_pixel_rate = <240000>;
		isp_peak_byte_per_pixel = <5>;
		isp_bw_margin_pct = <25>;

it’s reporting NULL pointer failure.
could you please examine all those values within tegra_channel_fmts_bitmap_init.

Thank you for providing the insight. There is indeed an issue here.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.