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] [thread-next>] [day] [month] [year] [list]
Message-ID: <f656e38ff276f6c73d0b59eb301528cf3ae322e9.camel@redhat.com>
Date: Tue, 27 Feb 2024 11:23:18 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Alex Elder <elder@...aro.org>, davem@...emloft.net, edumazet@...gle.com,
  kuba@...nel.org
Cc: mka@...omium.org, andersson@...nel.org, quic_cpratapa@...cinc.com, 
 quic_avuyyuru@...cinc.com, quic_jponduru@...cinc.com,
 quic_subashab@...cinc.com,  elder@...nel.org, netdev@...r.kernel.org,
 linux-arm-msm@...r.kernel.org,  linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 1/6] net: ipa: don't bother aborting system
 resume

On Fri, 2024-02-23 at 07:39 -0600, Alex Elder wrote:
> The IPA interrupt can fire if there is data to be delivered to a GSI
> channel that is suspended.  This condition occurs in three scenarios.
> 
> First, runtime power management automatically suspends the IPA
> hardware after half a second of inactivity.  This has nothing
> to do with system suspend, so a SYSTEM IPA power flag is used to
> avoid calling pm_wakeup_dev_event() when runtime suspended.
> 
> Second, if the system is suspended, the receipt of an IPA interrupt
> should trigger a system resume.  Configuring the IPA interrupt for
> wakeup accomplishes this.
> 
> Finally, if system suspend is underway and the IPA interrupt fires,
> we currently call pm_wakeup_dev_event() to abort the system suspend.
> 
> The IPA driver correctly handles quiescing the hardware before
> suspending it, so there's really no need to abort a suspend in
> progress in the third case.  We can simply quiesce and suspend
> things, and be done.
> 
> Incoming data can still wake the system after it's suspended.
> The IPA interrupt has wakeup mode enabled, so if it fires *after*
> we've suspended, it will trigger a wakeup (if not disabled via
> sysfs).
> 
> Stop calling pm_wakeup_dev_event() to abort a system suspend in
> progress in ipa_power_suspend_handler().
> 
> Signed-off-by: Alex Elder <elder@...aro.org>
> ---
> Note: checkpatch warns: braces {} are not necessary...
> 
>  drivers/net/ipa/ipa_power.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c
> index 128a816f65237..694bc71e0a170 100644
> --- a/drivers/net/ipa/ipa_power.c
> +++ b/drivers/net/ipa/ipa_power.c
> @@ -220,8 +220,9 @@ void ipa_power_suspend_handler(struct ipa *ipa, enum ipa_irq_id irq_id)
>  	 * system suspend, trigger a system resume.
>  	 */
>  	if (!__test_and_set_bit(IPA_POWER_FLAG_RESUMED, ipa->power->flags))
> -		if (test_bit(IPA_POWER_FLAG_SYSTEM, ipa->power->flags))
> -			pm_wakeup_dev_event(&ipa->pdev->dev, 0, true);
> +		if (test_bit(IPA_POWER_FLAG_SYSTEM, ipa->power->flags)) {
> +			;
> +		}

FTR, I would have dropped the whole 'if' statement above and the
related comment in this patch, saving a few checkpatch warnings. Not a
big deal since the the chunk is removed a few patches later.

Cheers,

Paolo


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ