All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: s3c2410: resume the I2C controller earlier
@ 2014-06-19  4:54 ` Doug Anderson
  0 siblings, 0 replies; 5+ messages in thread
From: Doug Anderson @ 2014-06-19  4:54 UTC (permalink / raw)
  To: Wolfram Sang, Kukjin Kim, Ben Dooks
  Cc: Tomasz Figa, javier.martinez, Vincent Palatin, Doug Anderson,
	linux-arm-kernel, linux-samsung-soc, linux-i2c, linux-kernel

From: Vincent Palatin <vpalatin@chromium.org>

When the wake-up is triggered by the PMIC RTC, the RTC driver is trying
to read the PMIC interrupt status over I2C and fails because the I2C
controller is not resumed yet.
Let's resume the I2C controller earlier in the _noirq phase
(as other hardwares are doing), so we can properly get the wake-up
condition.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
---
 drivers/i2c/busses/i2c-s3c2410.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index e828a1d..b904132 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -1267,7 +1267,7 @@ static int s3c24xx_i2c_suspend_noirq(struct device *dev)
 	return 0;
 }
 
-static int s3c24xx_i2c_resume(struct device *dev)
+static int s3c24xx_i2c_resume_noirq(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
@@ -1285,7 +1285,7 @@ static int s3c24xx_i2c_resume(struct device *dev)
 static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
 #ifdef CONFIG_PM_SLEEP
 	.suspend_noirq = s3c24xx_i2c_suspend_noirq,
-	.resume = s3c24xx_i2c_resume,
+	.resume_noirq = s3c24xx_i2c_resume_noirq,
 #endif
 };
 
-- 
2.0.0.526.g5318336


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

* [PATCH] i2c: s3c2410: resume the I2C controller earlier
@ 2014-06-19  4:54 ` Doug Anderson
  0 siblings, 0 replies; 5+ messages in thread
From: Doug Anderson @ 2014-06-19  4:54 UTC (permalink / raw)
  To: linux-arm-kernel

From: Vincent Palatin <vpalatin@chromium.org>

When the wake-up is triggered by the PMIC RTC, the RTC driver is trying
to read the PMIC interrupt status over I2C and fails because the I2C
controller is not resumed yet.
Let's resume the I2C controller earlier in the _noirq phase
(as other hardwares are doing), so we can properly get the wake-up
condition.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
---
 drivers/i2c/busses/i2c-s3c2410.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index e828a1d..b904132 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -1267,7 +1267,7 @@ static int s3c24xx_i2c_suspend_noirq(struct device *dev)
 	return 0;
 }
 
-static int s3c24xx_i2c_resume(struct device *dev)
+static int s3c24xx_i2c_resume_noirq(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
@@ -1285,7 +1285,7 @@ static int s3c24xx_i2c_resume(struct device *dev)
 static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
 #ifdef CONFIG_PM_SLEEP
 	.suspend_noirq = s3c24xx_i2c_suspend_noirq,
-	.resume = s3c24xx_i2c_resume,
+	.resume_noirq = s3c24xx_i2c_resume_noirq,
 #endif
 };
 
-- 
2.0.0.526.g5318336

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

* Re: [PATCH] i2c: s3c2410: resume the I2C controller earlier
  2014-06-19  4:54 ` Doug Anderson
  (?)
@ 2014-06-19  5:23   ` Doug Anderson
  -1 siblings, 0 replies; 5+ messages in thread
From: Doug Anderson @ 2014-06-19  5:23 UTC (permalink / raw)
  To: Wolfram Sang, Kukjin Kim, Ben Dooks
  Cc: Tomasz Figa, Javier Martinez Canillas, Vincent Palatin,
	Doug Anderson, linux-arm-kernel, linux-samsung-soc, linux-i2c,
	linux-kernel

Hi,

On Wed, Jun 18, 2014 at 9:54 PM, Doug Anderson <dianders@chromium.org> wrote:
> From: Vincent Palatin <vpalatin@chromium.org>
>
> When the wake-up is triggered by the PMIC RTC, the RTC driver is trying
> to read the PMIC interrupt status over I2C and fails because the I2C
> controller is not resumed yet.
> Let's resume the I2C controller earlier in the _noirq phase
> (as other hardwares are doing), so we can properly get the wake-up
> condition.
>
> Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> ---
>  drivers/i2c/busses/i2c-s3c2410.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
> index e828a1d..b904132 100644
> --- a/drivers/i2c/busses/i2c-s3c2410.c
> +++ b/drivers/i2c/busses/i2c-s3c2410.c
> @@ -1267,7 +1267,7 @@ static int s3c24xx_i2c_suspend_noirq(struct device *dev)
>         return 0;
>  }
>
> -static int s3c24xx_i2c_resume(struct device *dev)
> +static int s3c24xx_i2c_resume_noirq(struct device *dev)
>  {
>         struct platform_device *pdev = to_platform_device(dev);
>         struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
> @@ -1285,7 +1285,7 @@ static int s3c24xx_i2c_resume(struct device *dev)
>  static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
>  #ifdef CONFIG_PM_SLEEP
>         .suspend_noirq = s3c24xx_i2c_suspend_noirq,
> -       .resume = s3c24xx_i2c_resume,
> +       .resume_noirq = s3c24xx_i2c_resume_noirq,

I looked at applying this to another i2c controller and stumbled upon
feedback from Wolfram suggesting that I should add "poweroff, thaw,
freeze, restore".  I'm happy to squash that into this patch or send a
separate patch if people would like it.  Just let me know.

-Doug

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

* Re: [PATCH] i2c: s3c2410: resume the I2C controller earlier
@ 2014-06-19  5:23   ` Doug Anderson
  0 siblings, 0 replies; 5+ messages in thread
From: Doug Anderson @ 2014-06-19  5:23 UTC (permalink / raw)
  To: Wolfram Sang, Kukjin Kim, Ben Dooks
  Cc: Tomasz Figa, Javier Martinez Canillas, Vincent Palatin,
	Doug Anderson, linux-arm-kernel, linux-samsung-soc, linux-i2c,
	linux-kernel

Hi,

On Wed, Jun 18, 2014 at 9:54 PM, Doug Anderson <dianders@chromium.org> wrote:
> From: Vincent Palatin <vpalatin@chromium.org>
>
> When the wake-up is triggered by the PMIC RTC, the RTC driver is trying
> to read the PMIC interrupt status over I2C and fails because the I2C
> controller is not resumed yet.
> Let's resume the I2C controller earlier in the _noirq phase
> (as other hardwares are doing), so we can properly get the wake-up
> condition.
>
> Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> ---
>  drivers/i2c/busses/i2c-s3c2410.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
> index e828a1d..b904132 100644
> --- a/drivers/i2c/busses/i2c-s3c2410.c
> +++ b/drivers/i2c/busses/i2c-s3c2410.c
> @@ -1267,7 +1267,7 @@ static int s3c24xx_i2c_suspend_noirq(struct device *dev)
>         return 0;
>  }
>
> -static int s3c24xx_i2c_resume(struct device *dev)
> +static int s3c24xx_i2c_resume_noirq(struct device *dev)
>  {
>         struct platform_device *pdev = to_platform_device(dev);
>         struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
> @@ -1285,7 +1285,7 @@ static int s3c24xx_i2c_resume(struct device *dev)
>  static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
>  #ifdef CONFIG_PM_SLEEP
>         .suspend_noirq = s3c24xx_i2c_suspend_noirq,
> -       .resume = s3c24xx_i2c_resume,
> +       .resume_noirq = s3c24xx_i2c_resume_noirq,

I looked at applying this to another i2c controller and stumbled upon
feedback from Wolfram suggesting that I should add "poweroff, thaw,
freeze, restore".  I'm happy to squash that into this patch or send a
separate patch if people would like it.  Just let me know.

-Doug

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

* [PATCH] i2c: s3c2410: resume the I2C controller earlier
@ 2014-06-19  5:23   ` Doug Anderson
  0 siblings, 0 replies; 5+ messages in thread
From: Doug Anderson @ 2014-06-19  5:23 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Wed, Jun 18, 2014 at 9:54 PM, Doug Anderson <dianders@chromium.org> wrote:
> From: Vincent Palatin <vpalatin@chromium.org>
>
> When the wake-up is triggered by the PMIC RTC, the RTC driver is trying
> to read the PMIC interrupt status over I2C and fails because the I2C
> controller is not resumed yet.
> Let's resume the I2C controller earlier in the _noirq phase
> (as other hardwares are doing), so we can properly get the wake-up
> condition.
>
> Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> ---
>  drivers/i2c/busses/i2c-s3c2410.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
> index e828a1d..b904132 100644
> --- a/drivers/i2c/busses/i2c-s3c2410.c
> +++ b/drivers/i2c/busses/i2c-s3c2410.c
> @@ -1267,7 +1267,7 @@ static int s3c24xx_i2c_suspend_noirq(struct device *dev)
>         return 0;
>  }
>
> -static int s3c24xx_i2c_resume(struct device *dev)
> +static int s3c24xx_i2c_resume_noirq(struct device *dev)
>  {
>         struct platform_device *pdev = to_platform_device(dev);
>         struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
> @@ -1285,7 +1285,7 @@ static int s3c24xx_i2c_resume(struct device *dev)
>  static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
>  #ifdef CONFIG_PM_SLEEP
>         .suspend_noirq = s3c24xx_i2c_suspend_noirq,
> -       .resume = s3c24xx_i2c_resume,
> +       .resume_noirq = s3c24xx_i2c_resume_noirq,

I looked at applying this to another i2c controller and stumbled upon
feedback from Wolfram suggesting that I should add "poweroff, thaw,
freeze, restore".  I'm happy to squash that into this patch or send a
separate patch if people would like it.  Just let me know.

-Doug

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

end of thread, other threads:[~2014-06-19  5:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-19  4:54 [PATCH] i2c: s3c2410: resume the I2C controller earlier Doug Anderson
2014-06-19  4:54 ` Doug Anderson
2014-06-19  5:23 ` Doug Anderson
2014-06-19  5:23   ` Doug Anderson
2014-06-19  5:23   ` Doug Anderson

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.