Patch "driver core: Call dma_cleanup() on the test_remove path" has been added to the 6.4-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

    driver core: Call dma_cleanup() on the test_remove path

to the 6.4-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:
     driver-core-call-dma_cleanup-on-the-test_remove-path.patch
and it can be found in the queue-6.4 subdirectory.

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



commit d49a753d2eb4cd0d0c936dfbc5184d9df5ea8016
Author: Jason Gunthorpe <jgg@xxxxxxxx>
Date:   Mon Jul 24 14:40:46 2023 -0300

    driver core: Call dma_cleanup() on the test_remove path
    
    [ Upstream commit f429378a9bf84d79a7e2cae05d2e3384cf7d68ba ]
    
    When test_remove is enabled really_probe() does not properly pair
    dma_configure() with dma_remove(), it will end up calling dma_configure()
    twice. This corrupts the owner_cnt and renders the group unusable with
    VFIO/etc.
    
    Add the missing cleanup before going back to re_probe.
    
    Fixes: 25f3bcfc54bc ("driver core: Add dma_cleanup callback in bus_type")
    Reported-by: Zenghui Yu <yuzenghui@xxxxxxxxxx>
    Tested-by: Zenghui Yu <yuzenghui@xxxxxxxxxx>
    Closes: https://lore.kernel.org/all/6472f254-c3c4-8610-4a37-8d9dfdd54ce8@xxxxxxxxxx/
    Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
    Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>
    Link: https://lore.kernel.org/r/0-v2-4deed94e283e+40948-really_probe_dma_cleanup_jgg@xxxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 9c09ca5c4ab68..7145d9b940b14 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -693,6 +693,8 @@ static int really_probe(struct device *dev, struct device_driver *drv)
 
 		device_remove(dev);
 		driver_sysfs_remove(dev);
+		if (dev->bus && dev->bus->dma_cleanup)
+			dev->bus->dma_cleanup(dev);
 		device_unbind_cleanup(dev);
 
 		goto re_probe;



[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