linux-stable/drivers/s390/net
Gerd Bayer 83781384a9 s390/ism: Properly 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-17 12:55:49 +01:00
..
ctcm_dbug.c s390/ctcm: Convert sprintf/snprintf to scnprintf 2023-06-23 11:55:55 +02:00
ctcm_dbug.h s390/ctcm: add __printf format attribute to ctcm_dbf_longtext 2021-11-19 11:12:30 +00:00
ctcm_fsms.c s390/ctcm: use new address translation helpers 2024-03-13 09:23:48 +01:00
ctcm_fsms.h
ctcm_main.c s390/ctcm: use new address translation helpers 2024-03-13 09:23:48 +01:00
ctcm_main.h s390/ctcm: Convert sprintf/snprintf to scnprintf 2023-06-23 11:55:55 +02:00
ctcm_mpc.c s390/ctcm: use new address translation helpers 2024-03-13 09:23:48 +01:00
ctcm_mpc.h
ctcm_sysfs.c s390/ctcm: Convert sprintf/snprintf to scnprintf 2023-06-23 11:55:55 +02:00
fsm.c Normalise "name (ad@dr)" MODULE_AUTHORs to "name <ad@dr>" 2024-03-06 13:07:39 -08:00
fsm.h
ism.h net/smc: manage system EID in SMC stack instead of ISM driver 2023-12-26 20:24:33 +00:00
ism_drv.c s390/ism: Properly fix receive message buffer allocation 2024-04-17 12:55:49 +01:00
Kconfig s390/ism: ism driver implies smc protocol 2023-11-17 00:31:00 +00:00
lcs.c s390/lcs: use new address translation helpers 2024-03-13 09:23:48 +01:00
lcs.h s390/lcs: Convert sprintf to scnprintf 2023-06-23 11:55:54 +02:00
Makefile
netiucv.c s390: include linux/io.h instead of asm/io.h 2023-07-03 11:19:40 +02:00
qeth_core.h s390/qeth: Don't call dev_close/dev_open (DOWN/UP) 2023-08-02 10:12:51 +01:00
qeth_core_main.c s390/qeth: handle deferred cc1 2024-03-25 19:46:49 -07:00
qeth_core_mpc.c
qeth_core_mpc.h
qeth_core_sys.c s390/qeth: Convert sysfs sprintf to sysfs_emit 2023-02-10 19:49:53 -08:00
qeth_ethtool.c s390/qeth: Convert sprintf/snprintf to scnprintf 2023-02-10 19:49:53 -08:00
qeth_l2.h
qeth_l2_main.c s390/qeth: Don't call dev_close/dev_open (DOWN/UP) 2023-08-02 10:12:51 +01:00
qeth_l2_sys.c s390/qeth: Convert sysfs sprintf to sysfs_emit 2023-02-10 19:49:53 -08:00
qeth_l3.h
qeth_l3_main.c s390/qeth: Fix potential loss of L3-IP@ in case of network issues 2024-02-08 12:10:09 +01:00
qeth_l3_sys.c s390/qeth: Fix vipa deletion 2023-07-05 10:47:45 +01:00
smsgiucv.c
smsgiucv.h
smsgiucv_app.c