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: <ge6ejhaogzcu3q2d2ijxifxuh7i2fsbviqwvh7pxcqt3acl7nj@uorjb3rnwi5v>
Date: Thu, 19 Dec 2024 01:08:35 +0100
From: Sebastian Reichel <sebastian.reichel@...labora.com>
To: "Sicelo A. Mhlongo" <absicsz@...il.com>
Cc: linux-pm@...r.kernel.org, pali@...nel.org, 
	linux-kernel@...r.kernel.org, maemo-leste@...ts.dyne.org, 
	Ivaylo Dimitrov <ivo.g.dimitrov.75@...il.com>
Subject: Re: [PATCH 1/2] power: supply: bq2415x_charger: Immediately queue
 delayed work on supply change events

Hi,

On Thu, Nov 28, 2024 at 10:57:27AM +0200, Sicelo A. Mhlongo wrote:
> bq2415x_notifier_call is called asynchronously, when a change is notified
> from the external notify device. Therefore, reschedule the work item to
> run as soon as possible thereafter.
> 
> Suggested-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@...il.com>
> Signed-off-by: Sicelo A. Mhlongo <absicsz@...il.com>
> ---

The commit message reads quite weird, but the code change makes
sense to me. I think something like this commit message makes
more sense:


When the notifier is called we want to schedule the worker as
soon as possible. Thus it makes sense to reschedule any waiting
work and only queue a new one if there is none.


Greetings,

-- Sebastian

>  drivers/power/supply/bq2415x_charger.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/bq2415x_charger.c b/drivers/power/supply/bq2415x_charger.c
> index 25e28dac900d..1a02195769a3 100644
> --- a/drivers/power/supply/bq2415x_charger.c
> +++ b/drivers/power/supply/bq2415x_charger.c
> @@ -839,7 +839,7 @@ static int bq2415x_notifier_call(struct notifier_block *nb,
>  	if (bq->automode < 1)
>  		return NOTIFY_OK;
>  
> -	schedule_delayed_work(&bq->work, 0);
> +	mod_delayed_work(system_wq, &bq->work, 0);
>  
>  	return NOTIFY_OK;
>  }
> -- 
> 2.45.2
> 
> 

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ