All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@iki.fi>
To: "Mohandass, Divagar" <divagar.mohandass@intel.com>
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 15:41:23 +0300	[thread overview]
Message-ID: <20170830124122.3oipo4ykpzmkzdy2@valkosipuli.retiisi.org.uk> (raw)
In-Reply-To: <7B8CE47BD58441468D2BB13285B50E6031DE621E@BGSMSX107.gar.corp.intel.com>

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.

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

WARNING: multiple messages have this Message-ID (diff)
From: Sakari Ailus <sakari.ailus-X3B1VOXEql0@public.gmane.org>
To: "Mohandass,
	Divagar"
	<divagar.mohandass-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: "robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"mark.rutland-5wv7dgnIgG8@public.gmane.org"
	<mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	"wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org"
	<wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"Mani,
	Rajmohan" <rajmohan.mani-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH v3 3/3] eeprom: at24: enable runtime pm support
Date: Wed, 30 Aug 2017 15:41:23 +0300	[thread overview]
Message-ID: <20170830124122.3oipo4ykpzmkzdy2@valkosipuli.retiisi.org.uk> (raw)
In-Reply-To: <7B8CE47BD58441468D2BB13285B50E6031DE621E-yHIBzpp8AekLtBVenmexd7fspsVTdybXVpNB7YpNyf8@public.gmane.org>

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.

-- 
Sakari Ailus
e-mail: sakari.ailus-X3B1VOXEql0@public.gmane.org
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2017-08-30 12:41 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 [this message]
2017-08-30 12:41         ` Sakari Ailus
2017-08-30 17:04         ` Mohandass, Divagar

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=20170830124122.3oipo4ykpzmkzdy2@valkosipuli.retiisi.org.uk \
    --to=sakari.ailus@iki.fi \
    --cc=devicetree@vger.kernel.org \
    --cc=divagar.mohandass@intel.com \
    --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=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.