Linux IOMMU Development
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
To: Laurent Pinchart
	<laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
Cc: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	"linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Shaik Ameer Basha
	<shaik.ameer-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
	Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Inki Dae <inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Tomasz Figa <tomasz.figa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"linaro-mm-sig-cunTk1MwBs8s++Sfvej+rw@public.gmane.org"
	<linaro-mm-sig-cunTk1MwBs8s++Sfvej+rw@public.gmane.org>,
	"iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
	<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	Kukjin Kim <kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Kyungmin Park
	<kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Cho KyongHo <pullip.cho-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	David Wodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH v4 17/18] iommu: exynos: init from dt-specific callback instead of initcall
Date: Mon, 19 Jan 2015 11:33:31 +0000	[thread overview]
Message-ID: <20150119113331.GG32131@arm.com> (raw)
In-Reply-To: <10691050.Z5RGmE4fp0@avalon>

On Mon, Jan 19, 2015 at 01:11:07AM +0000, Laurent Pinchart wrote:
> On Friday 16 January 2015 10:13:11 Marek Szyprowski wrote:
> > This patch introduces IOMMU_OF_DECLARE-based initialization to the
> > driver, which replaces subsys_initcall-based procedure.
> > exynos_iommu_of_setup ensures that each sysmmu controller is probed
> > before its master device.

[...]

> > +static int __init exynos_iommu_of_setup(struct device_node *np)
> > +{
> > +	struct platform_device *pdev;
> > +
> > +	if (!init_done)
> > +		exynos_iommu_init();
> > +
> > +	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
> > +	if (IS_ERR(pdev))
> > +		return PTR_ERR(pdev);
> 
> This feels like a hack to me. What happens here is that you're using the 
> IOMMU_OF_DECLARE mechanism to make sure that the iommu platform device will be 
> created and registered before the normal OF bus populate mechanism kicks in, 
> thus ensuring that the iommu gets probed before other devices. In practice 
> this is pretty similar to using different init levels, which is what Will's 
> patch set was trying to avoid in the first place. Creating a new kind of init 
> levels mechanism doesn't sound very good to me.
> 
> The existing exynos-iommu driver is based on classic instantiation of a 
> platform device from DT, using the normal device probing mechanism. As such it 
> relies on the availability of a struct device for various helper functions. I 
> thus understand why you want a struct device being registered for the iommu, 
> instead of initializing the device right from the exynos_iommu_of_setup() 
> function without a corresponding struct device being registered.
> 
> This leads me to question whether we should really introduce IOMMU_OF_DECLARE. 
> Using regular deferred probing seems more and more like a better solution to 
> me.

We seem to be going round and round on this argument. I said before that
I'm not against changing this [1], but somebody would need to propose
patches, which hasn't happened in recent history.

Arnd also makes some good arguments against using probing [2], which would
need further discussion.

Basically, it looks like there are two sides to this argument and I don't
see anything changing without patch proposals. The only thing that the
current discussions seem to be achieving is blocking people like Marek,
who are trying to make use of what we have in mainline today!

Will

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-December/310783.html
[2] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-December/310992.html

  reply	other threads:[~2015-01-19 11:33 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-16  9:12 [PATCH v4 00/18] Exynos SYSMMU (IOMMU) integration with DT and DMA-mapping subsystem Marek Szyprowski
     [not found] ` <1421399592-7482-1-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-01-16  9:12   ` [PATCH v4 01/18] drm: exynos: detach from default dma-mapping domain on init Marek Szyprowski
2015-01-16  9:12   ` [PATCH v4 02/18] arm: exynos: pm_domains: add support for devices registered before arch_initcall Marek Szyprowski
2015-01-16  9:12   ` [PATCH v4 03/18] ARM: dts: exynos4: add sysmmu nodes Marek Szyprowski
2015-01-16  9:13   ` [PATCH v4 08/18] iommu: exynos: remove useless spinlock Marek Szyprowski
2015-01-16  9:13   ` [PATCH v4 10/18] iommu: exynos: remove unused functions, part 2 Marek Szyprowski
2015-01-16  9:13   ` [PATCH v4 11/18] iommu: exynos: remove useless device_add/remove callbacks Marek Szyprowski
2015-01-16  9:12 ` [PATCH v4 04/18] ARM: dts: exynos5250: add sysmmu nodes Marek Szyprowski
2015-01-16  9:12 ` [PATCH v4 05/18] ARM: dts: exynos5420: " Marek Szyprowski
2015-01-16  9:13 ` [PATCH v4 06/18] iommu: exynos: don't read version register on every tlb operation Marek Szyprowski
2015-01-16  9:13 ` [PATCH v4 07/18] iommu: exynos: remove unused functions Marek Szyprowski
2015-01-16  9:13 ` [PATCH v4 09/18] iommu: exynos: refactor function parameters to simplify code Marek Szyprowski
2015-01-16  9:13 ` [PATCH v4 12/18] iommu: exynos: add support for binding more than one sysmmu to master device Marek Szyprowski
2015-01-16  9:13 ` [PATCH v4 13/18] iommu: exynos: add support for runtime_pm Marek Szyprowski
2015-01-16  9:13 ` [PATCH v4 14/18] iommu: exynos: rename variables to reflect their purpose Marek Szyprowski
2015-01-16  9:13 ` [PATCH v4 15/18] iommu: exynos: document internal structures Marek Szyprowski
2015-01-16  9:13 ` [PATCH v4 16/18] iommu: exynos: remove excessive includes and sort others alphabetically Marek Szyprowski
2015-01-16  9:13 ` [PATCH v4 17/18] iommu: exynos: init from dt-specific callback instead of initcall Marek Szyprowski
2015-01-19  1:11   ` Laurent Pinchart
2015-01-19 11:33     ` Will Deacon [this message]
2015-01-20 13:41       ` Laurent Pinchart
2015-01-16  9:13 ` [PATCH v4 18/18] iommu: exynos: add callback for initializing devices from device tree Marek Szyprowski
     [not found]   ` <1421399592-7482-19-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-01-19 15:27     ` Javier Martinez Canillas
2015-01-23 12:40       ` Marek Szyprowski
2015-01-23 13:48         ` Javier Martinez Canillas
     [not found]           ` <CABxcv=nX22+1VcA038yyLJz7dUN-tk9-kWTpSB-FeyLxVeRmZA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-23 16:15             ` Marek Szyprowski
     [not found]               ` <54C273AF.1010404-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-01-23 16:44                 ` Javier Martinez Canillas
2015-01-21 23:37 ` [PATCH v4 00/18] Exynos SYSMMU (IOMMU) integration with DT and DMA-mapping subsystem Tobias Jakobi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150119113331.GG32131@arm.com \
    --to=will.deacon-5wv7dgnigg8@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
    --cc=linaro-mm-sig-cunTk1MwBs8s++Sfvej+rw@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pullip.cho-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=shaik.ameer-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=tomasz.figa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox