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.

Merge tag 'spi-fix-v6.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
"A couple of hopefully final fixes for spi: one driver specific fix for
an issue with very large transfers and a fix for an issue with the
locking fixes in spidev merged earlier this release cycle which was
missed"

* tag 'spi-fix-v6.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
spi: spidev: fix a recursive locking error
spi: dw: Fix wrong FIFO level setting for long xfers

+17 -7
+1 -1
drivers/spi/spi-dw-core.c
··· 366 366 * will be adjusted at the final stage of the IRQ-based SPI transfer 367 367 * execution so not to lose the leftover of the incoming data. 368 368 */ 369 - level = min_t(u16, dws->fifo_len / 2, dws->tx_len); 369 + level = min_t(unsigned int, dws->fifo_len / 2, dws->tx_len); 370 370 dw_writel(dws, DW_SPI_TXFTLR, level); 371 371 dw_writel(dws, DW_SPI_RXFTLR, level - 1); 372 372
+16 -6
drivers/spi/spidev.c
··· 90 90 /*-------------------------------------------------------------------------*/ 91 91 92 92 static ssize_t 93 + spidev_sync_unlocked(struct spi_device *spi, struct spi_message *message) 94 + { 95 + ssize_t status; 96 + 97 + status = spi_sync(spi, message); 98 + if (status == 0) 99 + status = message->actual_length; 100 + 101 + return status; 102 + } 103 + 104 + static ssize_t 93 105 spidev_sync(struct spidev_data *spidev, struct spi_message *message) 94 106 { 95 - int status; 107 + ssize_t status; 96 108 struct spi_device *spi; 97 109 98 110 mutex_lock(&spidev->spi_lock); ··· 113 101 if (spi == NULL) 114 102 status = -ESHUTDOWN; 115 103 else 116 - status = spi_sync(spi, message); 117 - 118 - if (status == 0) 119 - status = message->actual_length; 104 + status = spidev_sync_unlocked(spi, message); 120 105 121 106 mutex_unlock(&spidev->spi_lock); 107 + 122 108 return status; 123 109 } 124 110 ··· 304 294 spi_message_add_tail(k_tmp, &msg); 305 295 } 306 296 307 - status = spidev_sync(spidev, &msg); 297 + status = spidev_sync_unlocked(spidev->spi, &msg); 308 298 if (status < 0) 309 299 goto done; 310 300