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: <20210324102506.3ta2zstmrwq4wswb@earth.universe>
Date:   Wed, 24 Mar 2021 11:25:06 +0100
From:   Sebastian Reichel <sre@...nel.org>
To:     Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
Cc:     Matti Vaittinen <mazziesaccount@...il.com>,
        Hans de Goede <hdegoede@...hat.com>,
        MyungJoo Ham <myungjoo.ham@...sung.com>,
        Chanwoo Choi <cw00.choi@...sung.com>,
        Chen-Yu Tsai <wens@...e.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH 2/2] power: supply: axp20x_usb_power: fix work-queue init

Hi,

On Wed, Mar 24, 2021 at 11:21:34AM +0200, Matti Vaittinen wrote:
> The commit 6d0c5de2fd84
> ("power: supply: Clean-up few drivers by using managed work init")
> Re-introduced wrong order of initializing work-queue and requesting
> the IRQs which was originally fixed by the commit b5e8642ed95f
> ("power: supply: axp20x_usb_power: Init work before enabling IRQs")
> 
> In addition this caused the work queue to be initialized twice.
> 
> Fix it again.
> 
> Fixes: 6d0c5de2fd84 ("power: supply: Clean-up few drivers by using managed work init")
> 
> Signed-off-by: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
> Reported-by: Chen-Yu Tsai <wens@...e.org>
> ---

Acked-by: Sebastian Reichel <sebastian.reichel@...labora.com>

Needs to be merged by Greg, since I do not have 6d0c5de2fd84 in
my tree.

-- Sebastian

>  drivers/power/supply/axp20x_usb_power.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c
> index 4259709e3491..e954970b50e6 100644
> --- a/drivers/power/supply/axp20x_usb_power.c
> +++ b/drivers/power/supply/axp20x_usb_power.c
> @@ -594,7 +594,11 @@ static int axp20x_usb_power_probe(struct platform_device *pdev)
>  	power->axp20x_id = axp_data->axp20x_id;
>  	power->regmap = axp20x->regmap;
>  	power->num_irqs = axp_data->num_irq_names;
> -	INIT_DELAYED_WORK(&power->vbus_detect, axp20x_usb_power_poll_vbus);
> +
> +	ret = devm_delayed_work_autocancel(&pdev->dev, &power->vbus_detect,
> +					   axp20x_usb_power_poll_vbus);
> +	if (ret)
> +		return ret;
>  
>  	if (power->axp20x_id == AXP202_ID) {
>  		/* Enable vbus valid checking */
> @@ -647,10 +651,6 @@ static int axp20x_usb_power_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> -	ret = devm_delayed_work_autocancel(&pdev->dev, &power->vbus_detect,
> -					   axp20x_usb_power_poll_vbus);
> -	if (ret)
> -		return ret;
>  	if (axp20x_usb_vbus_needs_polling(power))
>  		queue_delayed_work(system_power_efficient_wq, &power->vbus_detect, 0);
>  
> -- 
> 2.25.4
> 
> 
> -- 
> Matti Vaittinen, Linux device drivers
> ROHM Semiconductors, Finland SWDC
> Kiviharjunlenkki 1E
> 90220 OULU
> FINLAND
> 
> ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
> Simon says - in Latin please.
> ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
> Thanks to Simon Glass for the translation =] 

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