Skip to content

Commit

Permalink
Revert "spi: zynq_qspi: Use dummy buswidth in dummy byte calculation"
Browse files Browse the repository at this point in the history
This reverts commit e097847. The
commit wrongly divides the dummy bytes by dummy bus width to calculate
the dummy bytes. The framework already converts the dummy cycles to the
number of bytes and the controller use the SPI flash command to
determine the dummy cycles via the address width.

Signed-off-by: Stefan Herbrechtsmeier <[email protected]>
Acked-by: Ashok Reddy Soma <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michal Simek <[email protected]>
  • Loading branch information
herbrechtsmeier authored and michalsimek committed May 15, 2023
1 parent 04d66e7 commit 99c1aba
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/spi/zynq_qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,6 @@ static int zynq_qspi_exec_op(struct spi_slave *slave,
const struct spi_mem_op *op)
{
int op_len, pos = 0, ret, i;
u32 dummy_bytes = 0;
unsigned int flag = 0;
const u8 *tx_buf = NULL;
u8 *rx_buf = NULL;
Expand All @@ -689,11 +688,6 @@ static int zynq_qspi_exec_op(struct spi_slave *slave,
}

op_len = op->cmd.nbytes + op->addr.nbytes + op->dummy.nbytes;
if (op->dummy.nbytes) {
op_len = op->cmd.nbytes + op->addr.nbytes +
op->dummy.nbytes / op->dummy.buswidth;
dummy_bytes = op->dummy.nbytes / op->dummy.buswidth;
}

u8 op_buf[op_len];

Expand All @@ -707,8 +701,8 @@ static int zynq_qspi_exec_op(struct spi_slave *slave,
pos += op->addr.nbytes;
}

if (dummy_bytes)
memset(op_buf + pos, 0xff, dummy_bytes);
if (op->dummy.nbytes)
memset(op_buf + pos, 0xff, op->dummy.nbytes);

/* 1st transfer: opcode + address + dummy cycles */
/* Make sure to set END bit if no tx or rx data messages follow */
Expand Down

0 comments on commit 99c1aba

Please sign in to comment.