lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 5 Sep 2018 15:46:13 +0200
From:   Krzysztof Kozlowski <krzk@...nel.org>
To:     Marek Szyprowski <m.szyprowski@...sung.com>
Cc:     linux-kernel@...r.kernel.org,
        "linux-samsung-soc@...r.kernel.org" 
        <linux-samsung-soc@...r.kernel.org>, myungjoo.ham@...sung.com,
        lee.jones@...aro.org,
        Bartłomiej Żołnierkiewicz 
        <b.zolnierkie@...sung.com>
Subject: Re: [PATCH] mfd: max8997: Disable interrupt handling for
 suspend/resume cycle

On Wed, 5 Sep 2018 at 14:32, Marek Szyprowski <m.szyprowski@...sung.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@...sung.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ