lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Sat, 1 Jan 2022 13:12:45 +0530 From: Apurva Nandan <a-nandan@...com> To: Miquel Raynal <miquel.raynal@...tlin.com>, Richard Weinberger <richard@....at>, Vignesh Raghavendra <vigneshr@...com>, Mark Brown <broonie@...nel.org>, Apurva Nandan <a-nandan@...com>, Patrice Chotard <patrice.chotard@...s.st.com>, Christophe Kerello <christophe.kerello@...s.st.com>, Boris Brezillon <boris.brezillon@...labora.com>, Daniel Palmer <daniel@...f.com>, Alexander Lobakin <alobakin@...me>, <linux-mtd@...ts.infradead.org>, <linux-kernel@...r.kernel.org>, <linux-spi@...r.kernel.org> CC: <p.yadav@...com> Subject: [PATCH v3 12/17] mtd: spinand: Add mtd_suspend() to disable Octal DTR mode at suspend The flash might or might not have gone a power-down during sleep. Hence, its SPI IO mode is unpredictable for the core at the time of resume. To ensure proper reinitialization during resume, disable the Octal DTR SPI IO mode and bring the flash to 1S-1S-1S mode when performing suspend using mtd_suspend(). Signed-off-by: Apurva Nandan <a-nandan@...com> --- drivers/mtd/nand/spi/core.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index 2fd08085db6f..9d1c72634e5a 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -1307,6 +1307,16 @@ static void spinand_mtd_resume(struct mtd_info *mtd) spinand_ecc_enable(spinand, false); } +static int spinand_mtd_suspend(struct mtd_info *mtd) +{ + struct spinand_device *spinand = mtd_to_spinand(mtd); + + if (spinand->ctrl_ops->protocol == SPINAND_8D_8D_8D) + return spinand_init_octal_dtr_disable(spinand); + + return 0; +} + static int spinand_init(struct spinand_device *spinand) { struct device *dev = &spinand->spimem->spi->dev; @@ -1381,6 +1391,7 @@ static int spinand_init(struct spinand_device *spinand) mtd->_erase = spinand_mtd_erase; mtd->_max_bad_blocks = nanddev_mtd_max_bad_blocks; mtd->_resume = spinand_mtd_resume; + mtd->_suspend = spinand_mtd_suspend; if (nand->ecc.engine) { ret = mtd_ooblayout_count_freebytes(mtd); -- 2.25.1
Powered by blists - more mailing lists