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: <alpine.LFD.2.00.0908212308450.6044@xanadu.home>
Date:	Fri, 21 Aug 2009 23:23:00 -0400 (EDT)
From:	Nicolas Pitre <nico@....org>
To:	Marek Vasut <marek.vasut@...il.com>
Cc:	linux-arm-kernel@...ts.infradead.org, nicolas.ferre@...el.com,
	mirq-linux@...e.qmqm.pl, lkml <linux-kernel@...r.kernel.org>,
	manuel.lauss@...il.com, ppisa@...ron.com, maen@...vell.com,
	s.hauer@...gutronix.de, tony@...mide.com, madhu.cr@...com,
	drzeus@...eus.cx, ben-linux@...ff.org, avorontsov@...mvista.com,
	pierre@...man.eu, sdhci-devel@...ts.ossman.eu,
	saschasommer@...enet.de, oakad@...oo.com, ian@...menth.co.uk,
	HaraldWelte@...tech.com, JosephChan@....com.tw
Subject: Re: [PATCH] Convert MMC subsys drivers to dev_pm_ops

On Sat, 22 Aug 2009, Marek Vasut wrote:

> Dne So 22. srpna 2009 04:44:00 Nicolas Pitre napsal(a):
> > On Sat, 22 Aug 2009, Marek Vasut wrote:
> > > Hi,
> > >
> > > This converts most of the drivers found in drivers/mmc/host to
> > > dev_pm_ops. Also, it contains some fixes for the probe/remove functions
> > > in some cases.
> >
> > Are you sure you're actually fixing things?
> >
> > You replaced platform_driver_probe() calls with
> > platform_driver_register() calls, and made the probe functions __devinit
> > instead of __init.  Especially when the platform device is unlikely to
> > go away or new ones to ever appear, there is no point keeping the
> > probe code around after it is done.
> 
> Yeah, the __devinit should actually remove the init function when done ... to 
> my understanding. Sorry in case I'm wrong.

No it cannot, because there is normally no way if it is really done as 
new device, like on a USB bus, may appear later and bind to the same 
driver.  So __devinit will actually discard the code only if hotplug is 
disabled in the kernel config (see include/linux/init.h and 
include/asm-generic/vmlinux.lds.h).

Quoting drivers/base/platform.c:

 * platform_driver_probe - register driver for non-hotpluggable device
 * @drv: platform driver structure
 * @probe: the driver probe routine, probably from an __init section
 *
 * Use this instead of platform_driver_register() when you know the device
 * is not hotpluggable and has already been registered, and you want to
 * remove its run-once probe() infrastructure from memory after the driver
 * has bound to the device.
 *
 * One typical use for this would be with drivers for controllers integrated
 * into system-on-chip processors, where the controller devices have been
 * configured as part of board setup.


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