lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1305603818.28926.82.camel@vkoul-udesk3>
Date:	Tue, 17 May 2011 09:13:38 +0530
From:	"Koul, Vinod" <vinod.koul@...el.com>
To:	viresh kumar <viresh.kumar@...com>
Cc:	"Williams, Dan J" <dan.j.williams@...el.com>,
	"linus.walleij@...aro.org" <linus.walleij@...aro.org>,
	Armando VISCONTI <armando.visconti@...com>,
	Shiraz HASHIM <shiraz.hashim@...com>,
	"viresh.linux@...il.com" <viresh.linux@...il.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] dw_dmac: Replace subsys_init() with arch_initcall()

On Tue, 2011-05-17 at 09:36 +0530, viresh kumar wrote:
> On 05/16/2011 09:36 PM, Koul, Vinod wrote:
> > On Mon, 2011-05-16 at 10:20 +0530, Viresh Kumar wrote:
> >> In some cases users of dw_dmac, amba-pl022, are initialized before dw_dmac, and
> >> if they try to use dw_dmac, they simply fail. So its better we register init()
> >> routine of driver using arch_initcall() instead of subsys_init(), so that dma
> >> driver is available at the earliest possible.
> >>
> >> Signed-off-by: Viresh Kumar <viresh.kumar@...com>
> >> ---
> >>  drivers/dma/dw_dmac.c |    2 +-
> >>  1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
> >> index 54d72a8..4b580e7 100644
> >> --- a/drivers/dma/dw_dmac.c
> >> +++ b/drivers/dma/dw_dmac.c
> >> @@ -1566,7 +1566,7 @@ static int __init dw_init(void)
> >>  {
> >>  	return platform_driver_probe(&dw_driver, dw_probe);
> >>  }
> >> -subsys_initcall(dw_init);
> >> +arch_initcall(dw_init);
> > arch_init is usually kept for subystem initialization.
> > Why cant you move the amba-pl022 init to module_init, that should take
> > care of this.
> > 
> 
> Actually, amba-pl022 init was moved to subsys_initcall earlier with
> following patch:
> 
> And so i moved dma's init to arch_initcall. Also the similar approach is
> taken by drivers/dma/ste_dma40.c
> 
> Also, maybe it makes more sense for dma to be up at the earliest.
> Isn't it?

As I said before arch init is supposed to used for initialization of the
subsystems not for a driver init.
You need to ensure that with given init levels and makefile order your
dependencies are properly resolved, rather than this approach.

Like move whatever dependent on amba to late_init and amba to module
init, that would be advisable approach rather than above.


HTH
-- 
~Vinod

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ