Patch "power: supply: core: Remove might_sleep() from power_supply_put()" has been added to the 5.15-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: core: Remove might_sleep() from power_supply_put()

to the 5.15-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-core-remove-might_sleep-from-power_supp.patch
and it can be found in the queue-5.15 subdirectory.

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



commit f8d5811f7457995479480be6a75ff6a03e387d54
Author: Bart Van Assche <bvanassche@xxxxxxx>
Date:   Tue Sep 17 12:39:14 2024 -0700

    power: supply: core: Remove might_sleep() from power_supply_put()
    
    [ Upstream commit f6da4553ff24a5d1c959c9627c965323adc3d307 ]
    
    The put_device() call in power_supply_put() may call
    power_supply_dev_release(). The latter function does not sleep so
    power_supply_put() doesn't sleep either. Hence, remove the might_sleep()
    call from power_supply_put(). This patch suppresses false positive
    complaints about calling a sleeping function from atomic context if
    power_supply_put() is called from atomic context.
    
    Cc: Kyle Tso <kyletso@xxxxxxxxxx>
    Cc: Krzysztof Kozlowski <krzk@xxxxxxxxxx>
    Fixes: 1a352462b537 ("power_supply: Add power_supply_put for decrementing device reference counter")
    Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
    Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240917193914.47566-1-bvanassche@xxxxxxx
    Signed-off-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index 8b2cd63016160..2ebf838fbf9d3 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -479,8 +479,6 @@ EXPORT_SYMBOL_GPL(power_supply_get_by_name);
  */
 void power_supply_put(struct power_supply *psy)
 {
-	might_sleep();
-
 	atomic_dec(&psy->use_cnt);
 	put_device(&psy->dev);
 }




[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