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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110605185047.GB18731@legolas.emea.dhcp.ti.com>
Date:	Sun, 5 Jun 2011 21:50:49 +0300
From:	Felipe Balbi <balbi@...com>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	balbi@...com, Keshava Munegowda <keshava_mgowda@...com>,
	linux-usb@...r.kernel.org, linux-omap@...r.kernel.org,
	linux-kernel@...r.kernel.org, gadiyar@...com,
	sameo@...ux.intel.com, parthab@...ia.ti.com, tony@...mide.com,
	khilman@...com, b-cousson@...com, paul@...an.com
Subject: Re: [PATCH 4/4] mfd: global Suspend and resume support of ehci and
 ohci

Hi,

On Sun, Jun 05, 2011 at 07:19:38PM +0200, Rafael J. Wysocki wrote:
> > On Wed, Jun 01, 2011 at 03:54:38PM +0200, Rafael J. Wysocki wrote:
> > > > +static const struct dev_pm_ops usbhsomap_dev_pm_ops = {
> > > > +	.suspend	= usbhs_suspend,
> > > > +	.resume		= usbhs_resume,
> > > > +};
> > > 
> > > Please add .freeze()/.thaw() and .poweroff()/.restore() callbacks too.
> > > They may point to the same routines, but must be present.
> > > 
> > > You can actually use the SIMPLE_DEV_PM_OPS() convenience macro for this
> > > purpose.
> > 
> > good point. BTW, do we need this #ifdef CONFIG_PM stuff which has been
> > popping on most drivers recently ? To me it looks like driver.pm field
> > is always available even if PM is disabled, so what's the point ? Saving
> > a few bytes ?
> 
> Basically, yes (you may want to avoid defining the object this points to if
> CONFIG_PM is unset).

wouldn't it look nicer to have a specific section for dev_pm_ops which
gets automatically freed if CONFIG_PM isn't set ? I mean, there are a
few drivers which don't have the ifdeferry around dev_pm_ops anyway.

So, something like:

#define __pm_ops	__section(.pm.ops)

static const struct dev_pm_ops my_driver_pm_ops __pm_ops = {
	.suspend	= my_driver_suspend,
	.resume		= my_driver_resume,
	[ blablabla ]
};

to simplify things, you could:

#define DEFINE_DEV_PM_OPS(_ops)		\
	const struct dev_pm_ops _ops __pm_ops

that would mean changes to all linker scripts, though and a utility call
that only does anything ifndef CONFIG_PM to free the .pm.ops section.

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (491 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ