Pull spi fixes from Mark Brown: "A couple of fixes that came in during the merge window: a driver fix for spurious timeouts in the fsi driver and an improvement to make the core display error messages for transfer_one_message() to help people debug things" * tag 'spi-fix-v5.19-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: core: Display return code when failing to transfer message spi: fsi: Fix spurious timeout
Unified · Split
| @@ -319,12 +319,12 @@ static int fsi_spi_transfer_data(struct fsi_spi *ctx, · 318 unmodified lines | |||
| 319 | 319 | ||
| 320 | end = jiffies + msecs_to_jiffies(SPI_FSI_STATUS_TIMEOUT_MS); | 320 | end = jiffies + msecs_to_jiffies(SPI_FSI_STATUS_TIMEOUT_MS); |
| 321 | do { | 321 | do { |
| 322 | if (time_after(jiffies, end)) | ||
| 323 | return -ETIMEDOUT; | ||
| 324 | |||
| 322 | rc = fsi_spi_status(ctx, &status, "TX"); | 325 | rc = fsi_spi_status(ctx, &status, "TX"); |
| 323 | if (rc) | 326 | if (rc) |
| 324 | return rc; | 327 | return rc; |
| 325 | |||
| 326 | if (time_after(jiffies, end)) | ||
| 327 | return -ETIMEDOUT; | ||
| 328 | } while (status & SPI_FSI_STATUS_TDR_FULL); | 328 | } while (status & SPI_FSI_STATUS_TDR_FULL); |
| 329 | 329 | ||
| 330 | sent += nb; | 330 | sent += nb; |
| @@ -337,12 +337,12 @@ static int fsi_spi_transfer_data(struct fsi_spi *ctx, · 6 unmodified lines | |||
| 337 | while (transfer->len > recv) { | 337 | while (transfer->len > recv) { |
| 338 | end = jiffies + msecs_to_jiffies(SPI_FSI_STATUS_TIMEOUT_MS); | 338 | end = jiffies + msecs_to_jiffies(SPI_FSI_STATUS_TIMEOUT_MS); |
| 339 | do { | 339 | do { |
| 340 | if (time_after(jiffies, end)) | ||
| 341 | return -ETIMEDOUT; | ||
| 342 | |||
| 340 | rc = fsi_spi_status(ctx, &status, "RX"); | 343 | rc = fsi_spi_status(ctx, &status, "RX"); |
| 341 | if (rc) | 344 | if (rc) |
| 342 | return rc; | 345 | return rc; |
| 343 | |||
| 344 | if (time_after(jiffies, end)) | ||
| 345 | return -ETIMEDOUT; | ||
| 346 | } while (!(status & SPI_FSI_STATUS_RDR_FULL)); | 346 | } while (!(status & SPI_FSI_STATUS_RDR_FULL)); |
| 347 | 347 | ||
| 348 | rc = fsi_spi_read_reg(ctx, SPI_FSI_DATA_RX, &in); | 348 | rc = fsi_spi_read_reg(ctx, SPI_FSI_DATA_RX, &in); |
| @@ -1672,7 +1672,8 @@ static void __spi_pump_messages(struct spi_controller *ctlr, bool in_kthread) · 1671 unmodified lines | |||
| 1672 | ret = ctlr->transfer_one_message(ctlr, msg); | 1672 | ret = ctlr->transfer_one_message(ctlr, msg); |
| 1673 | if (ret) { | 1673 | if (ret) { |
| 1674 | dev_err(&ctlr->dev, | 1674 | dev_err(&ctlr->dev, |
| 1675 | "failed to transfer one message from queue\n"); | 1675 | "failed to transfer one message from queue: %d\n", |
| 1676 | ret); | ||
| 1676 | goto out; | 1677 | goto out; |
| 1677 | } | 1678 | } |
| 1678 | 1679 | ||