All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mohandass, Divagar" <divagar.mohandass@intel.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: "robh+dt@kernel.org" <robh+dt@kernel.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"wsa@the-dreams.de" <wsa@the-dreams.de>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Mani, Rajmohan" <rajmohan.mani@intel.com>
Subject: RE: [PATCH v3 3/3] eeprom: at24: enable runtime pm support
Date: Wed, 30 Aug 2017 17:04:21 +0000	[thread overview]
Message-ID: <7B8CE47BD58441468D2BB13285B50E6031DE62E9@BGSMSX107.gar.corp.intel.com> (raw)
In-Reply-To: <20170830124122.3oipo4ykpzmkzdy2@valkosipuli.retiisi.org.uk>

Hi Sakari,

Thanks for the review.
My comments below.

---
^Divagar

>-----Original Message-----
>From: Sakari Ailus [mailto:sakari.ailus@iki.fi]
>Sent: Wednesday, August 30, 2017 6:11 PM
>To: Mohandass, Divagar <divagar.mohandass@intel.com>
>Cc: robh+dt@kernel.org; mark.rutland@arm.com; wsa@the-dreams.de;
>devicetree@vger.kernel.org; linux-i2c@vger.kernel.org; linux-
>kernel@vger.kernel.org; Mani, Rajmohan <rajmohan.mani@intel.com>
>Subject: Re: [PATCH v3 3/3] eeprom: at24: enable runtime pm support
>
>On Wed, Aug 30, 2017 at 12:32:07PM +0000, Mohandass, Divagar wrote:
>> >> @@ -743,6 +770,15 @@ static int at24_probe(struct i2c_client
>> >> *client, const struct i2c_device_id *id)
>> >>
>> >>  	i2c_set_clientdata(client, at24);
>> >>
>> >> +	/* enable runtime pm */
>> >> +	pm_runtime_get_noresume(&client->dev);
>> >> +	err = pm_runtime_set_active(&client->dev);
>> >> +	if (err < 0)
>> >> +		goto err_clients;
>> >> +
>> >> +	pm_runtime_enable(&client->dev);
>> >> +	pm_runtime_put(&client->dev);
>> >> +
>> >
>> >You're just about to perform a read here. I believe you should move
>> >the last put after that.
>>
>> At the end of at24_read we are performing a pm_runtime_put, still we need
>this change ?
>
>True, so this isn't an actual problem.
>
>It'll still power the chip down when you're about to need it, so it'd make sense
>to perform the check before pm_runtime_put().
>
>I might move the runtime PM setup after the check altogether.

Ok, I will move the pm_runtime_put() after the check and publish the v4.
Moving the PM setup altogether below, will introduce more error handling in read call.

>
>--
>Sakari Ailus
>e-mail: sakari.ailus@iki.fi

      reply	other threads:[~2017-08-30 17:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30  4:11 [PATCH v3 0/3] enable eeprom "size" property and runtime pm Divagar Mohandass
2017-08-30  4:11 ` [PATCH v3 1/3] dt-bindings: add eeprom "size" property Divagar Mohandass
2017-08-30  4:11 ` [PATCH v3 2/3] eeprom: at24: add support to fetch eeprom device property "size" Divagar Mohandass
2017-08-30  4:11 ` [PATCH v3 3/3] eeprom: at24: enable runtime pm support Divagar Mohandass
2017-08-30  7:53   ` Sakari Ailus
2017-08-30 12:32     ` Mohandass, Divagar
2017-08-30 12:41       ` Sakari Ailus
2017-08-30 12:41         ` Sakari Ailus
2017-08-30 17:04         ` Mohandass, Divagar [this message]

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=7B8CE47BD58441468D2BB13285B50E6031DE62E9@BGSMSX107.gar.corp.intel.com \
    --to=divagar.mohandass@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=rajmohan.mani@intel.com \
    --cc=robh+dt@kernel.org \
    --cc=sakari.ailus@iki.fi \
    --cc=wsa@the-dreams.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.