From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753346AbbLaOqQ (ORCPT ); Thu, 31 Dec 2015 09:46:16 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:58451 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752030AbbLaOqN (ORCPT ); Thu, 31 Dec 2015 09:46:13 -0500 From: Arnd Bergmann To: James Liao Cc: devicetree@vger.kernel.org, srv_heupstream@mediatek.com, Kevin Hilman , linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Sascha Hauer , Matthias Brugger , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/4] soc: mediatek: Init MT8173 scpsys driver earlier Date: Thu, 31 Dec 2015 15:45:22 +0100 Message-ID: <4141203.8f3N9nOLLy@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1451553394.10610.14.camel@mtksdaap41> References: <1451457706-14798-1-git-send-email-jamesjj.liao@mediatek.com> <1451541566.10610.10.camel@mtksdaap41> <1451553394.10610.14.camel@mtksdaap41> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:4765ksDInuOKQdhGG503jGIjFmQVnCW/yO4MNx1SMq09lrJej6N YENyWAwKssE9mNMQarniRzMr/7kXrhxMALk8Y4IuZdF7baWzk/25ih7zuuFd21tYXiNNNbH AmcR1su1xoxUFQ8o6JGyoPwsfzDb3jD0mCAXQuKwaTu7JIDyEuU1qygYesmZepEQrdYXjgi aYcLqX9njBke5qz5R5ciA== X-UI-Out-Filterresults: notjunk:1;V01:K0:kQMWkHKcHG0=:31mULRrUKuar4zxEDYFqQE N9wcjpY48Lx3yWsuSdW6t4U2vBrXvg/0Xlm6NayJVyGSyw/1w+rf2aGKSXzzkxcGl8TwVOXwy xDjK5n+q9vhOa+4xeWwnaPgSNOHh/adbxzSmzGyzF/CrT8SA+SN659Wk/9rpezgi6mcSixI1Y pssQpYlB9hZsZDJXOl+AlRdzk1IDE08Hy2v69BDBloijVUg2l2BfwHpjckHEr6/ypl+TzJAgS NfReqFTQ21W7kzVKZ7BiEyVPihGnoMlELHuAZ9OnarAyWZcDHLm4uRFOKReLIoCk04WOihYaB YMVC/SMVQKCyBmM7l1aCWEPbsTzRt3fyHbdIiRKrx2xcWFla2n2wxb8xRoSIkFcgEDGd4VxtM sviMGPIXRnPcXRB8a8DmVi6S0aSxNKf9VrOENGe8l4zeGXWCNSlbe/sZTXtUGFvsIqN6yQqRN HFrdlFnQYwz6G/k+v/IvtCpUEge/SyUrpDne1VhVh7/GLYSPhjYDAQHj8Yq48aU2yrbuwpBft kVZqmMiU7kwQFEdYaEo5UNz6Aa8yyy+5sHNcvTTDD+tr4la2Eg4qp0C3ja4JfnpQDMCrfPqy+ t4G9rZsGR2LpstbDc8XLN39PyOfMRKdpRTE7NDMvNXQsuP1kvxDPd65FbfmBeqhjKWy47dor4 XJ+D39IOmKAYV6GcayBZ1glY0BlLDtGGbovNjlQ+3N9uyqkp9t/lrEJ38r7jJSaUEYZG8v3MB SynE2+vrmjod2bDi Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 31 December 2015 17:16:34 James Liao wrote: > > """ > Take a example for our IOMMU(M4U) and SMI. The IOMMU which is > subsys_init defaultly will depend on SMI. > The SMI is a bridge between m4u and the Multimedia HW. About the HW > block diagram and more other information please help check [1]. > SMI is responsible to enable/disable iommu and help transfer data for > each Multimedia HW, Both have to wait until the power and the clocks is > enabled. > > So our iommu should probe done after smi, smi should be after > power-domain, and all the iommu consumer(display/vdec/venc/camera etc.) > should be after the iommu. > Then all the multimedia module will be delayed by power-domain who is > module_init currently. > > After grep, we get some example whose pm is not module_init: > core_initcall(exynos4_pm_init_power_domain); > subsys_initcall(imx_pgc_init); > > So we expect move the power-domain initial more earlier too. The > power-domain seems to be a basic module like ccf. > Is there some special reason about we should use module_init, or do you > have any concern if we change it? > Thanks. Ok, got it. Generally, we should try to avoid using the earlier initcall levels, but a few things like clock controllers, iommus etc are special enough that we need to make sure their dependencies are there by the time those are probed. Please put your explanation above into the patch changelog and add a code comment about the IOMMU next to the subsys_initcall() so it doesn't accidentally get changed when someone tries to do a code cleanup. Arnd