All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: max8997: Disable interrupt handling for suspend/resume cycle
       [not found] <CGME20180905123053eucas1p196633ed9d661f79ed1c2e06a14a2b964@eucas1p1.samsung.com>
@ 2018-09-05 12:30 ` Marek Szyprowski
  2018-09-05 13:46   ` Krzysztof Kozlowski
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Szyprowski @ 2018-09-05 12:30 UTC (permalink / raw)
  To: linux-kernel, linux-samsung-soc
  Cc: Marek Szyprowski, MyungJoo Ham, Lee Jones, Bartlomiej Zolnierkiewicz

Disable IRQs during suspend/resume cycle to ensure handling of wakeup
interrupts (i.e. RTC wake alarm) after max8997_resume(). This way it can
be properly handled when I2C bus is finally available. This pattern is
also used in other MAX PMIC MFD drivers.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/mfd/max8997.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
index d1495d76bf2c..5a50ea976c70 100644
--- a/drivers/mfd/max8997.c
+++ b/drivers/mfd/max8997.c
@@ -464,6 +464,7 @@ static int max8997_suspend(struct device *dev)
 
 	if (device_may_wakeup(dev))
 		irq_set_irq_wake(max8997->irq, 1);
+	disable_irq(max8997->irq);
 	return 0;
 }
 
@@ -474,6 +475,7 @@ static int max8997_resume(struct device *dev)
 
 	if (device_may_wakeup(dev))
 		irq_set_irq_wake(max8997->irq, 0);
+	enable_irq(max8997->irq);
 	return max8997_irq_resume(max8997);
 }
 
-- 
2.17.1


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

* Re: [PATCH] mfd: max8997: Disable interrupt handling for suspend/resume cycle
  2018-09-05 12:30 ` [PATCH] mfd: max8997: Disable interrupt handling for suspend/resume cycle Marek Szyprowski
@ 2018-09-05 13:46   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2018-09-05 13:46 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-kernel, linux-samsung-soc, myungjoo.ham, lee.jones,
	Bartłomiej Żołnierkiewicz

On Wed, 5 Sep 2018 at 14:32, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
>
> Disable IRQs during suspend/resume cycle to ensure handling of wakeup
> interrupts (i.e. RTC wake alarm) after max8997_resume(). This way it can
> be properly handled when I2C bus is finally available. This pattern is
> also used in other MAX PMIC MFD drivers.
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/mfd/max8997.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
> index d1495d76bf2c..5a50ea976c70 100644
> --- a/drivers/mfd/max8997.c
> +++ b/drivers/mfd/max8997.c
> @@ -464,6 +464,7 @@ static int max8997_suspend(struct device *dev)
>
>         if (device_may_wakeup(dev))
>                 irq_set_irq_wake(max8997->irq, 1);
> +       disable_irq(max8997->irq);
>         return 0;
>  }
>
> @@ -474,6 +475,7 @@ static int max8997_resume(struct device *dev)
>
>         if (device_may_wakeup(dev))
>                 irq_set_irq_wake(max8997->irq, 0);
> +       enable_irq(max8997->irq);
>         return max8997_irq_resume(max8997);

Looks good except that here and in some existing drivers we do not
resume in reverse order of suspend. How about making it like in
drivers/mfd/max77843.c? It should not differ from functional point of
view, just logically it makes sense.

Best regards,
Krzysztof

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

end of thread, other threads:[~2018-09-05 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20180905123053eucas1p196633ed9d661f79ed1c2e06a14a2b964@eucas1p1.samsung.com>
2018-09-05 12:30 ` [PATCH] mfd: max8997: Disable interrupt handling for suspend/resume cycle Marek Szyprowski
2018-09-05 13:46   ` Krzysztof Kozlowski

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.