mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
mtd: spi-nor: cadence-quadspi: Fix direct mode write timeouts
Sometimes when writing large size files to flash in direct/memory mapped
mode, it is seen that flash write enable command times out with error:
[ 503.146293] cadence-qspi 47040000.ospi: Flash command execution timed out.
This is because, we need to make sure previous direct write operation
is complete by polling for IDLE bit in CONFIG_REG before starting the
next operation.
Fix this by polling for IDLE bit after memory mapped write.
Fixes: a27f2eaf2b ("mtd: spi-nor: cadence-quadspi: Add support for direct access mode")
Cc: [email protected]
Signed-off-by: Vignesh R <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
This commit is contained in:
parent
021c91791a
commit
aa7eee8a14
1 changed files with 4 additions and 2 deletions
|
|
@ -926,10 +926,12 @@ static ssize_t cqspi_write(struct spi_nor *nor, loff_t to,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (f_pdata->use_direct_mode)
|
||||
if (f_pdata->use_direct_mode) {
|
||||
memcpy_toio(cqspi->ahb_base + to, buf, len);
|
||||
else
|
||||
ret = cqspi_wait_idle(cqspi);
|
||||
} else {
|
||||
ret = cqspi_indirect_write_execute(nor, to, buf, len);
|
||||
}
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue