Patch "regulator: da9211: Use irq handler when ready" has been added to the 4.19-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

    regulator: da9211: Use irq handler when ready

to the 4.19-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:
     regulator-da9211-use-irq-handler-when-ready.patch
and it can be found in the queue-4.19 subdirectory.

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



commit 56aa8e58e8faf7cd99fa187b27fd993e0a1b0da2
Author: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Date:   Sun Nov 27 22:06:02 2022 +0100

    regulator: da9211: Use irq handler when ready
    
    [ Upstream commit 02228f6aa6a64d588bc31e3267d05ff184d772eb ]
    
    If the system does not come from reset (like when it is kexec()), the
    regulator might have an IRQ waiting for us.
    
    If we enable the IRQ handler before its structures are ready, we crash.
    
    This patch fixes:
    
    [    1.141839] Unable to handle kernel read from unreadable memory at virtual address 0000000000000078
    [    1.316096] Call trace:
    [    1.316101]  blocking_notifier_call_chain+0x20/0xa8
    [    1.322757] cpu cpu0: dummy supplies not allowed for exclusive requests
    [    1.327823]  regulator_notifier_call_chain+0x1c/0x2c
    [    1.327825]  da9211_irq_handler+0x68/0xf8
    [    1.327829]  irq_thread+0x11c/0x234
    [    1.327833]  kthread+0x13c/0x154
    
    Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
    Reviewed-by: Adam Ward <DLG-Adam.Ward.opensource@xxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221124-da9211-v2-0-1779e3c5d491@xxxxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/regulator/da9211-regulator.c b/drivers/regulator/da9211-regulator.c
index 6c122b3df5d0..8847d15c2b90 100644
--- a/drivers/regulator/da9211-regulator.c
+++ b/drivers/regulator/da9211-regulator.c
@@ -469,6 +469,12 @@ static int da9211_i2c_probe(struct i2c_client *i2c,
 
 	chip->chip_irq = i2c->irq;
 
+	ret = da9211_regulator_init(chip);
+	if (ret < 0) {
+		dev_err(chip->dev, "Failed to initialize regulator: %d\n", ret);
+		return ret;
+	}
+
 	if (chip->chip_irq != 0) {
 		ret = devm_request_threaded_irq(chip->dev, chip->chip_irq, NULL,
 					da9211_irq_handler,
@@ -483,11 +489,6 @@ static int da9211_i2c_probe(struct i2c_client *i2c,
 		dev_warn(chip->dev, "No IRQ configured\n");
 	}
 
-	ret = da9211_regulator_init(chip);
-
-	if (ret < 0)
-		dev_err(chip->dev, "Failed to initialize regulator: %d\n", ret);
-
 	return ret;
 }
 



[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