Skip to content

Commit 57cf46c

Browse files
juhosgbroonie
authored andcommitted
spi: spi-qpic-snand: document the limited bit error reporting capability
The QPIC hardware is not capable of reporting the exact number of the corrected bit errors, it only reports the number of the corrected bytes. Document this behaviour in the code, and also issue a warning message to inform the user about it. No functional changes. Signed-off-by: Gabor Juhos <[email protected]> Link: https://patch.msgid.link/20250527-qpic-snand-limited-biterr-caps-v1-1-61f7cf87be1e@gmail.com Signed-off-by: Mark Brown <[email protected]>
1 parent 3d6d84c commit 57cf46c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/spi/spi-qpic-snand.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,20 @@ static int qcom_spi_check_error(struct qcom_nand_controller *snandc)
639639
unsigned int stat;
640640

641641
stat = buffer & BS_CORRECTABLE_ERR_MSK;
642+
643+
/*
644+
* The exact number of the corrected bits is
645+
* unknown because the hardware only reports the
646+
* number of the corrected bytes.
647+
*
648+
* Since we have no better solution at the moment,
649+
* report that value as the number of bit errors
650+
* despite that it is inaccurate in most cases.
651+
*/
652+
if (stat && stat != ecc_cfg->strength)
653+
dev_warn_once(snandc->dev,
654+
"Warning: due to hw limitation, the reported number of the corrected bits may be inaccurate\n");
655+
642656
snandc->qspi->ecc_stats.corrected += stat;
643657
max_bitflips = max(max_bitflips, stat);
644658
}

0 commit comments

Comments
 (0)