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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 14 Jul 2015 09:18:01 +0200
From:	Pali Rohár <pali.rohar@...il.com>
To:	Krzysztof Kozlowski <k.kozlowski@...sung.com>
Cc:	Sebastian Reichel <sre@...nel.org>,
	Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
	David Woodhouse <dwmw2@...radead.org>,
	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFT/RFC] power_supply: bq2415x_charger: Initialize workqueue
 before scheduling it

On Tuesday 14 July 2015 09:34:13 Krzysztof Kozlowski wrote:
> The driver during probe registers a power supply notifier
> (with bq2415x_notifier_call() callback) and calls it manually right
> after. The notifier callback function schedules driver's workqueue
> (bq->work).
> 
> However the workqueue was initialized after these two events (after
> registering power supply notifier and calling manually the callback).
> 
> When power supply core notified the driver (executing its
> bq2415x_notifier_call() callback) the scheduled workqueue could be
> still uninitialized.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@...sung.com>
> Reported-by: Pali Rohár <pali.rohar@...il.com>
> 
> ---
> 
> I don't have the hardware, please test. Additionally I could not find
> the commit which introduced the issue so I did not cc-stable.

Thanks for the patch! Please wait some time (about week) and I will test
it on real Nokia N900 hardware.

Because bq2415x depends on isp1704 on Nokia N900 and isp1704 is not
emulated by qemu, we cannot test any bq2415x changes in qemu :-(

> ---
>  drivers/power/bq2415x_charger.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/bq2415x_charger.c b/drivers/power/bq2415x_charger.c
> index e98dcb661cc9..527ed0f18796 100644
> --- a/drivers/power/bq2415x_charger.c
> +++ b/drivers/power/bq2415x_charger.c
> @@ -1601,6 +1601,7 @@ static int bq2415x_probe(struct i2c_client *client,
>  	bq->reported_mode = BQ2415X_MODE_OFF;
>  	bq->autotimer = 0;
>  	bq->automode = 0;
> +	INIT_DELAYED_WORK(&bq->work, bq2415x_timer_work);
>  
>  	if (np || ACPI_HANDLE(bq->dev)) {
>  		ret = device_property_read_u32(bq->dev,
> @@ -1677,7 +1678,6 @@ static int bq2415x_probe(struct i2c_client *client,
>  		dev_info(bq->dev, "automode not supported\n");
>  	}
>  
> -	INIT_DELAYED_WORK(&bq->work, bq2415x_timer_work);
>  	bq2415x_set_autotimer(bq, 1);
>  
>  	dev_info(bq->dev, "driver registered\n");

-- 
Pali Rohár
pali.rohar@...il.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ