Patch "spi: spi-mtk-nor: initialize spi controller after resume" has been added to the 5.17-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

    spi: spi-mtk-nor: initialize spi controller after resume

to the 5.17-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:
     spi-spi-mtk-nor-initialize-spi-controller-after-resu.patch
and it can be found in the queue-5.17 subdirectory.

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



commit 2b1e5e4a7a6b2991b737ffbc0ec63cc51c0b1571
Author: Allen-KH Cheng <allen-kh.cheng@xxxxxxxxxxxx>
Date:   Tue Apr 12 19:57:43 2022 +0800

    spi: spi-mtk-nor: initialize spi controller after resume
    
    [ Upstream commit 317c2045618cc1f8d38beb8c93a7bdb6ad8638c6 ]
    
    After system resumes, the registers of nor controller are
    initialized with default values. The nor controller will
    not function properly.
    
    To handle both issues above, we add mtk_nor_init() in
    mtk_nor_resume after pm_runtime_force_resume().
    
    Fixes: 3bfd9103c7af ("spi: spi-mtk-nor: Add power management support")
    
    Signed-off-by: Allen-KH Cheng <allen-kh.cheng@xxxxxxxxxxxx>
    Reviewed-by: Rex-BC Chen <rex-bc.chen@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220412115743.22641-1-allen-kh.cheng@xxxxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/spi/spi-mtk-nor.c b/drivers/spi/spi-mtk-nor.c
index 5c93730615f8..6d203477c04b 100644
--- a/drivers/spi/spi-mtk-nor.c
+++ b/drivers/spi/spi-mtk-nor.c
@@ -909,7 +909,17 @@ static int __maybe_unused mtk_nor_suspend(struct device *dev)
 
 static int __maybe_unused mtk_nor_resume(struct device *dev)
 {
-	return pm_runtime_force_resume(dev);
+	struct spi_controller *ctlr = dev_get_drvdata(dev);
+	struct mtk_nor *sp = spi_controller_get_devdata(ctlr);
+	int ret;
+
+	ret = pm_runtime_force_resume(dev);
+	if (ret)
+		return ret;
+
+	mtk_nor_init(sp);
+
+	return 0;
 }
 
 static const struct dev_pm_ops mtk_nor_pm_ops = {



[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