Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: remove struct spi_message::is_dma_mapped

There are no more users of the deprecated is_dma_mapped in struct
spi_message so it can be removed.

References in documentation and comments are also removed.

A few similar checks if xfer->tx_dma or xfer->rx_dma are not NULL are
also removed since these are now guaranteed to be NULL because they
were previously set only if is_dma_mapped was true.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://msgid.link/r/20240325-spi-remove-is_dma_mapped-v2-1-d08d62b61f1c@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

David Lechner and committed by
Mark Brown
9b163e0d 6defadbe

+5 -39
-3
Documentation/spi/pxa2xx.rst
··· 194 194 a per "spi_transfer" basis:: 195 195 196 196 if spi_message.len > 65536 then 197 - if spi_message.is_dma_mapped or rx_dma_buf != 0 or tx_dma_buf != 0 then 198 - reject premapped transfers 199 - 200 197 print "rate limited" warning 201 198 use PIO transfers 202 199
-4
Documentation/spi/spi-summary.rst
··· 419 419 to make extra copies unless the hardware requires it (e.g. working 420 420 around hardware errata that force the use of bounce buffering). 421 421 422 - If standard dma_map_single() handling of these buffers is inappropriate, 423 - you can use spi_message.is_dma_mapped to tell the controller driver 424 - that you've already provided the relevant DMA addresses. 425 - 426 422 - The basic I/O primitive is spi_async(). Async requests may be 427 423 issued in any context (irq handler, task, etc) and completion 428 424 is reported using a callback provided with the message.
+2 -6
drivers/spi/spi-atmel.c
··· 987 987 * For DMA, tx_buf/tx_dma have the same relationship as rx_buf/rx_dma: 988 988 * - The buffer is either valid for CPU access, else NULL 989 989 * - If the buffer is valid, so is its DMA address 990 - * 991 - * This driver manages the dma address unless message->is_dma_mapped. 992 990 */ 993 991 static int 994 992 atmel_spi_dma_map_xfer(struct atmel_spi *as, struct spi_transfer *xfer) ··· 1372 1374 * DMA map early, for performance (empties dcache ASAP) and 1373 1375 * better fault reporting. 1374 1376 */ 1375 - if ((!host->cur_msg->is_dma_mapped) 1376 - && as->use_pdc) { 1377 + if (as->use_pdc) { 1377 1378 if (atmel_spi_dma_map_xfer(as, xfer) < 0) 1378 1379 return -ENOMEM; 1379 1380 } ··· 1451 1454 } 1452 1455 } 1453 1456 1454 - if (!host->cur_msg->is_dma_mapped 1455 - && as->use_pdc) 1457 + if (as->use_pdc) 1456 1458 atmel_spi_dma_unmap_xfer(host, xfer); 1457 1459 1458 1460 if (as->use_pdc)
-11
drivers/spi/spi-pxa2xx.c
··· 944 944 struct spi_transfer *transfer) 945 945 { 946 946 struct driver_data *drv_data = spi_controller_get_devdata(controller); 947 - struct spi_message *message = controller->cur_msg; 948 947 struct chip_data *chip = spi_get_ctldata(spi); 949 948 u32 dma_thresh = chip->dma_threshold; 950 949 u32 dma_burst = chip->dma_burst_size; ··· 958 959 959 960 /* Check if we can DMA this transfer */ 960 961 if (transfer->len > MAX_DMA_LEN && chip->enable_dma) { 961 - 962 - /* Reject already-mapped transfers; PIO won't always work */ 963 - if (message->is_dma_mapped 964 - || transfer->rx_dma || transfer->tx_dma) { 965 - dev_err(&spi->dev, 966 - "Mapped transfer length of %u is greater than %d\n", 967 - transfer->len, MAX_DMA_LEN); 968 - return -EINVAL; 969 - } 970 - 971 962 /* Warn ... we force this to PIO mode */ 972 963 dev_warn_ratelimited(&spi->dev, 973 964 "DMA disabled for transfer length %u greater than %d\n",
-7
drivers/spi/spi.c
··· 3709 3709 * to the same values as *xferp, so tx_buf, rx_buf and len 3710 3710 * are all identical (as well as most others) 3711 3711 * so we just have to fix up len and the pointers. 3712 - * 3713 - * This also includes support for the depreciated 3714 - * spi_message.is_dma_mapped interface. 3715 3712 */ 3716 3713 3717 3714 /* ··· 3722 3725 /* Update rx_buf, tx_buf and DMA */ 3723 3726 if (xfers[i].rx_buf) 3724 3727 xfers[i].rx_buf += offset; 3725 - if (xfers[i].rx_dma) 3726 - xfers[i].rx_dma += offset; 3727 3728 if (xfers[i].tx_buf) 3728 3729 xfers[i].tx_buf += offset; 3729 - if (xfers[i].tx_dma) 3730 - xfers[i].tx_dma += offset; 3731 3730 3732 3731 /* Update length */ 3733 3732 xfers[i].len = min(maxsize, xfers[i].len - offset);
+3 -8
include/linux/spi/spi.h
··· 955 955 * struct spi_transfer - a read/write buffer pair 956 956 * @tx_buf: data to be written (DMA-safe memory), or NULL 957 957 * @rx_buf: data to be read (DMA-safe memory), or NULL 958 - * @tx_dma: DMA address of tx_buf, if @spi_message.is_dma_mapped 959 - * @rx_dma: DMA address of rx_buf, if @spi_message.is_dma_mapped 958 + * @tx_dma: DMA address of tx_buf, currently not for client use 959 + * @rx_dma: DMA address of rx_buf, currently not for client use 960 960 * @tx_nbits: number of bits used for writing. If 0 the default 961 961 * (SPI_NBITS_SINGLE) is used. 962 962 * @rx_nbits: number of bits used for reading. If 0 the default ··· 1066 1066 /* 1067 1067 * It's okay if tx_buf == rx_buf (right?). 1068 1068 * For MicroWire, one buffer must be NULL. 1069 - * Buffers must work with dma_*map_single() calls, unless 1070 - * spi_message.is_dma_mapped reports a pre-existing mapping. 1069 + * Buffers must work with dma_*map_single() calls. 1071 1070 */ 1072 1071 const void *tx_buf; 1073 1072 void *rx_buf; ··· 1110 1111 * struct spi_message - one multi-segment SPI transaction 1111 1112 * @transfers: list of transfer segments in this transaction 1112 1113 * @spi: SPI device to which the transaction is queued 1113 - * @is_dma_mapped: if true, the caller provided both DMA and CPU virtual 1114 - * addresses for each transfer buffer 1115 1114 * @pre_optimized: peripheral driver pre-optimized the message 1116 1115 * @optimized: the message is in the optimized state 1117 1116 * @prepared: spi_prepare_message was called for the this message ··· 1142 1145 struct list_head transfers; 1143 1146 1144 1147 struct spi_device *spi; 1145 - 1146 - unsigned is_dma_mapped:1; 1147 1148 1148 1149 /* spi_optimize_message() was called for this message */ 1149 1150 bool pre_optimized;