Skip to content

Commit 093b2dc

Browse files
committed
Merge tag 'spi-fix-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi fixes from Mark Brown: "A small set of fixes for SPI drivers, Krishna has been doing a bunch of work on Tegra210 QuadSPI and found a bunch of issues there and there's a couple of small fixes for other drivers too" * tag 'spi-fix-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: tegra210-quad: Fix iterator outside loop spi: tegra210-quad: Fix validate combined sequence spi: tegra210-quad: set half duplex flag spi: spi-sn-f-ospi: fix duplicate flag while assigning to mode_bits spi: cadence-quadspi: Fix cancel the indirect read mask
2 parents fd7ee8d + 2449d43 commit 093b2dc

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

drivers/spi/spi-cadence-quadspi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ static int cqspi_indirect_read_execute(struct cqspi_flash_pdata *f_pdata,
786786
writel(0, reg_base + CQSPI_REG_IRQMASK);
787787

788788
/* Cancel the indirect read */
789-
writel(CQSPI_REG_INDIRECTWR_CANCEL_MASK,
789+
writel(CQSPI_REG_INDIRECTRD_CANCEL_MASK,
790790
reg_base + CQSPI_REG_INDIRECTRD);
791791
return ret;
792792
}

drivers/spi/spi-sn-f-ospi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ static int f_ospi_probe(struct platform_device *pdev)
611611
return -ENOMEM;
612612

613613
ctlr->mode_bits = SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL
614-
| SPI_RX_DUAL | SPI_RX_QUAD | SPI_TX_OCTAL
614+
| SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL
615615
| SPI_MODE_0 | SPI_MODE_1 | SPI_LSB_FIRST;
616616
ctlr->mem_ops = &f_ospi_mem_ops;
617617
ctlr->bus_num = -1;

drivers/spi/spi-tegra210-quad.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,6 +1156,10 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi,
11561156
ret = -EIO;
11571157
goto exit;
11581158
}
1159+
if (!xfer->cs_change) {
1160+
tegra_qspi_transfer_end(spi);
1161+
spi_transfer_delay_exec(xfer);
1162+
}
11591163
break;
11601164
default:
11611165
ret = -EINVAL;
@@ -1164,14 +1168,14 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi,
11641168
msg->actual_length += xfer->len;
11651169
transfer_phase++;
11661170
}
1167-
if (!xfer->cs_change) {
1168-
tegra_qspi_transfer_end(spi);
1169-
spi_transfer_delay_exec(xfer);
1170-
}
11711171
ret = 0;
11721172

11731173
exit:
11741174
msg->status = ret;
1175+
if (ret < 0) {
1176+
tegra_qspi_transfer_end(spi);
1177+
spi_transfer_delay_exec(xfer);
1178+
}
11751179

11761180
return ret;
11771181
}
@@ -1297,7 +1301,7 @@ static bool tegra_qspi_validate_cmb_seq(struct tegra_qspi *tqspi,
12971301
if (xfer->len > 4 || xfer->len < 3)
12981302
return false;
12991303
xfer = list_next_entry(xfer, transfer_list);
1300-
if (!tqspi->soc_data->has_dma || xfer->len > (QSPI_FIFO_DEPTH << 2))
1304+
if (!tqspi->soc_data->has_dma && xfer->len > (QSPI_FIFO_DEPTH << 2))
13011305
return false;
13021306

13031307
return true;
@@ -1532,6 +1536,7 @@ static int tegra_qspi_probe(struct platform_device *pdev)
15321536
master->mode_bits = SPI_MODE_0 | SPI_MODE_3 | SPI_CS_HIGH |
15331537
SPI_TX_DUAL | SPI_RX_DUAL | SPI_TX_QUAD | SPI_RX_QUAD;
15341538
master->bits_per_word_mask = SPI_BPW_MASK(32) | SPI_BPW_MASK(16) | SPI_BPW_MASK(8);
1539+
master->flags = SPI_CONTROLLER_HALF_DUPLEX;
15351540
master->setup = tegra_qspi_setup;
15361541
master->transfer_one_message = tegra_qspi_transfer_one_message;
15371542
master->num_chipselect = 1;

0 commit comments

Comments
 (0)