Skip to content

Commit 188281e

Browse files
committed
s390/virtio_ccw: Fix dma_parm pointer not set up
JIRA: https://issues.redhat.com/browse/RHEL-69815 commit 14c7579 Author: Halil Pasic <pasic@linux.ibm.com> Date: Mon Oct 7 22:10:30 2024 +0200 s390/virtio_ccw: Fix dma_parm pointer not set up At least since commit 334304a ("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: 334304a ("dma-mapping: don't return errors from dma_set_max_seg_size") Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com> Reviewed-by: Eric Farman <farman@linux.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Tested-by: Marc Hartmayer <mhartmay@linux.ibm.com> Link: https://lore.kernel.org/r/20241007201030.204028-1-pasic@linux.ibm.com Signed-off-by: Halil Pasic <pasic@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
1 parent db1120b commit 188281e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/s390/virtio/virtio_ccw.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ struct virtio_ccw_device {
5858
struct virtio_device vdev;
5959
__u8 config[VIRTIO_CCW_CONFIG_SIZE];
6060
struct ccw_device *cdev;
61+
/* we make cdev->dev.dma_parms point to this */
62+
struct device_dma_parameters dma_parms;
6163
__u32 curr_io;
6264
int err;
6365
unsigned int revision; /* Transport revision */
@@ -1303,6 +1305,7 @@ static int virtio_ccw_offline(struct ccw_device *cdev)
13031305
unregister_virtio_device(&vcdev->vdev);
13041306
spin_lock_irqsave(get_ccwdev_lock(cdev), flags);
13051307
dev_set_drvdata(&cdev->dev, NULL);
1308+
cdev->dev.dma_parms = NULL;
13061309
spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags);
13071310
return 0;
13081311
}
@@ -1366,6 +1369,7 @@ static int virtio_ccw_online(struct ccw_device *cdev)
13661369
}
13671370
vcdev->vdev.dev.parent = &cdev->dev;
13681371
vcdev->cdev = cdev;
1372+
cdev->dev.dma_parms = &vcdev->dma_parms;
13691373
vcdev->dma_area = ccw_device_dma_zalloc(vcdev->cdev,
13701374
sizeof(*vcdev->dma_area),
13711375
&vcdev->dma_area_addr);

0 commit comments

Comments
 (0)