* [PATCH v2] i2c: s3c2410: resume the I2C controller earlier
@ 2014-06-24 23:56 Doug Anderson
2014-06-25 18:09 ` Javier Martinez Canillas
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Doug Anderson @ 2014-06-24 23:56 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>
---
Changes in v2:
- Added missing freeze/thaw/poweroff/restore
drivers/i2c/busses/i2c-s3c2410.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index e828a1d..ecb389c 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,11 @@ 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,
+ .freeze_noirq = s3c24xx_i2c_suspend_noirq,
+ .thaw_noirq = s3c24xx_i2c_resume_noirq,
+ .poweroff_noirq = s3c24xx_i2c_suspend_noirq,
+ .restore_noirq = s3c24xx_i2c_resume_noirq,
#endif
};
--
2.0.0.526.g5318336
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2] i2c: s3c2410: resume the I2C controller earlier
2014-06-24 23:56 [PATCH v2] i2c: s3c2410: resume the I2C controller earlier Doug Anderson
@ 2014-06-25 18:09 ` Javier Martinez Canillas
2014-06-30 18:00 ` Tomasz Figa
2014-07-16 17:35 ` Wolfram Sang
2 siblings, 0 replies; 5+ messages in thread
From: Javier Martinez Canillas @ 2014-06-25 18:09 UTC (permalink / raw)
To: linux-arm-kernel
Hello Doug,
On 06/25/2014 01:56 AM, Doug Anderson 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>
> ---
> Changes in v2:
> - Added missing freeze/thaw/poweroff/restore
>
> drivers/i2c/busses/i2c-s3c2410.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
> index e828a1d..ecb389c 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,11 @@ 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,
> + .freeze_noirq = s3c24xx_i2c_suspend_noirq,
> + .thaw_noirq = s3c24xx_i2c_resume_noirq,
> + .poweroff_noirq = s3c24xx_i2c_suspend_noirq,
> + .restore_noirq = s3c24xx_i2c_resume_noirq,
> #endif
> };
>
>
Looks good to me.
Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Best regards,
Javier
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] i2c: s3c2410: resume the I2C controller earlier
2014-06-24 23:56 [PATCH v2] i2c: s3c2410: resume the I2C controller earlier Doug Anderson
2014-06-25 18:09 ` Javier Martinez Canillas
@ 2014-06-30 18:00 ` Tomasz Figa
2014-07-16 17:35 ` Wolfram Sang
2 siblings, 0 replies; 5+ messages in thread
From: Tomasz Figa @ 2014-06-30 18:00 UTC (permalink / raw)
To: linux-arm-kernel
Hi Doug,
On 25.06.2014 01:56, Doug Anderson 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>
> ---
> Changes in v2:
> - Added missing freeze/thaw/poweroff/restore
>
> drivers/i2c/busses/i2c-s3c2410.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
> index e828a1d..ecb389c 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,11 @@ 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,
> + .freeze_noirq = s3c24xx_i2c_suspend_noirq,
> + .thaw_noirq = s3c24xx_i2c_resume_noirq,
> + .poweroff_noirq = s3c24xx_i2c_suspend_noirq,
> + .restore_noirq = s3c24xx_i2c_resume_noirq,
> #endif
> };
Also fixes certain issues on Exynos4-based boards.
Acked-by: Tomasz Figa <t.figa@samsung.com>
--
Best regards,
Tomasz
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] i2c: s3c2410: resume the I2C controller earlier
2014-06-24 23:56 [PATCH v2] i2c: s3c2410: resume the I2C controller earlier Doug Anderson
2014-06-25 18:09 ` Javier Martinez Canillas
2014-06-30 18:00 ` Tomasz Figa
@ 2014-07-16 17:35 ` Wolfram Sang
2014-07-16 22:31 ` Doug Anderson
2 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2014-07-16 17:35 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Jun 24, 2014 at 04:56:54PM -0700, Doug Anderson 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>
Applied to for-current (because Tomasz said it fixes issues), thanks! If
you think the exynos patch of the same style should also be in current,
please let me know...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140716/b9b2ce89/attachment.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] i2c: s3c2410: resume the I2C controller earlier
2014-07-16 17:35 ` Wolfram Sang
@ 2014-07-16 22:31 ` Doug Anderson
0 siblings, 0 replies; 5+ messages in thread
From: Doug Anderson @ 2014-07-16 22:31 UTC (permalink / raw)
To: linux-arm-kernel
Wolfram,
On Wed, Jul 16, 2014 at 10:35 AM, Wolfram Sang <wsa@the-dreams.de> wrote:
> On Tue, Jun 24, 2014 at 04:56:54PM -0700, Doug Anderson 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>
>
> Applied to for-current (because Tomasz said it fixes issues), thanks! If
> you think the exynos patch of the same style should also be in current,
> please let me know...
Thanks! I don't think the exynos one needs to go into for-current.
for-next is enough. :)
-Doug
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-07-16 22:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-24 23:56 [PATCH v2] i2c: s3c2410: resume the I2C controller earlier Doug Anderson
2014-06-25 18:09 ` Javier Martinez Canillas
2014-06-30 18:00 ` Tomasz Figa
2014-07-16 17:35 ` Wolfram Sang
2014-07-16 22:31 ` Doug Anderson
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).