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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250904131309.3095165-1-s-k6@ti.com>
Date: Thu, 4 Sep 2025 18:43:09 +0530
From: Santhosh Kumar K <s-k6@...com>
To: <miquel.raynal@...tlin.com>, <richard@....at>, <vigneshr@...com>,
        <tudor.ambarus@...aro.org>, <pratyush@...nel.org>, <mwalle@...nel.org>
CC: <linux-mtd@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
        <s-k6@...com>, <praneeth@...com>, <p-mantena@...com>, <a-dutta@...com>,
        <u-kumar1@...com>
Subject: [PATCH] mtd: spi-nor: spansion: Modify addr_mode_nbytes for DTR mode

The nor->params->addr_mode_nbytes parameter defines the address byte
count for the current addressing mode. When transitioning between SDR
and DDR modes, this parameter must be properly updated to maintain the
correct addressing behavior. So, implement the necessary updates to
nor->params->addr_mode_nbytes during both DDR mode enablement and
disablement operations to ensure address byte counts remain consistent
with the active transfer mode.

Signed-off-by: Santhosh Kumar K <s-k6@...com>
---

Tested on TI's AM62x SK
Logs: https://gist.github.com/santhosh21/8d69756bd54605d79086b00850e1083a

---
 drivers/mtd/spi-nor/spansion.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c
index a0296c871634..678f7f4052c9 100644
--- a/drivers/mtd/spi-nor/spansion.c
+++ b/drivers/mtd/spi-nor/spansion.c
@@ -230,6 +230,8 @@ static int cypress_nor_octal_dtr_en(struct spi_nor *nor)
 			return ret;
 	}
 
+	nor->params->addr_mode_nbytes = 4;
+
 	/* Read flash ID to make sure the switch was successful. */
 	ret = spi_nor_read_id(nor, nor->addr_nbytes, 3, buf,
 			      SNOR_PROTO_8_8_8_DTR);
@@ -275,6 +277,8 @@ static int cypress_nor_octal_dtr_dis(struct spi_nor *nor)
 			return ret;
 	}
 
+	nor->params->addr_mode_nbytes = 3;
+
 	/* Read flash ID to make sure the switch was successful. */
 	ret = spi_nor_read_id(nor, 0, 0, buf, SNOR_PROTO_1_1_1);
 	if (ret) {
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ