Patch "coresight: Fix loss of connection info when a module is unloaded" has been added to the 5.10-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

    coresight: Fix loss of connection info when a module is unloaded

to the 5.10-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:
     coresight-fix-loss-of-connection-info-when-a-module-.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 61f796fd8aa474d8168da226aa04ea505203440b
Author: James Clark <james.clark@xxxxxxx>
Date:   Tue Apr 25 15:35:28 2023 +0100

    coresight: Fix loss of connection info when a module is unloaded
    
    [ Upstream commit c45b2835e7b205783bdfe08cc98fa86a7c5eeb74 ]
    
    child_fwnode should be a read only property based on the DT or ACPI. If
    it's cleared on the parent device when a child is unloaded, then when
    the child is loaded again the connection won't be remade.
    
    child_dev should be cleared instead which signifies that the connection
    should be remade when the child_fwnode registers a new coresight_device.
    
    Similarly the reference count shouldn't be decremented as long as the
    parent device exists. The correct place to drop the reference is in
    coresight_release_platform_data() which is already done.
    
    Reproducible on Juno with the following steps:
    
      # load all coresight modules.
      $ cd /sys/bus/coresight/devices/
      $ echo 1 > tmc_etr0/enable_sink
      $ echo 1 > etm0/enable_source
      # Works fine ^
    
      $ echo 0 > etm0/enable_source
      $ rmmod coresight-funnel
      $ modprobe coresight-funnel
      $ echo 1 > etm0/enable_source
      -bash: echo: write error: Invalid argument
    
    Fixes: 37ea1ffddffa ("coresight: Use fwnode handle instead of device names")
    Fixes: 2af89ebacf29 ("coresight: Clear the connection field properly")
    Tested-by: Suzuki K Poulose <suzuki.poulose@xxxxxxx>
    Reviewed-by: Mike Leach <mike.leach@xxxxxxxxxx>
    Signed-off-by: James Clark <james.clark@xxxxxxx>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@xxxxxxx>
    Link: https://lore.kernel.org/r/20230425143542.2305069-2-james.clark@xxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
index 5ddc8103503b5..c4b805b045316 100644
--- a/drivers/hwtracing/coresight/coresight-core.c
+++ b/drivers/hwtracing/coresight/coresight-core.c
@@ -1376,13 +1376,8 @@ static int coresight_remove_match(struct device *dev, void *data)
 		if (csdev->dev.fwnode == conn->child_fwnode) {
 			iterator->orphan = true;
 			coresight_remove_links(iterator, conn);
-			/*
-			 * Drop the reference to the handle for the remote
-			 * device acquired in parsing the connections from
-			 * platform data.
-			 */
-			fwnode_handle_put(conn->child_fwnode);
-			conn->child_fwnode = NULL;
+
+			conn->child_dev = NULL;
 			/* No need to continue */
 			break;
 		}



[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