Skip to content

Commit 45ec2f5

Browse files
committed
Merge tag 'mtd/fixes-for-6.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux
Pull mtd fixes from Miquel Raynal: "Many NAND page layouts have been added to the Marvell NAND controller but could not be used in practice so they are being removed. Regarding the SPI-NAND area, Gigadevice chips were not using the right buffer for an ECC status check operation. Aside from these driver fixes, there is also a refcount fix in the MTD core nodes parsing logic" * tag 'mtd/fixes-for-6.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: mtd: rawnand: marvell: fix layouts mtd: Fix possible refcounting issue when going through partition nodes mtd: spinand: gigadevice: Fix the get ecc status issue
2 parents b6c1f1e + e6a30d0 commit 45ec2f5

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

drivers/mtd/mtdcore.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@ static void mtd_check_of_node(struct mtd_info *mtd)
621621
if (plen == mtd_name_len &&
622622
!strncmp(mtd->name, pname + offset, plen)) {
623623
mtd_set_of_node(mtd, mtd_dn);
624+
of_node_put(mtd_dn);
624625
break;
625626
}
626627
}

drivers/mtd/nand/raw/marvell_nand.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,16 +290,13 @@ static const struct marvell_hw_ecc_layout marvell_nfc_layouts[] = {
290290
MARVELL_LAYOUT( 2048, 512, 4, 1, 1, 2048, 32, 30, 0, 0, 0),
291291
MARVELL_LAYOUT( 2048, 512, 8, 2, 1, 1024, 0, 30,1024,32, 30),
292292
MARVELL_LAYOUT( 2048, 512, 8, 2, 1, 1024, 0, 30,1024,64, 30),
293-
MARVELL_LAYOUT( 2048, 512, 12, 3, 2, 704, 0, 30,640, 0, 30),
294-
MARVELL_LAYOUT( 2048, 512, 16, 5, 4, 512, 0, 30, 0, 32, 30),
293+
MARVELL_LAYOUT( 2048, 512, 16, 4, 4, 512, 0, 30, 0, 32, 30),
295294
MARVELL_LAYOUT( 4096, 512, 4, 2, 2, 2048, 32, 30, 0, 0, 0),
296-
MARVELL_LAYOUT( 4096, 512, 8, 5, 4, 1024, 0, 30, 0, 64, 30),
297-
MARVELL_LAYOUT( 4096, 512, 12, 6, 5, 704, 0, 30,576, 32, 30),
298-
MARVELL_LAYOUT( 4096, 512, 16, 9, 8, 512, 0, 30, 0, 32, 30),
295+
MARVELL_LAYOUT( 4096, 512, 8, 4, 4, 1024, 0, 30, 0, 64, 30),
296+
MARVELL_LAYOUT( 4096, 512, 16, 8, 8, 512, 0, 30, 0, 32, 30),
299297
MARVELL_LAYOUT( 8192, 512, 4, 4, 4, 2048, 0, 30, 0, 0, 0),
300-
MARVELL_LAYOUT( 8192, 512, 8, 9, 8, 1024, 0, 30, 0, 160, 30),
301-
MARVELL_LAYOUT( 8192, 512, 12, 12, 11, 704, 0, 30,448, 64, 30),
302-
MARVELL_LAYOUT( 8192, 512, 16, 17, 16, 512, 0, 30, 0, 32, 30),
298+
MARVELL_LAYOUT( 8192, 512, 8, 8, 8, 1024, 0, 30, 0, 160, 30),
299+
MARVELL_LAYOUT( 8192, 512, 16, 16, 16, 512, 0, 30, 0, 32, 30),
303300
};
304301

305302
/**

drivers/mtd/nand/spi/gigadevice.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static int gd5fxgq4uexxg_ecc_get_status(struct spinand_device *spinand,
186186
{
187187
u8 status2;
188188
struct spi_mem_op op = SPINAND_GET_FEATURE_OP(GD5FXGQXXEXXG_REG_STATUS2,
189-
&status2);
189+
spinand->scratchbuf);
190190
int ret;
191191

192192
switch (status & STATUS_ECC_MASK) {
@@ -207,6 +207,7 @@ static int gd5fxgq4uexxg_ecc_get_status(struct spinand_device *spinand,
207207
* report the maximum of 4 in this case
208208
*/
209209
/* bits sorted this way (3...0): ECCS1,ECCS0,ECCSE1,ECCSE0 */
210+
status2 = *(spinand->scratchbuf);
210211
return ((status & STATUS_ECC_MASK) >> 2) |
211212
((status2 & STATUS_ECC_MASK) >> 4);
212213

@@ -228,7 +229,7 @@ static int gd5fxgq5xexxg_ecc_get_status(struct spinand_device *spinand,
228229
{
229230
u8 status2;
230231
struct spi_mem_op op = SPINAND_GET_FEATURE_OP(GD5FXGQXXEXXG_REG_STATUS2,
231-
&status2);
232+
spinand->scratchbuf);
232233
int ret;
233234

234235
switch (status & STATUS_ECC_MASK) {
@@ -248,6 +249,7 @@ static int gd5fxgq5xexxg_ecc_get_status(struct spinand_device *spinand,
248249
* 1 ... 4 bits are flipped (and corrected)
249250
*/
250251
/* bits sorted this way (1...0): ECCSE1, ECCSE0 */
252+
status2 = *(spinand->scratchbuf);
251253
return ((status2 & STATUS_ECC_MASK) >> 4) + 1;
252254

253255
case STATUS_ECC_UNCOR_ERROR:

0 commit comments

Comments
 (0)