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: <1411630089.8568.7.camel@AMDC1943>
Date:	Thu, 25 Sep 2014 09:28:09 +0200
From:	Krzysztof Kozlowski <k.kozlowski@...sung.com>
To:	Pavel Machek <pavel@....cz>
Cc:	Russell King <linux@....linux.org.uk>,
	Dan Williams <dan.j.williams@...el.com>,
	Vinod Koul <vinod.koul@...el.com>,
	linux-kernel@...r.kernel.org, dmaengine@...r.kernel.org,
	Ulf Hansson <ulf.hansson@...aro.org>,
	Grant Likely <grant.likely@...aro.org>,
	Lars-Peter Clausen <lars@...afoo.de>,
	Michal Simek <michal.simek@...inx.com>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Len Brown <len.brown@...el.com>,
	Randy Dunlap <rdunlap@...radead.org>,
	Alan Stern <stern@...land.harvard.edu>,
	linux-doc@...r.kernel.org, linux-pm@...r.kernel.org,
	Kyungmin Park <kyungmin.park@...sung.com>,
	Marek Szyprowski <m.szyprowski@...sung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Subject: Re: [PATCH v7 1/5] PM / Runtime: Add getter for quering the IRQ safe
 option

On śro, 2014-09-24 at 19:53 +0200, Pavel Machek wrote:
> On Wed 2014-09-24 15:50:08, Krzysztof Kozlowski wrote:
> > Add a simple getter pm_runtime_is_irq_safe() for quering whether runtime
> > PM IRQ safe was set or not.
> > 
> > Various bus drivers implementing runtime PM may use choose to suspend
> > differently based on IRQ safeness status of child driver (e.g. do not
> > unprepare the clock if IRQ safe is not set).
> > 
> > Signed-off-by: Krzysztof Kozlowski <k.kozlowski@...sung.com>
> > Reviewed-by: Ulf Hansson <ulf.hansson@...aro.org>
> 
> Are you sure this is good interface?
> 
> "Tell me if another function works this or that way".
> 
> That's certainly not traditional interface, and it seems dangerous to
> me. Callbacks now have different semantic requirements based on value
> of some flag...

Yes... but to me that semantic change looks similar to the PM runtime
code which behaves differently when the flag is set. Some PM runtime
functions might sleep or might not... depending on the flag.

> Would it be possible to have two sets of callbacks, one irq safe and
> one not?

That would require changing the callbacks during probe of each driver.
It is possible - I'm fine with that. However we still would need some
kind of interface for selecting the callbacks according to irq safe
status - something like pm_runtime_is_irq_safe():

static int amba_probe(struct device *dev)
{
...
	if (pm_runtime_is_irq_safe())
		dev->driver->pm = &amba_pm_irq_safe;
	else
		dev->driver->pm = &amba_pm;

Best regards,
Krzysztof


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