linux-stable/drivers/s390
Gerd Bayer 58effa3476 s390/ism: fix receive message buffer allocation
Since [1], dma_alloc_coherent() does not accept requests for GFP_COMP
anymore, even on archs that may be able to fulfill this. Functionality that
relied on the receive buffer being a compound page broke at that point:
The SMC-D protocol, that utilizes the ism device driver, passes receive
buffers to the splice processor in a struct splice_pipe_desc with a
single entry list of struct pages. As the buffer is no longer a compound
page, the splice processor now rejects requests to handle more than a
page worth of data.

Replace dma_alloc_coherent() and allocate a buffer with folio_alloc and
create a DMA map for it with dma_map_page(). Since only receive buffers
on ISM devices use DMA, qualify the mapping as FROM_DEVICE.
Since ISM devices are available on arch s390, only and on that arch all
DMA is coherent, there is no need to introduce and export some kind of
dma_sync_to_cpu() method to be called by the SMC-D protocol layer.

Analogously, replace dma_free_coherent by a two step dma_unmap_page,
then folio_put to free the receive buffer.

[1] https://lore.kernel.org/all/20221113163535.884299-1-hch@lst.de/

Fixes: c08004eede ("s390/ism: don't pass bogus GFP_ flags to dma_alloc_coherent")
Signed-off-by: Gerd Bayer <gbayer@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-04-08 11:55:45 +01:00
..
block more s390 updates for 6.9 merge window 2024-03-19 11:38:27 -07:00
char more s390 updates for 6.9 merge window 2024-03-19 11:38:27 -07:00
cio s390/cio: use while (i--) pattern to clean up 2024-03-17 19:08:49 +01:00
crypto s390/zcrypt: make zcrypt_class constant 2024-03-13 09:23:49 +01:00
net s390/ism: fix receive message buffer allocation 2024-04-08 11:55:45 +01:00
scsi s390/zfcp: use new address translation helpers 2024-03-13 09:23:48 +01:00
virtio s390/virtio_ccw: avoid converting dma addresses / handles 2024-03-13 09:23:46 +01:00
Makefile