ath79: ar934x: still advertise subpage on soft ecc
authorChristian Lamparter <chunkeey@gmail.com>
Sat, 31 Jul 2021 01:33:03 +0000 (03:33 +0200)
committerChristian Lamparter <chunkeey@gmail.com>
Sun, 24 Oct 2021 01:04:29 +0000 (03:04 +0200)
This sort of reverts Koen Vandeputte's commit
6561ca1fa51 ("ath79: ar934x: fix mounting issues if subpage is not supported")

since it does not work on the MR18 as the UBI is coming from
Meraki in that way and it used to work with AR71XX before.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c

index e040726f44f013eafa103945f1413228e5638ba2..79266092a52638e88fda0e1a4de3c92206b9294a 100644 (file)
@@ -1331,14 +1331,14 @@ static int ar934x_nfc_attach_chip(struct nand_chip *nand)
        if (ret)
                return ret;
 
-       if (mtd->writesize == 2048)
-               nand->options |= NAND_NO_SUBPAGE_WRITE;
-
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)
        if (nand->ecc.engine_type == NAND_ECC_ENGINE_TYPE_ON_HOST) {
 #else
        if (nand->ecc.mode == NAND_ECC_HW) {
 #endif
+               if (mtd->writesize == 2048)
+                       nand->options |= NAND_NO_SUBPAGE_WRITE;
+
                ret = ar934x_nfc_setup_hwecc(nfc);
                if (ret)
                        return ret;