linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: spi-qpic-snand: don't hardcode ECC steps
@ 2025-07-23  8:06 Gabor Juhos
  2025-07-23 15:46 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Gabor Juhos @ 2025-07-23  8:06 UTC (permalink / raw)
  To: Mark Brown, Varadarajan Narayanan, Md Sadre Alam,
	Sricharan Ramabadhran
  Cc: linux-spi, linux-mtd, linux-arm-msm, linux-kernel, Gabor Juhos

NAND devices with different page sizes requires different number
of ECC steps, yet the qcom_spi_ecc_init_ctx_pipelined() function
sets 4 steps in 'ecc_cfg' unconditionally.

The correct number of the steps is calculated earlier in the
function already, so use that instead of the hardcoded value.

Fixes: 7304d1909080 ("spi: spi-qpic: add driver for QCOM SPI NAND flash Interface")
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
---
 drivers/spi/spi-qpic-snand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-qpic-snand.c b/drivers/spi/spi-qpic-snand.c
index c49bf7079808a1933c8a630e0b07b5fd54dfddb6..8fb8895bc9b54f2095981c975c1f412045a5db74 100644
--- a/drivers/spi/spi-qpic-snand.c
+++ b/drivers/spi/spi-qpic-snand.c
@@ -313,7 +313,7 @@ static int qcom_spi_ecc_init_ctx_pipelined(struct nand_device *nand)
 	ecc_cfg->bch_enabled = true;
 	ecc_cfg->bytes = ecc_cfg->ecc_bytes_hw + ecc_cfg->spare_bytes + ecc_cfg->bbm_size;
 
-	ecc_cfg->steps = 4;
+	ecc_cfg->steps = cwperpage;
 	ecc_cfg->cw_data = 516;
 	ecc_cfg->cw_size = ecc_cfg->cw_data + ecc_cfg->bytes;
 	bad_block_byte = mtd->writesize - ecc_cfg->cw_size * (cwperpage - 1) + 1;

---
base-commit: 69e536c93242425fc65580b02d3f781a96403660
change-id: 20250723-qpic-snand-fix-steps-d69b2c7761cd

Best regards,
-- 
Gabor Juhos <j4g8y7@gmail.com>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] spi: spi-qpic-snand: don't hardcode ECC steps
  2025-07-23  8:06 [PATCH] spi: spi-qpic-snand: don't hardcode ECC steps Gabor Juhos
@ 2025-07-23 15:46 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-07-23 15:46 UTC (permalink / raw)
  To: Varadarajan Narayanan, Md Sadre Alam, Sricharan Ramabadhran,
	Gabor Juhos
  Cc: linux-spi, linux-mtd, linux-arm-msm, linux-kernel

On Wed, 23 Jul 2025 10:06:43 +0200, Gabor Juhos wrote:
> NAND devices with different page sizes requires different number
> of ECC steps, yet the qcom_spi_ecc_init_ctx_pipelined() function
> sets 4 steps in 'ecc_cfg' unconditionally.
> 
> The correct number of the steps is calculated earlier in the
> function already, so use that instead of the hardcoded value.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: spi-qpic-snand: don't hardcode ECC steps
      commit: f820034864dd463cdcd2bebe7940f2eca0eb4223

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-23 15:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-23  8:06 [PATCH] spi: spi-qpic-snand: don't hardcode ECC steps Gabor Juhos
2025-07-23 15:46 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).