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]
Date:	Mon, 12 May 2014 15:20:07 -0700
From:	Tony Lindgren <tony@...mide.com>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	Kishon Vijay Abraham I <kishon@...com>,
	Felipe Balbi <balbi@...com>
Subject: Re: [PATCH] bus/omap_l3: avoid sync initcall for modules

* Arnd Bergmann <arnd@...db.de> [140508 07:57]:
> The postcore_initcall_sync() macro is only defined for built-in
> code, but the omap_l3 bus code can be built as a module, which
> currently causes a build failure.
> 
> This works around the problem by using #ifdef MODULE to decide
> whether to use a regular module_init() function or not.
> 
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> Cc: Tony Lindgren <tony@...mide.com>
> Cc: Kishon Vijay Abraham I <kishon@...com>
> Cc: Felipe Balbi <balbi@...com>
> ---
>  drivers/bus/omap_l3_noc.c | 4 ++++
>  drivers/bus/omap_l3_smx.c | 4 ++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c
> index feeecae..648f158 100644
> --- a/drivers/bus/omap_l3_noc.c
> +++ b/drivers/bus/omap_l3_noc.c
> @@ -257,7 +257,11 @@ static int __init omap4_l3_init(void)
>  {
>  	return platform_driver_register(&omap4_l3_driver);
>  }
> +#ifdef MODULE
> +module_init(omap4_l3_init);
> +#else
>  postcore_initcall_sync(omap4_l3_init);
> +#endif
>  
>  static void __exit omap4_l3_exit(void)
>  {
> diff --git a/drivers/bus/omap_l3_smx.c b/drivers/bus/omap_l3_smx.c
> index acc2164..f752d1b 100644
> --- a/drivers/bus/omap_l3_smx.c
> +++ b/drivers/bus/omap_l3_smx.c
> @@ -288,7 +288,11 @@ static int __init omap3_l3_init(void)
>  {
>  	return platform_driver_probe(&omap3_l3_driver, omap3_l3_probe);
>  }
> +#ifdef MODULE
> +module_init(omap3_l3_init);
> +#else
>  postcore_initcall_sync(omap3_l3_init);
> +#endif
>  
>  static void __exit omap3_l3_exit(void)
>  {

How about instead let's add this into include/linux/module.h
like we have for other initcalls:

#define postcore_initcall(fn)		module_init(fn)

There may be others missing too from there. BTW, this driver
might be few of the drivers that actually might need to be
initialized early for debugging to catch bad access from
other drivers.

Regards,

Tony
--
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