Patch "i2c: imx: If pm_runtime_get_sync() returned 1 device access is possible" has been added to the 5.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

    i2c: imx: If pm_runtime_get_sync() returned 1 device access is possible

to the 5.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:
     i2c-imx-if-pm_runtime_get_sync-returned-1-device-acc.patch
and it can be found in the queue-5.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 781d3e29dee94bb45b04de2492dd3bf4d40d2790
Author: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
Date:   Mon Sep 12 15:20:40 2022 +0200

    i2c: imx: If pm_runtime_get_sync() returned 1 device access is possible
    
    [ Upstream commit 085aacaa73163f4b8a89dec24ecb32cfacd34017 ]
    
    pm_runtime_get_sync() returning 1 also means the device is powered. So
    resetting the chip registers in .remove() is possible and should be
    done.
    
    Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
    Fixes: d98bdd3a5b50 ("i2c: imx: Make sure to unregister adapter on remove()")
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
    Acked-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
    Signed-off-by: Wolfram Sang <wsa@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index e47fa3465671..3082183bd66a 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -1583,7 +1583,7 @@ static int i2c_imx_remove(struct platform_device *pdev)
 	if (i2c_imx->dma)
 		i2c_imx_dma_free(i2c_imx);
 
-	if (ret == 0) {
+	if (ret >= 0) {
 		/* setup chip registers to defaults */
 		imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IADR);
 		imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IFDR);



[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