Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1582516

Re: [PATCH v4 20/36] media: imx: Add CSI subdev driver

From Russell King - ARM Linux <linux@armlinux.org.uk>
Newsgroups linux.kernel
Subject Re: [PATCH v4 20/36] media: imx: Add CSI subdev driver
Date 2017-02-16 13:00 +0100
Message-ID <tbsT8-5Hw-7@gated-at.bofh.it> (permalink)
References <tbjZv-8cO-3@gated-at.bofh.it> <tbjZv-8cO-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Feb 15, 2017 at 06:19:22PM -0800, Steve Longerbeam wrote:
> +static const struct platform_device_id imx_csi_ids[] = {
> +	{ .name = "imx-ipuv3-csi" },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(platform, imx_csi_ids);
> +
> +static struct platform_driver imx_csi_driver = {
> +	.probe = imx_csi_probe,
> +	.remove = imx_csi_remove,
> +	.id_table = imx_csi_ids,
> +	.driver = {
> +		.name = "imx-ipuv3-csi",
> +	},
> +};
> +module_platform_driver(imx_csi_driver);
> +
> +MODULE_DESCRIPTION("i.MX CSI subdev driver");
> +MODULE_AUTHOR("Steve Longerbeam <steve_longerbeam@mentor.com>");
> +MODULE_LICENSE("GPL");
> +MODULE_ALIAS("platform:imx-ipuv3-csi");

Just a reminder that automatic module loading of this is completely
broken right now (not your problem) due to this stupid idea in the
IPUv3 code:

		if (!ret)
			ret = platform_device_add(pdev);
		if (ret) {
			platform_device_put(pdev);
			goto err_register;
		}

		/*
		 * Set of_node only after calling platform_device_add. Otherwise
		 * the platform:imx-ipuv3-crtc modalias won't be used.
		 */
		pdev->dev.of_node = of_node;

setting pdev->dev.of_node changes the modalias exported to userspace,
so udev sees a DT based modalias, which causes it to totally miss any
driver using a non-DT based modalias.

The IPUv3 code needs fixing, not only for imx-media-csi, but also for
imx-ipuv3-crtc too, because that module will also suffer the same
issue.

The only solution is... don't fsck with dev->of_node assignment.  In
this case, it's probably much better to pass it in via platform data.
If you then absolutely must have dev->of_node, doing it in the driver
means that you avoid the modalias mess before the appropriate driver
is loaded.  However, that's still not a nice solution because the
modalias file still ends up randomly changing its contents.

As I say, not _your_ problem, but it's still a problem that needs
solving, and I don't want it forgotten about.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 20/36] media: imx: Add CSI subdev driver Steve Longerbeam <slongerbeam@gmail.com> - 2017-02-16 03:30 +0100
  Re: [PATCH v4 20/36] media: imx: Add CSI subdev driver Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-02-16 13:00 +0100
    Re: [PATCH v4 20/36] media: imx: Add CSI subdev driver Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-02-16 13:50 +0100
      Re: [PATCH v4 20/36] media: imx: Add CSI subdev driver Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-02-16 14:20 +0100
        Re: [PATCH v4 20/36] media: imx: Add CSI subdev driver Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-02-16 15:30 +0100
          Re: [PATCH v4 20/36] media: imx: Add CSI subdev driver Steve Longerbeam <slongerbeam@gmail.com> - 2017-02-16 20:10 +0100
      Re: [PATCH v4 20/36] media: imx: Add CSI subdev driver Steve Longerbeam <slongerbeam@gmail.com> - 2017-02-16 19:50 +0100
        Re: [PATCH v4 20/36] media: imx: Add CSI subdev driver Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-02-16 20:20 +0100

csiph-web