Patch "s390/virtio_ccw: Fix dma_parm pointer not set up" 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

    s390/virtio_ccw: Fix dma_parm pointer not set up

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:
     s390-virtio_ccw-fix-dma_parm-pointer-not-set-up.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 60e5c449179c19389de7ea8b6fdfda78e93f94b1
Author: Halil Pasic <pasic@xxxxxxxxxxxxx>
Date:   Mon Oct 7 22:10:30 2024 +0200

    s390/virtio_ccw: Fix dma_parm pointer not set up
    
    [ Upstream commit 14c7579376279e507e52bf022192b46097a55377 ]
    
    At least since commit 334304ac2bac ("dma-mapping: don't return errors
    from dma_set_max_seg_size") setting up device.dma_parms is basically
    mandated by the DMA API. As of now Channel (CCW) I/O in general does not
    utilize the DMA API, except for virtio. For virtio-ccw however the
    common virtio DMA infrastructure is such that most of the DMA stuff
    hinges on the virtio parent device, which is a CCW device.
    
    So lets set up the dma_parms pointer for the CCW parent device and hope
    for the best!
    
    Fixes: 334304ac2bac ("dma-mapping: don't return errors from dma_set_max_seg_size")
    Reported-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxx>
    Reviewed-by: Eric Farman <farman@xxxxxxxxxxxxx>
    Reviewed-by: Cornelia Huck <cohuck@xxxxxxxxxx>
    Tested-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20241007201030.204028-1-pasic@xxxxxxxxxxxxx
    Signed-off-by: Halil Pasic <pasic@xxxxxxxxxxxxx>
    Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c
index 62eca9419ad76..21fa7ac849e5c 100644
--- a/drivers/s390/virtio/virtio_ccw.c
+++ b/drivers/s390/virtio/virtio_ccw.c
@@ -58,6 +58,8 @@ struct virtio_ccw_device {
 	struct virtio_device vdev;
 	__u8 config[VIRTIO_CCW_CONFIG_SIZE];
 	struct ccw_device *cdev;
+	/* we make cdev->dev.dma_parms point to this */
+	struct device_dma_parameters dma_parms;
 	__u32 curr_io;
 	int err;
 	unsigned int revision; /* Transport revision */
@@ -1303,6 +1305,7 @@ static int virtio_ccw_offline(struct ccw_device *cdev)
 	unregister_virtio_device(&vcdev->vdev);
 	spin_lock_irqsave(get_ccwdev_lock(cdev), flags);
 	dev_set_drvdata(&cdev->dev, NULL);
+	cdev->dev.dma_parms = NULL;
 	spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags);
 	return 0;
 }
@@ -1366,6 +1369,7 @@ static int virtio_ccw_online(struct ccw_device *cdev)
 	}
 	vcdev->vdev.dev.parent = &cdev->dev;
 	vcdev->cdev = cdev;
+	cdev->dev.dma_parms = &vcdev->dma_parms;
 	vcdev->dma_area = ccw_device_dma_zalloc(vcdev->cdev,
 						sizeof(*vcdev->dma_area),
 						&vcdev->dma_area_addr);




[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