Patch "Coresight: Set correct cs_mode for dummy source to fix disable issue" has been added to the 6.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: Set correct cs_mode for dummy source to fix disable issue

to the 6.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-set-correct-cs_mode-for-dummy-source-to-fi.patch
and it can be found in the queue-6.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 4fb370d94c8bd701d17dd10274d1e814d520f5c6
Author: Jie Gan <quic_jiegan@xxxxxxxxxxx>
Date:   Mon Aug 12 12:28:44 2024 +0800

    Coresight: Set correct cs_mode for dummy source to fix disable issue
    
    [ Upstream commit e6b64cda393efd84709ab3df2e42d36d36d7553e ]
    
    The coresight_disable_source_sysfs function should verify the
    mode of the coresight device before disabling the source.
    However, the mode for the dummy source device is always set to
    CS_MODE_DISABLED, resulting in the check consistently failing.
    As a result, dummy source cannot be properly disabled.
    
    Configure CS_MODE_SYSFS/CS_MODE_PERF during the enablement.
    Configure CS_MODE_DISABLED during the disablement.
    
    Fixes: 9d3ba0b6c056 ("Coresight: Add coresight dummy driver")
    Signed-off-by: Jie Gan <quic_jiegan@xxxxxxxxxxx>
    Signed-off-by: Suzuki K Poulose <suzuki.poulose@xxxxxxx>
    Link: https://lore.kernel.org/r/20240812042844.2890115-1-quic_jiegan@xxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/hwtracing/coresight/coresight-dummy.c b/drivers/hwtracing/coresight/coresight-dummy.c
index ac70c0b491beb..dab389a5507c1 100644
--- a/drivers/hwtracing/coresight/coresight-dummy.c
+++ b/drivers/hwtracing/coresight/coresight-dummy.c
@@ -23,6 +23,9 @@ DEFINE_CORESIGHT_DEVLIST(sink_devs, "dummy_sink");
 static int dummy_source_enable(struct coresight_device *csdev,
 			       struct perf_event *event, enum cs_mode mode)
 {
+	if (!coresight_take_mode(csdev, mode))
+		return -EBUSY;
+
 	dev_dbg(csdev->dev.parent, "Dummy source enabled\n");
 
 	return 0;
@@ -31,6 +34,7 @@ static int dummy_source_enable(struct coresight_device *csdev,
 static void dummy_source_disable(struct coresight_device *csdev,
 				 struct perf_event *event)
 {
+	coresight_set_mode(csdev, CS_MODE_DISABLED);
 	dev_dbg(csdev->dev.parent, "Dummy source disabled\n");
 }
 




[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