Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a8ce0b0 authored by Kyungmin Park's avatar Kyungmin Park Committed by David Woodhouse
Browse files

mtd: onenand: allocate verify buffer in the core



This patch extends OneNAND core code with support for OneNAND verify
write check. This is done by allocating the buffer for verify read
directly from the core code.

Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 6a88c47b
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -3932,6 +3932,13 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
				__func__);
			return -ENOMEM;
		}
#ifdef CONFIG_MTD_ONENAND_VERIFY_WRITE
		this->verify_buf = kzalloc(mtd->writesize, GFP_KERNEL);
		if (!this->verify_buf) {
			kfree(this->page_buf);
			return -ENOMEM;
		}
#endif
		this->options |= ONENAND_PAGEBUF_ALLOC;
	}
	if (!this->oob_buf) {
@@ -4059,8 +4066,12 @@ void onenand_release(struct mtd_info *mtd)
		kfree(this->bbm);
	}
	/* Buffers allocated by onenand_scan */
	if (this->options & ONENAND_PAGEBUF_ALLOC)
	if (this->options & ONENAND_PAGEBUF_ALLOC) {
		kfree(this->page_buf);
#ifdef CONFIG_MTD_ONENAND_VERIFY_WRITE
		kfree(this->verify_buf);
#endif
	}
	if (this->options & ONENAND_OOBBUF_ALLOC)
		kfree(this->oob_buf);
	kfree(mtd->eraseregions);
+3 −0
Original line number Diff line number Diff line
@@ -125,6 +125,9 @@ struct onenand_chip {
	flstate_t		state;
	unsigned char		*page_buf;
	unsigned char		*oob_buf;
#ifdef CONFIG_MTD_ONENAND_VERIFY_WRITE
	unsigned char		*verify_buf;
#endif

	int			subpagesize;
	struct nand_ecclayout	*ecclayout;