Patch "i3c: master: Remove i3c_dev_disable_ibi_locked(olddev) on device hotjoin" has been added to the 6.12-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

    i3c: master: Remove i3c_dev_disable_ibi_locked(olddev) on device hotjoin

to the 6.12-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:
     i3c-master-remove-i3c_dev_disable_ibi_locked-olddev-.patch
and it can be found in the queue-6.12 subdirectory.

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



commit 3cf5ad0cfec037361bc2948441208b44cd043eb6
Author: Frank Li <Frank.Li@xxxxxxx>
Date:   Tue Oct 1 12:22:32 2024 -0400

    i3c: master: Remove i3c_dev_disable_ibi_locked(olddev) on device hotjoin
    
    [ Upstream commit 36faa04ce3d9c962b4b29d285ad07ca29e2988e4 ]
    
    When a new device hotjoins, a new dynamic address is assigned.
    i3c_master_add_i3c_dev_locked() identifies that the device was previously
    attached to the bus and locates the olddev.
    
    i3c_master_add_i3c_dev_locked()
    {
        ...
        olddev = i3c_master_search_i3c_dev_duplicate(newdev);
        ...
        if (olddev) {
            ...
            i3c_dev_disable_ibi_locked(olddev);
            ^^^^^^
            The olddev should not receive any commands on the i3c bus as it
            does not exist and has been assigned a new address. This will
            result in NACK or timeout. So remove it.
        }
    
        i3c_dev_free_ibi_locked(olddev);
        ^^^^^^^^
        This function internally calls i3c_dev_disable_ibi_locked() function
        causing to send DISEC command with old Address.
    
        The olddev should not receive any commands on the i3c bus as it
        does not exist and has been assigned a new address. This will
        result in NACK or timeout. So, update the olddev->ibi->enabled
        flag to false to avoid DISEC with OldAddr.
    }
    
    Include part of Ravindra Yashvant Shinde's work:
    https://lore.kernel.org/linux-i3c/20240820151917.3904956-1-ravindra.yashvant.shinde@xxxxxxx/T/#u
    
    Fixes: 317bacf960a4 ("i3c: master: add enable(disable) hot join in sys entry")
    Co-developed-by: Ravindra Yashvant Shinde <ravindra.yashvant.shinde@xxxxxxx>
    Signed-off-by: Ravindra Yashvant Shinde <ravindra.yashvant.shinde@xxxxxxx>
    Reviewed-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
    Signed-off-by: Frank Li <Frank.Li@xxxxxxx>
    Link: https://lore.kernel.org/r/20241001162232.223724-1-Frank.Li@xxxxxxx
    Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 6f3eb710a75d6..ffe99f0c6acef 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -2051,11 +2051,16 @@ int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master,
 			ibireq.max_payload_len = olddev->ibi->max_payload_len;
 			ibireq.num_slots = olddev->ibi->num_slots;
 
-			if (olddev->ibi->enabled) {
+			if (olddev->ibi->enabled)
 				enable_ibi = true;
-				i3c_dev_disable_ibi_locked(olddev);
-			}
-
+			/*
+			 * The olddev should not receive any commands on the
+			 * i3c bus as it does not exist and has been assigned
+			 * a new address. This will result in NACK or timeout.
+			 * So, update the olddev->ibi->enabled flag to false
+			 * to avoid DISEC with OldAddr.
+			 */
+			olddev->ibi->enabled = false;
 			i3c_dev_free_ibi_locked(olddev);
 		}
 		mutex_unlock(&olddev->ibi_lock);




[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