Patch "power: supply: axp20x_usb_power: Init work before enabling IRQs" has been added to the 5.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    power: supply: axp20x_usb_power: Init work before enabling IRQs

to the 5.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     power-supply-axp20x_usb_power-init-work-before-enabl.patch
and it can be found in the queue-5.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit eea3f1fd4387c9f0b5415c37a0585a7160ba2f64
Author: Samuel Holland <samuel@xxxxxxxxxxxx>
Date:   Sun Jan 24 09:24:21 2021 -0600

    power: supply: axp20x_usb_power: Init work before enabling IRQs
    
    [ Upstream commit b5e8642ed95ff6ecc20cc6038fe831affa9d098c ]
    
    The IRQ handler calls mod_delayed_work() on power->vbus_detect. However,
    that work item is not initialized until after the IRQs are enabled. If
    an IRQ is already pending when the driver is probed, the driver calls
    mod_delayed_work() on an uninitialized work item, which causes an oops.
    
    Fixes: bcfb7ae3f50b ("power: supply: axp20x_usb_power: Only poll while offline")
    Signed-off-by: Samuel Holland <samuel@xxxxxxxxxxxx>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c
index 70b28b699a80c..8933ae26c3d69 100644
--- a/drivers/power/supply/axp20x_usb_power.c
+++ b/drivers/power/supply/axp20x_usb_power.c
@@ -593,6 +593,7 @@ 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);
 
 	if (power->axp20x_id == AXP202_ID) {
 		/* Enable vbus valid checking */
@@ -645,7 +646,6 @@ static int axp20x_usb_power_probe(struct platform_device *pdev)
 		}
 	}
 
-	INIT_DELAYED_WORK(&power->vbus_detect, axp20x_usb_power_poll_vbus);
 	if (axp20x_usb_vbus_needs_polling(power))
 		queue_delayed_work(system_power_efficient_wq, &power->vbus_detect, 0);
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux