spi: Fixes for v6.2
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. -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmPmcGcACgkQJNaLcl1U h9AR9gf+PPYoUik/vNzZgDZ9UBC3C8L8FK2utCJ9w3vezzc+4xY2o+Cstd+VlWjW xyy+amw3RSSh7Itd7kYKLgWOBxrOD7oFq+scjVWUcdRI1vyz2AMvgyrmpyWvyVGI MTM7LfHtoQSuIHmp4PvF4wegTI+rL0iWmWnbkX4UrsfCYVXaHss2ziHsq9YNvxc7 q2cKCDAzZFnaie7SFwc5sw16J331pV7B7GtS+OITpi+9Fmy4s0GoBZq4b8ZdOnLf sk+nUrYkGngY1+FkMOsfYoLThFPDxf94mmEyHQm1b+hzn/oQddhRPDV+Yhzu658+ L6X7afIWQvhohnQ36+vDbI0nVx5G3A== =9x2+ -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
f339c2597e
@ -366,7 +366,7 @@ static void dw_spi_irq_setup(struct dw_spi *dws)
|
||||
* will be adjusted at the final stage of the IRQ-based SPI transfer
|
||||
* execution so not to lose the leftover of the incoming data.
|
||||
*/
|
||||
level = min_t(u16, dws->fifo_len / 2, dws->tx_len);
|
||||
level = min_t(unsigned int, dws->fifo_len / 2, dws->tx_len);
|
||||
dw_writel(dws, DW_SPI_TXFTLR, level);
|
||||
dw_writel(dws, DW_SPI_RXFTLR, level - 1);
|
||||
|
||||
|
@ -89,10 +89,22 @@ MODULE_PARM_DESC(bufsiz, "data bytes in biggest supported SPI message");
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
static ssize_t
|
||||
spidev_sync_unlocked(struct spi_device *spi, struct spi_message *message)
|
||||
{
|
||||
ssize_t status;
|
||||
|
||||
status = spi_sync(spi, message);
|
||||
if (status == 0)
|
||||
status = message->actual_length;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
spidev_sync(struct spidev_data *spidev, struct spi_message *message)
|
||||
{
|
||||
int status;
|
||||
ssize_t status;
|
||||
struct spi_device *spi;
|
||||
|
||||
mutex_lock(&spidev->spi_lock);
|
||||
@ -101,12 +113,10 @@ spidev_sync(struct spidev_data *spidev, struct spi_message *message)
|
||||
if (spi == NULL)
|
||||
status = -ESHUTDOWN;
|
||||
else
|
||||
status = spi_sync(spi, message);
|
||||
|
||||
if (status == 0)
|
||||
status = message->actual_length;
|
||||
status = spidev_sync_unlocked(spi, message);
|
||||
|
||||
mutex_unlock(&spidev->spi_lock);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@ -294,7 +304,7 @@ static int spidev_message(struct spidev_data *spidev,
|
||||
spi_message_add_tail(k_tmp, &msg);
|
||||
}
|
||||
|
||||
status = spidev_sync(spidev, &msg);
|
||||
status = spidev_sync_unlocked(spidev->spi, &msg);
|
||||
if (status < 0)
|
||||
goto done;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user