120-08-v5.18-mtd-spinand-Delay-a-little-bit-the-dirmap-creation.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From 94ef3c35b935a63f6c156957c92f6cf33c9a8dae Mon Sep 17 00:00:00 2001
  2. From: Miquel Raynal <[email protected]>
  3. Date: Thu, 27 Jan 2022 10:18:02 +0100
  4. Subject: [PATCH 08/15] mtd: spinand: Delay a little bit the dirmap creation
  5. As we will soon tweak the dirmap creation to act a little bit
  6. differently depending on the picked ECC engine, we need to initialize
  7. dirmaps after ECC engines. This should not have any effect as dirmaps
  8. are not yet used at this point.
  9. Signed-off-by: Miquel Raynal <[email protected]>
  10. Reviewed-by: Boris Brezillon <[email protected]>
  11. Link: https://lore.kernel.org/linux-mtd/[email protected]
  12. (cherry picked from commit dc4c2cbf0be2d4a8e2a65013ea2815bb2c8ba949)
  13. ---
  14. drivers/mtd/nand/spi/core.c | 16 ++++++++--------
  15. 1 file changed, 8 insertions(+), 8 deletions(-)
  16. --- a/drivers/mtd/nand/spi/core.c
  17. +++ b/drivers/mtd/nand/spi/core.c
  18. @@ -1210,14 +1210,6 @@ static int spinand_init(struct spinand_d
  19. if (ret)
  20. goto err_free_bufs;
  21. - ret = spinand_create_dirmaps(spinand);
  22. - if (ret) {
  23. - dev_err(dev,
  24. - "Failed to create direct mappings for read/write operations (err = %d)\n",
  25. - ret);
  26. - goto err_manuf_cleanup;
  27. - }
  28. -
  29. ret = nanddev_init(nand, &spinand_ops, THIS_MODULE);
  30. if (ret)
  31. goto err_manuf_cleanup;
  32. @@ -1252,6 +1244,14 @@ static int spinand_init(struct spinand_d
  33. mtd->ecc_strength = nanddev_get_ecc_conf(nand)->strength;
  34. mtd->ecc_step_size = nanddev_get_ecc_conf(nand)->step_size;
  35. + ret = spinand_create_dirmaps(spinand);
  36. + if (ret) {
  37. + dev_err(dev,
  38. + "Failed to create direct mappings for read/write operations (err = %d)\n",
  39. + ret);
  40. + goto err_cleanup_ecc_engine;
  41. + }
  42. +
  43. return 0;
  44. err_cleanup_ecc_engine: