[PATCH V2] I2C: Fix for suspend/resume issue in i2c-core

2010-09-04 Thread Vishwanath BS
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-bas...@ti.com
Signed-off-by: Vishwanath BS vishwanath...@ti.com

Cc: Rafael J. Wysocki r...@sisk.pl
Cc: Kevin Hilman khil...@deeprootsystems.com
Cc: Ben Dooks ben-li...@fluff.org
Cc: Jean Delvare kh...@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

--
To unsubscribe from this list: send the line unsubscribe linux-i2c in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2] I2C: Fix for suspend/resume issue in i2c-core

2010-09-04 Thread Cousson, Benoit

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 Basakp-bas...@ti.com
Signed-off-by: Vishwanath BSvishwanath...@ti.com

Cc: Rafael J. Wysockir...@sisk.pl
Cc: Kevin Hilmankhil...@deeprootsystems.com
Cc: Ben Dooksben-li...@fluff.org
Cc: Jean Delvarekh...@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


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;
  }



--
To unsubscribe from this list: send the line unsubscribe linux-i2c in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2] I2C: Fix for suspend/resume issue in i2c-core

2010-09-04 Thread Jean Delvare
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-bas...@ti.com
 Signed-off-by: Vishwanath BS vishwanath...@ti.com
 
 Cc: Rafael J. Wysocki r...@sisk.pl
 Cc: Kevin Hilman khil...@deeprootsystems.com
 Cc: Ben Dooks ben-li...@fluff.org
 Cc: Jean Delvare kh...@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;
  }
  

Applied, thanks.

-- 
Jean Delvare
--
To unsubscribe from this list: send the line unsubscribe linux-i2c in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html