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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <MN2PR08MB59519F9C67AB1D6CAC6FCEAEB8140@MN2PR08MB5951.namprd08.prod.outlook.com>
Date:   Mon, 3 Jun 2019 12:43:36 +0000
From:   "Shivamurthy Shastri (sshivamurthy)" <sshivamurthy@...ron.com>
To:     Miquel Raynal <miquel.raynal@...tlin.com>,
        Richard Weinberger <richard@....at>,
        David Woodhouse <dwmw2@...radead.org>,
        Brian Norris <computersforpeace@...il.com>,
        Marek Vasut <marek.vasut@...il.com>,
        Vignesh Raghavendra <vigneshr@...com>,
        Boris Brezillon <bbrezillon@...nel.org>,
        Yixun Lan <yixun.lan@...ogic.com>,
        Lucas Stach <dev@...xeye.de>,
        Anders Roxell <anders.roxell@...aro.org>,
        Stefan Agner <stefan@...er.ch>,
        Marcel Ziswiler <marcel.ziswiler@...adex.com>,
        "Bean Huo (beanhuo)" <beanhuo@...ron.com>,
        Paul Cercueil <paul@...pouillou.net>,
        Frieder Schrempf <frieder.schrempf@...tron.de>,
        Chuanhong Guo <gch981213@...il.com>,
        "linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH v3 08/12] mtd: spinand: add parameter page fixup function

Parameter page not following any standard. Hence, manufacturers may
interpret parameters differently, and it is better to have a fixup
function.

Signed-off-by: Shivamurthy Shastri <sshivamurthy@...ron.com>
---
 drivers/mtd/nand/spi/core.c | 6 ++++++
 include/linux/mtd/spinand.h | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index b031c4a2cdf9..cdf578c45c08 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -479,6 +479,12 @@ static int check_version(struct nand_device *base,
 static int spinand_intf_data(struct nand_device *base,
 			     struct nand_onfi_params *p)
 {
+	struct spinand_device *spinand = nand_to_spinand(base);
+
+	/* Manufacturers may interpret the parameter page differently */
+	if (spinand->manufacturer->ops->fixup_param_page)
+		spinand->manufacturer->ops->fixup_param_page(spinand, p);
+
 	return 0;
 }
 
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 507f7e289bd1..41a03d59f003 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -179,6 +179,8 @@ struct spinand_manufacturer_ops {
 	int (*detect)(struct spinand_device *spinand);
 	int (*init)(struct spinand_device *spinand);
 	void (*cleanup)(struct spinand_device *spinand);
+	void (*fixup_param_page)(struct spinand_device *spinand,
+				 struct nand_onfi_params *p);
 };
 
 /**
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ