···672672 ubi->nor_flash = 1;673673 }674674675675- /*676676- * Set UBI min. I/O size (@ubi->min_io_size). We use @mtd->writebufsize677677- * for these purposes, not @mtd->writesize. At the moment this does not678678- * matter for NAND, because currently @mtd->writebufsize is equivalent to679679- * @mtd->writesize for all NANDs. However, some CFI NOR flashes may680680- * have @mtd->writebufsize which is multiple of @mtd->writesize.681681- *682682- * The reason we use @mtd->writebufsize for @ubi->min_io_size is that683683- * UBI and UBIFS recovery algorithms rely on the fact that if there was684684- * an unclean power cut, then we can find offset of the last corrupted685685- * node, align the offset to @ubi->min_io_size, read the rest of the686686- * eraseblock starting from this offset, and check whether there are687687- * only 0xFF bytes. If yes, then we are probably dealing with a688688- * corruption caused by a power cut, if not, then this is probably some689689- * severe corruption.690690- *691691- * Thus, we have to use the maximum write unit size of the flash, which692692- * is @mtd->writebufsize, because @mtd->writesize is the minimum write693693- * size, not the maximum.694694- */695695- if (ubi->mtd->type == MTD_NANDFLASH)696696- ubi_assert(ubi->mtd->writebufsize == ubi->mtd->writesize);697697- else if (ubi->mtd->type == MTD_NORFLASH)698698- ubi_assert(ubi->mtd->writebufsize % ubi->mtd->writesize == 0);699699-700700- ubi->min_io_size = ubi->mtd->writebufsize;701701-675675+ ubi->min_io_size = ubi->mtd->writesize;702676 ubi->hdrs_min_io_size = ubi->mtd->writesize >> ubi->mtd->subpage_sft;703677704678 /*