mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Pavel Machek <pavel@ucw.cz>,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Vinod Koul <vinod.koul@intel.com>,
	linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Grant Likely <grant.likely@linaro.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Michal Simek <michal.simek@xilinx.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	linux-doc@vger.kernel.org, linux-pm@vger.kernel.org,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: Re: [PATCH v7 1/5] PM / Runtime: Add getter for quering the IRQ safe option
Date: Wed, 24 Sep 2014 20:52:22 +0100	[thread overview]
Message-ID: <20140924195222.GB5182@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1409241544070.1580-100000@iolanthe.rowland.org>

On Wed, Sep 24, 2014 at 03:47:17PM -0400, Alan Stern wrote:
> On Wed, 24 Sep 2014, 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@samsung.com>
> > > Reviewed-by: Ulf Hansson <ulf.hansson@linaro.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...
> > 
> > Would it be possible to have two sets of callbacks, one irq safe and
> > one not?
> 
> Or maybe add a flag to the bus-specific device structures, indicating
> specifically whether or not the clock should be unprepared during a
> runtime suspend.  Then individual drivers could set this flag or not, 
> independent of the irq-safe setting.

What you're proposing is _less_ safe, because with your proposal, you
now have the possibility that drivers will tell runtime PM that it has
IRQ safe callbacks, but the bus code tries to prepare/unprepare the
clock, which causes a might-sleep-if warning.

This is fragile.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

  reply	other threads:[~2014-09-24 19:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-24 13:50 [PATCH v7 0/5] amba/dma: pl330: add Power Management support Krzysztof Kozlowski
2014-09-24 13:50 ` [PATCH v7 1/5] PM / Runtime: Add getter for quering the IRQ safe option Krzysztof Kozlowski
2014-09-24 17:53   ` Pavel Machek
2014-09-24 19:47     ` Alan Stern
2014-09-24 19:52       ` Russell King - ARM Linux [this message]
2014-09-25  7:57         ` Ulf Hansson
2014-09-25  7:28     ` Krzysztof Kozlowski
2014-09-24 13:50 ` [PATCH v7 2/5] amba: Add helpers for (un)preparing AMBA clock Krzysztof Kozlowski
2014-09-24 13:50 ` [PATCH v7 3/5] amba: Don't unprepare the clocks if device driver wants IRQ safe runtime PM Krzysztof Kozlowski
2014-10-15  7:27   ` Ulf Hansson
2014-09-24 13:50 ` [PATCH v7 4/5] dma: pl330: add Power Management support Krzysztof Kozlowski
2014-10-15  7:19   ` Ulf Hansson
2014-10-15  8:09     ` Krzysztof Kozlowski
2014-09-24 13:50 ` [PATCH v7 5/5] amba: Remove unused amba_pclk_enable/disable macros Krzysztof Kozlowski
2014-10-15  7:21   ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140924195222.GB5182@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=b.zolnierkie@samsung.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=k.kozlowski@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=lars@metafoo.de \
    --cc=len.brown@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=michal.simek@xilinx.com \
    --cc=pavel@ucw.cz \
    --cc=rdunlap@infradead.org \
    --cc=rjw@rjwysocki.net \
    --cc=stern@rowland.harvard.edu \
    --cc=ulf.hansson@linaro.org \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®