Skip to content

Commit d4f43a2

Browse files
DhruvaG2000broonie
authored andcommitted
spi: cadence-quadspi: Reset CMD_CTRL Reg on cmd r/w completion
If one leaves the CQSPI_REG_CMDCTRL in an unclean state this may cause issues in future command reads. This issue came to light when some flash reads in STIG mode were coming back dirty. Signed-off-by: Dhruva Gole <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 937ca91 commit d4f43a2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/spi/spi-cadence-quadspi.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,9 @@ static int cqspi_command_read(struct cqspi_flash_pdata *f_pdata,
549549
memcpy(rxbuf, &reg, read_len);
550550
}
551551

552+
/* Reset CMD_CTRL Reg once command read completes */
553+
writel(0, reg_base + CQSPI_REG_CMDCTRL);
554+
552555
return 0;
553556
}
554557

@@ -613,7 +616,12 @@ static int cqspi_command_write(struct cqspi_flash_pdata *f_pdata,
613616
}
614617
}
615618

616-
return cqspi_exec_flash_cmd(cqspi, reg);
619+
ret = cqspi_exec_flash_cmd(cqspi, reg);
620+
621+
/* Reset CMD_CTRL Reg once command write completes */
622+
writel(0, reg_base + CQSPI_REG_CMDCTRL);
623+
624+
return ret;
617625
}
618626

619627
static int cqspi_read_setup(struct cqspi_flash_pdata *f_pdata,

0 commit comments

Comments
 (0)