Linux-IIO Archive on lore.kernel.org
 help / color / Atom feed
From: David Lechner <david@lechnology.com>
To: Jonathan Cameron <jic23@kernel.org>, linux-omap@vger.kernel.org
Cc: linux-iio@vger.kernel.org, "Rob Herring" <robh+dt@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Benoît Cousson" <bcousson@baylibre.com>,
	"Tony Lindgren" <tony@atomide.com>,
	"William Breathitt Gray" <vilhelm.gray@gmail.com>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pwm@vger.kernel.org
Subject: Re: [PATCH v2 3/5] counter: new TI eQEP driver
Date: Sun, 11 Aug 2019 14:15:14 -0500
Message-ID: <aa307094-c205-4e68-b21f-73d27f9ee257@lechnology.com> (raw)
In-Reply-To: <20190811102345.1af5c23c@archlinux>

On 8/11/19 4:23 AM, Jonathan Cameron wrote:
> On Wed,  7 Aug 2019 14:40:21 -0500
> David Lechner <david@lechnology.com> wrote:
>> +
>> +	pm_runtime_enable(dev);
>> +	pm_runtime_get(dev);
> I'm a little confused on the flow here.
> 
> pm_runtime_enable turns on runtime pm in general.
> 
> pm_runtime_get basically calls runtime_resume to ensrue the
> device has power.
> 
>> +
>> +	return devm_counter_register(dev, &priv->counter);
> 
> This registers the userspace interfaces and exposes the device.
> 
>> +}
>> +
>> +static int ti_eqep_remove(struct platform_device *pdev)
>> +{
>> +	struct device *dev = &pdev->dev;
>> +
>> +	pm_runtime_put(dev),
>> +	pm_runtime_disable(dev);
> 
> pm_runtime_put notifies the system that the device is idle
> (and hence potentially turns it off).
> 
> Not good if the counter is still registered.
> 
> I'm assuming the presence of runtime pm at all is to interact
> with a parent driver and hence stop that turning off if this
> driver is probed?  That's probably fine, but add a few comments
> to make it clear that this driver itself doesn't really do
> runtime pm at all.
> 

To be honest, despite reading the runtime PM docs more than once,
I still don't feel like I have a good grasp on how it is supposed
to work. I just know that we get a crash if it is omitted because
the IP block is not powered on.

I will fix the ordering in _remove() and add a comment in v3.

  reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07 19:40 [PATCH v2 0/5] " David Lechner
2019-08-07 19:40 ` [PATCH v2 1/5] bus/ti-pwmss: move TI PWMSS driver from PWM to bus subsystem David Lechner
2019-08-07 19:40 ` [PATCH v2 2/5] dt-bindings: counter: new bindings for TI eQEP David Lechner
2019-08-21 20:31   ` Rob Herring
2019-08-07 19:40 ` [PATCH v2 3/5] counter: new TI eQEP driver David Lechner
2019-08-07 19:49   ` David Lechner
2019-08-11  9:23   ` Jonathan Cameron
2019-08-11 19:15     ` David Lechner [this message]
2019-08-15 12:37   ` William Breathitt Gray
2019-08-07 19:40 ` [PATCH v2 4/5] ARM: dts: am33xx: Add nodes for eQEP David Lechner
2019-08-07 19:40 ` [PATCH v2 5/5] ARM: dts: am335x-boneblue: Enable eQEP David Lechner

Reply instructions:

You may reply publically 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=aa307094-c205-4e68-b21f-73d27f9ee257@lechnology.com \
    --to=david@lechnology.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=tony@atomide.com \
    --cc=vilhelm.gray@gmail.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

Linux-IIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-iio/0 linux-iio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iio linux-iio/ https://lore.kernel.org/linux-iio \
		linux-iio@vger.kernel.org
	public-inbox-index linux-iio

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-iio


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git