android_kernel_motorola_sm6375/drivers/virtio
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Will Deacon c0954f1010 virtio_ring: Fix querying of maximum DMA mapping size for virtio device
commit 817fc978b5a29b039db0418a91072b31c9aab152 upstream.

virtio_max_dma_size() returns the maximum DMA mapping size of the virtio
device by querying dma_max_mapping_size() for the device when the DMA
API is in use for the vring. Unfortunately, the device passed is
initialised by register_virtio_device() and does not inherit the DMA
configuration from its parent, resulting in SWIOTLB errors when bouncing
is enabled and the default 256K mapping limit (IO_TLB_SEGSIZE) is not
respected:

  | virtio-pci 0000:00:01.0: swiotlb buffer is full (sz: 294912 bytes), total 1024 (slots), used 725 (slots)

Follow the pattern used elsewhere in the virtio_ring code when calling
into the DMA layer and pass the parent device to dma_max_mapping_size()
instead.

Cc: Marc Zyngier <[email protected]>
Cc: Quentin Perret <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Jason Wang <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Acked-by: Jason Wang <[email protected]>
Tested-by: Suzuki K Poulose <[email protected]>
Fixes: e6d6dd6c87 ("virtio: Introduce virtio_max_dma_size()")
Cc: Joerg Roedel <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Robin Murphy <[email protected]>
Signed-off-by: Steven Price <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Cc: [email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-12-22 09:29:34 +01:00
..
Kconfig
Makefile
virtio.c virtio: write back F_VERSION_1 before validate 2021-10-20 11:40:14 +02:00
virtio_balloon.c
virtio_input.c
virtio_mmio.c
virtio_pci_common.c virtio_pci: Support surprise removal of virtio pci device 2021-09-03 10:08:15 +02:00
virtio_pci_common.h
virtio_pci_legacy.c
virtio_pci_modern.c
virtio_ring.c virtio_ring: Fix querying of maximum DMA mapping size for virtio device 2021-12-22 09:29:34 +01:00