Commit 1e7ccdd3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull media fixes from Mauro Carvalho Chehab:

 - fixes for the new ipu6 driver (and related fixes to mei csi driver)

 - fix a double debugfs remove logic at mgb4 driver

 - a documentation fix

* tag 'media/v6.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  media: intel/ipu6: add csi2 port sanity check in notifier bound
  media: intel/ipu6: update the maximum supported csi2 port number to 6
  media: mei: csi: Warn less verbosely of a missing device fwnode
  media: mei: csi: Put the IPU device reference
  media: intel/ipu6: fix the buffer flags caused by wrong parentheses
  media: intel/ipu6: Fix an error handling path in isys_probe()
  media: intel/ipu6: Move isys_remove() close to isys_probe()
  media: intel/ipu6: Fix some redundant resources freeing in ipu6_pci_remove()
  media: Documentation: v4l: Fix ACTIVE route flag
  media: mgb4: Fix double debugfs remove
parents 36714d69 ffb9072b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -582,7 +582,7 @@ depending on the hardware. In all cases, however, only routes that have the
Devices generating the streams may allow enabling and disabling some of the
routes or have a fixed routing configuration. If the routes can be disabled, not
declaring the routes (or declaring them without
``VIDIOC_SUBDEV_STREAM_FL_ACTIVE`` flag set) in ``VIDIOC_SUBDEV_S_ROUTING`` will
``V4L2_SUBDEV_STREAM_FL_ACTIVE`` flag set) in ``VIDIOC_SUBDEV_S_ROUTING`` will
disable the routes. ``VIDIOC_SUBDEV_S_ROUTING`` will still return such routes
back to the user in the routes array, with the ``V4L2_SUBDEV_STREAM_FL_ACTIVE``
flag unset.
+3 −3
Original line number Diff line number Diff line
@@ -301,10 +301,10 @@ static int ipu6_isys_stream_start(struct ipu6_isys_video *av,
out_requeue:
	if (bl && bl->nbufs)
		ipu6_isys_buffer_list_queue(bl,
					    (IPU6_ISYS_BUFFER_LIST_FL_INCOMING |
					     error) ?
					    IPU6_ISYS_BUFFER_LIST_FL_INCOMING |
					    (error ?
					    IPU6_ISYS_BUFFER_LIST_FL_SET_STATE :
					    0, error ? VB2_BUF_STATE_ERROR :
					     0), error ? VB2_BUF_STATE_ERROR :
					    VB2_BUF_STATE_QUEUED);
	flush_firmware_streamon_fail(stream);

+43 −28
Original line number Diff line number Diff line
@@ -678,6 +678,12 @@ static int isys_notifier_bound(struct v4l2_async_notifier *notifier,
		container_of(asc, struct sensor_async_sd, asc);
	int ret;

	if (s_asd->csi2.port >= isys->pdata->ipdata->csi2.nports) {
		dev_err(&isys->adev->auxdev.dev, "invalid csi2 port %u\n",
			s_asd->csi2.port);
		return -EINVAL;
	}

	ret = ipu_bridge_instantiate_vcm(sd->dev);
	if (ret) {
		dev_err(&isys->adev->auxdev.dev, "instantiate vcm failed\n");
@@ -925,39 +931,18 @@ static const struct dev_pm_ops isys_pm_ops = {
	.resume = isys_resume,
};

static void isys_remove(struct auxiliary_device *auxdev)
static void free_fw_msg_bufs(struct ipu6_isys *isys)
{
	struct ipu6_bus_device *adev = auxdev_to_adev(auxdev);
	struct ipu6_isys *isys = dev_get_drvdata(&auxdev->dev);
	struct ipu6_device *isp = adev->isp;
	struct device *dev = &isys->adev->auxdev.dev;
	struct isys_fw_msgs *fwmsg, *safe;
	unsigned int i;

	list_for_each_entry_safe(fwmsg, safe, &isys->framebuflist, head)
		dma_free_attrs(&auxdev->dev, sizeof(struct isys_fw_msgs),
			       fwmsg, fwmsg->dma_addr, 0);
		dma_free_attrs(dev, sizeof(struct isys_fw_msgs), fwmsg,
			       fwmsg->dma_addr, 0);

	list_for_each_entry_safe(fwmsg, safe, &isys->framebuflist_fw, head)
		dma_free_attrs(&auxdev->dev, sizeof(struct isys_fw_msgs),
			       fwmsg, fwmsg->dma_addr, 0);

	isys_unregister_devices(isys);
	isys_notifier_cleanup(isys);

	cpu_latency_qos_remove_request(&isys->pm_qos);

	if (!isp->secure_mode) {
		ipu6_cpd_free_pkg_dir(adev);
		ipu6_buttress_unmap_fw_image(adev, &adev->fw_sgt);
		release_firmware(adev->fw);
	}

	for (i = 0; i < IPU6_ISYS_MAX_STREAMS; i++)
		mutex_destroy(&isys->streams[i].mutex);

	isys_iwake_watermark_cleanup(isys);
	mutex_destroy(&isys->stream_mutex);
	mutex_destroy(&isys->mutex);
		dma_free_attrs(dev, sizeof(struct isys_fw_msgs), fwmsg,
			       fwmsg->dma_addr, 0);
}

static int alloc_fw_msg_bufs(struct ipu6_isys *isys, int amount)
@@ -1140,12 +1125,14 @@ static int isys_probe(struct auxiliary_device *auxdev,

	ret = isys_register_devices(isys);
	if (ret)
		goto out_remove_pkg_dir_shared_buffer;
		goto free_fw_msg_bufs;

	ipu6_mmu_hw_cleanup(adev->mmu);

	return 0;

free_fw_msg_bufs:
	free_fw_msg_bufs(isys);
out_remove_pkg_dir_shared_buffer:
	if (!isp->secure_mode)
		ipu6_cpd_free_pkg_dir(adev);
@@ -1167,6 +1154,34 @@ static int isys_probe(struct auxiliary_device *auxdev,
	return ret;
}

static void isys_remove(struct auxiliary_device *auxdev)
{
	struct ipu6_bus_device *adev = auxdev_to_adev(auxdev);
	struct ipu6_isys *isys = dev_get_drvdata(&auxdev->dev);
	struct ipu6_device *isp = adev->isp;
	unsigned int i;

	free_fw_msg_bufs(isys);

	isys_unregister_devices(isys);
	isys_notifier_cleanup(isys);

	cpu_latency_qos_remove_request(&isys->pm_qos);

	if (!isp->secure_mode) {
		ipu6_cpd_free_pkg_dir(adev);
		ipu6_buttress_unmap_fw_image(adev, &adev->fw_sgt);
		release_firmware(adev->fw);
	}

	for (i = 0; i < IPU6_ISYS_MAX_STREAMS; i++)
		mutex_destroy(&isys->streams[i].mutex);

	isys_iwake_watermark_cleanup(isys);
	mutex_destroy(&isys->stream_mutex);
	mutex_destroy(&isys->mutex);
}

struct fwmsg {
	int type;
	char *msg;
+1 −4
Original line number Diff line number Diff line
@@ -285,7 +285,7 @@ EXPORT_SYMBOL_NS_GPL(ipu6_configure_spc, INTEL_IPU6);
#define IPU6_ISYS_CSI2_NPORTS		4
#define IPU6SE_ISYS_CSI2_NPORTS		4
#define IPU6_TGL_ISYS_CSI2_NPORTS	8
#define IPU6EP_MTL_ISYS_CSI2_NPORTS	4
#define IPU6EP_MTL_ISYS_CSI2_NPORTS	6

static void ipu6_internal_pdata_init(struct ipu6_device *isp)
{
@@ -727,9 +727,6 @@ static void ipu6_pci_remove(struct pci_dev *pdev)
	pm_runtime_forbid(&pdev->dev);
	pm_runtime_get_noresume(&pdev->dev);

	pci_release_regions(pdev);
	pci_disable_device(pdev);

	release_firmware(isp->cpd_fw);

	ipu6_mmu_cleanup(psys_mmu);
+4 −1
Original line number Diff line number Diff line
@@ -677,10 +677,13 @@ static int mei_csi_probe(struct mei_cl_device *cldev,
		return -ENODEV;

	ret = ipu_bridge_init(&ipu->dev, ipu_bridge_parse_ssdb);
	put_device(&ipu->dev);
	if (ret < 0)
		return ret;
	if (WARN_ON(!dev_fwnode(dev)))
	if (!dev_fwnode(dev)) {
		dev_err(dev, "mei-csi probed without device fwnode!\n");
		return -ENXIO;
	}

	csi = devm_kzalloc(dev, sizeof(struct mei_csi), GFP_KERNEL);
	if (!csi)
Loading