linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] I2C: Fix for suspend/resume issue in i2c-core
@ 2010-09-04  8:48 Vishwanath BS
       [not found] ` <1283590081-14593-1-git-send-email-vishwanath.bs-l0cyMroinI0@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Vishwanath BS @ 2010-09-04  8:48 UTC (permalink / raw)
  To: linux-i2c
  Cc: linux-omap, Vishwanath BS, Partha Basak, Rafael J. Wysocki,
	Kevin Hilman, Ben Dooks, Jean Delvare

In current i2c core driver, call to pm_runtime_set_active from i2c_device_pm_resume
will unconditionally enable i2c module and increment child count of the parent.
Because of this, in CPU Idle path, i2c does not idle, preventing Core to
enter retention. Also i2c module will not be suspended upon system suspend as
pm_runtime_set_suspended is not called from i2c_device_pm_suspend.
This issue is fixed by  removing  pm_runtime_set_active call from resume path which
is not necessary.
This fix has been tested on OMAP4430.

Signed-off-by: Partha Basak <p-basak2@ti.com>
Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>

Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Jean Delvare <khali@linux-fr.org>
---
 drivers/i2c/i2c-core.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
 mode change 100644 => 100755 drivers/i2c/i2c-core.c

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
old mode 100644
new mode 100755
index 6649176..13927d5
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -216,12 +216,6 @@ static int i2c_device_pm_resume(struct device *dev)
 	else
 		ret = i2c_legacy_resume(dev);
 
-	if (!ret) {
-		pm_runtime_disable(dev);
-		pm_runtime_set_active(dev);
-		pm_runtime_enable(dev);
-	}
-
 	return ret;
 }
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH V2] I2C: Fix for suspend/resume issue in i2c-core
       [not found] ` <1283590081-14593-1-git-send-email-vishwanath.bs-l0cyMroinI0@public.gmane.org>
@ 2010-09-04 10:11   ` Cousson, Benoit
  2010-09-04 12:16   ` Jean Delvare
  1 sibling, 0 replies; 3+ messages in thread
From: Cousson, Benoit @ 2010-09-04 10:11 UTC (permalink / raw)
  To: Sripathy, Vishwanath
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Basak, Partha,
	Rafael J. Wysocki, Kevin Hilman, Ben Dooks, Jean Delvare

Hi Vishwa,

I just have a couple of minors comments:

On 9/4/2010 10:48 AM, Sripathy, Vishwanath wrote:
> In current i2c core driver, call to pm_runtime_set_active from i2c_device_pm_resume
> will unconditionally enable i2c module and increment child count of the parent.
> Because of this, in CPU Idle path, i2c does not idle, preventing Core to
> enter retention. Also i2c module will not be suspended upon system suspend as
> pm_runtime_set_suspended is not called from i2c_device_pm_suspend.
> This issue is fixed by  removing  pm_runtime_set_active call from resume path which
Unnecessary spaces: -----^ and ----^

> is not necessary.
> This fix has been tested on OMAP4430.
>
> Signed-off-by: Partha Basak<p-basak2-l0cyMroinI0@public.gmane.org>
> Signed-off-by: Vishwanath BS<vishwanath.bs-l0cyMroinI0@public.gmane.org>
>
> Cc: Rafael J. Wysocki<rjw-KKrjLPT3xs0@public.gmane.org>
> Cc: Kevin Hilman<khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
> Cc: Ben Dooks<ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
> Cc: Jean Delvare<khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
> ---
>   drivers/i2c/i2c-core.c |    6 ------
>   1 files changed, 0 insertions(+), 6 deletions(-)
>   mode change 100644 =>  100755 drivers/i2c/i2c-core.c

You should probably not have to change the file mode.

Regards,
Benoit

>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> old mode 100644
> new mode 100755
> index 6649176..13927d5
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -216,12 +216,6 @@ static int i2c_device_pm_resume(struct device *dev)
>   	else
>   		ret = i2c_legacy_resume(dev);
>
> -	if (!ret) {
> -		pm_runtime_disable(dev);
> -		pm_runtime_set_active(dev);
> -		pm_runtime_enable(dev);
> -	}
> -
>   	return ret;
>   }
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH V2] I2C: Fix for suspend/resume issue in i2c-core
       [not found] ` <1283590081-14593-1-git-send-email-vishwanath.bs-l0cyMroinI0@public.gmane.org>
  2010-09-04 10:11   ` Cousson, Benoit
@ 2010-09-04 12:16   ` Jean Delvare
  1 sibling, 0 replies; 3+ messages in thread
From: Jean Delvare @ 2010-09-04 12:16 UTC (permalink / raw)
  To: Vishwanath BS
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Partha Basak,
	Rafael J. Wysocki, Kevin Hilman, Ben Dooks

On Sat,  4 Sep 2010 14:18:01 +0530, Vishwanath BS wrote:
> In current i2c core driver, call to pm_runtime_set_active from i2c_device_pm_resume
> will unconditionally enable i2c module and increment child count of the parent.
> Because of this, in CPU Idle path, i2c does not idle, preventing Core to
> enter retention. Also i2c module will not be suspended upon system suspend as
> pm_runtime_set_suspended is not called from i2c_device_pm_suspend.
> This issue is fixed by  removing  pm_runtime_set_active call from resume path which
> is not necessary.
> This fix has been tested on OMAP4430.
> 
> Signed-off-by: Partha Basak <p-basak2-l0cyMroinI0@public.gmane.org>
> Signed-off-by: Vishwanath BS <vishwanath.bs-l0cyMroinI0@public.gmane.org>
> 
> Cc: Rafael J. Wysocki <rjw-KKrjLPT3xs0@public.gmane.org>
> Cc: Kevin Hilman <khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
> Cc: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
> Cc: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
> ---
>  drivers/i2c/i2c-core.c |    6 ------
>  1 files changed, 0 insertions(+), 6 deletions(-)
>  mode change 100644 => 100755 drivers/i2c/i2c-core.c
> 
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> old mode 100644
> new mode 100755
> index 6649176..13927d5
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -216,12 +216,6 @@ static int i2c_device_pm_resume(struct device *dev)
>  	else
>  		ret = i2c_legacy_resume(dev);
>  
> -	if (!ret) {
> -		pm_runtime_disable(dev);
> -		pm_runtime_set_active(dev);
> -		pm_runtime_enable(dev);
> -	}
> -
>  	return ret;
>  }
>  

Applied, thanks.

-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-04 12:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-04  8:48 [PATCH V2] I2C: Fix for suspend/resume issue in i2c-core Vishwanath BS
     [not found] ` <1283590081-14593-1-git-send-email-vishwanath.bs-l0cyMroinI0@public.gmane.org>
2010-09-04 10:11   ` Cousson, Benoit
2010-09-04 12:16   ` Jean Delvare

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).