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:	Wed, 06 May 2015 11:24:58 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	linux-arm-kernel@...ts.infradead.org
Cc:	Gabriel Fernandez <gabriel.fernandez@...aro.org>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Mark Rutland <mark.rutland@....com>,
	Andrew Lunn <andrew@...n.ch>,
	"kernel@...inux.com" <kernel@...inux.com>,
	Viresh Kumar <viresh.kumar@...aro.org>,
	Liviu Dudau <liviu.dudau@....com>,
	Sachin Kamat <sachin.kamat@...sung.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Tanmay Inamdar <tinamdar@....com>,
	Lee Jones <lee.jones@...aro.org>,
	Mauro Carvalho Chehab <mchehab@....samsung.com>,
	Phil Edworthy <phil.edworthy@...esas.com>,
	Russell King <linux@....linux.org.uk>,
	Pawel Moll <pawel.moll@....com>,
	Jingoo Han <jg1.han@...sung.com>,
	Kishon Vijay Abraham I <kishon@...com>,
	Muralidharan Karicheri <m-karicheri2@...com>,
	"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
	Thierry Reding <treding@...dia.com>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	Joe Perches <joe@...ches.com>,
	Rob Herring <robh+dt@...nel.org>,
	Fabrice Gasnier <fabrice.gasnier@...com>,
	Maxime Coquelin <maxime.coquelin@...com>,
	Srinivas Kandagatla <srinivas.kandagatla@...il.com>,
	Patrice Chotard <patrice.chotard@...com>,
	Gabriel FERNANDEZ <gabriel.fernandez@...com>,
	Minghuan Lian <Minghuan.Lian@...escale.com>,
	Greg KH <gregkh@...uxfoundation.org>,
	Tejun Heo <tj@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"David S. Miller" <davem@...emloft.net>,
	Lucas Stach <l.stach@...gutronix.de>
Subject: Re: [PATCH v3 3/5] PCI: st: Provide support for the sti PCIe controller

On Wednesday 06 May 2015 11:14:25 Gabriel Fernandez wrote:
> 
> >> +static int __init pcie_init(void)
> >> +{
> >> +     return platform_driver_probe(&st_pcie_driver, st_pcie_probe);
> >> +}
> >> +device_initcall(pcie_init);
> >
> > Can you use module_platform_driver_probe() or module_init() here?
> >
> 
> Yes we can use module_init() here.
> 
> By the way if figure out i removed __init attribute on st_pcie_probe()
> in previous version to follow Arnd's remark.
> But st_pcie_probe calls hook_fault_code() that has __init attribute.
> So I think we need to keep __init for probe routine ?
> Also, we have to restrict bind/unbind with "suppress_bind_attrs" in
> platform_driver structure.
> This is the main reason to not allow module unload/reload.
> 
> If you are ok i will send a v4 ?
> 

If you mark the probe function as __init, you have to use
module_platform_driver_probe() or platform_driver_probe() instead,
to prevent the probe function from being deferred.

Calling hook_fault_code() also means you need to prevent module
unloading, by providing only a module_init but not a module_exit
function, so module_platform_driver_probe() also won't work.

It may be a good idea to work on improving the hook_fault_code()
infrastructure to make it more usable with loadable device drivers.

	Arnd

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