mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
Subsystems (2)
v5 cover mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
Since commit dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to check correct value") buffered writes fail on S29GL064N. This is because, on S29GL064N, reads return 0xFF at the end of DQ polling for write completion, where as, chip_good() check expects actual data written to the last location to be returned post DQ polling completion. Fix is to revert to using chip_good() for S29GL064N which only checks for DQ lines to settle down to determine write completion.
Tokunori Ikegami (3):
mtd: cfi_cmdset_0002: Move and rename
chip_check/chip_ready/chip_good_for_write
mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
mtd: cfi_cmdset_0002: Add S29GL064N ID definition
drivers/mtd/chips/cfi_cmdset_0002.c | 112 ++++++++++++++-------------- include/linux/mtd/cfi.h | 1 + 2 files changed, 55 insertions(+), 58 deletions(-)
Signature · 1 line
2.32.0
PATCH v5 1/3 mtd: cfi_cmdset_0002: Move and rename chip_check/chip_ready/chip_good_for_write
This is a preparation patch for the S29GL064N buffer writes fix. There is no functional change.
--- drivers/mtd/chips/cfi_cmdset_0002.c | 95 ++++++++++------------------- 1 file changed, 32 insertions(+), 63 deletions(-)
drivers/mtd/chips/cfi_cmdset_0002.c +32 -63
@@ -802,21 +802,25 @@ static struct mtd_info *cfi_amdstd_setup(struct mtd_info *mtd) }/* -* Return true if the chip is ready. +* Return true if the chip is ready and has the correct value. * * Ready is one of: read mode, query mode, erase-suspend-read mode (in any * non-suspended sector) and is indicated by no toggle bits toggling. * +* Error are indicated by toggling bits or bits held with the wrong value, +* or with bits toggling. +* * Note that anything more complicated than checking if no bits are toggling * (including checking DQ5 for an error status) is tricky to get working * correctly and is therefore not done (particularly with interleaved chips * as each chip must be checked independently of the others). */ static int __xipram chip_ready(struct map_info *map, struct flchip *chip, -unsigned long addr) +unsigned long addr,map_word *expected) {struct cfi_private *cfi = map->fldrv_priv;map_word d, t; +int ret;if (cfi_use_status_reg (cfi)) {map_word ready =CMD (CFI_SR_DRB );
@@ -826,57 +830,20 @@ static int __xipram chip_ready(struct map_info *map, struct flchip *chip,*/ cfi_send_gen_cmd (0x70 , cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type,NULL ); - d =map_read (map, addr); + t =map_read (map, addr); -return map_word_andequal (map, d, ready, ready); +return map_word_andequal (map, t, ready, ready); } d =map_read (map, addr); t =map_read (map, addr); -return map_word_equal (map, d, t); -} - -/* -* Return true if the chip is ready and has the correct value. -* -* Ready is one of: read mode, query mode, erase-suspend-read mode (in any -* non-suspended sector) and it is indicated by no bits toggling. -* -* Error are indicated by toggling bits or bits held with the wrong value, -* or with bits toggling. -* -* Note that anything more complicated than checking if no bits are toggling -* (including checking DQ5 for an error status) is tricky to get working -* correctly and is therefore not done (particularly with interleaved chips -* as each chip must be checked independently of the others). -* -*/ -static int __xipram chip_good(struct map_info *map, struct flchip *chip, -unsigned long addr,map_word expected) -{ -struct cfi_private *cfi = map->fldrv_priv; -map_word oldd, curd; - -if (cfi_use_status_reg (cfi)) { -map_word ready =CMD (CFI_SR_DRB ); - -/* -* For chips that support status register, check device -* ready bit -*/ -cfi_send_gen_cmd (0x70 , cfi->addr_unlock1, chip->start, map, cfi, - cfi->device_type,NULL ); - curd =map_read (map, addr); - -return map_word_andequal (map, curd, ready, ready); - } + ret =map_word_equal (map, d, t); - oldd =map_read (map, addr); - curd =map_read (map, addr); +if (!ret || !expected) +return ret; -return map_word_equal (map, oldd, curd) && -map_word_equal (map, curd, expected); +return map_word_equal (map, t, *expected); }static int get_chip (struct map_info *map,struct flchip *chip,unsigned long adr,int mode)
@@ -893,7 +860,7 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adrcase FL_STATUS :for (;;) { -if (chip_ready (map, chip, adr)) +if (chip_ready (map, chip, adr,NULL ))break ;if (time_after (jiffies, timeo)) {
@@ -932,7 +899,7 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr chip->state =FL_ERASE_SUSPENDING ; chip->erase_suspended =1 ;for (;;) { -if (chip_ready (map, chip, adr)) +if (chip_ready (map, chip, adr,NULL ))break ;if (time_after (jiffies, timeo)) {
@@ -1463,7 +1430,7 @@ static int do_otp_lock(struct map_info *map, struct flchip *chip, loff_t adr,/* wait for chip to become ready */ timeo = jiffies +msecs_to_jiffies (2 );for (;;) { -if (chip_ready (map, chip, adr)) +if (chip_ready (map, chip, adr,NULL ))break ;if (time_after (jiffies, timeo)) {
@@ -1695,11 +1662,11 @@ static int __xipram do_write_oneword_once(struct map_info *map, }/* -* We check "time_after" and "!chip_good" before checking -* "chip_good" to avoid the failure due to scheduling. +* We check "time_after" and "!chip_ready" before checking +* "chip_ready" to avoid the failure due to scheduling. */ if (time_after (jiffies, timeo) && - !chip_good (map, chip, adr, datum)) { + !chip_ready (map, chip, adr, &datum)) {xip_enable (map, chip, adr);printk (KERN_WARNING "MTD %s(): software timeout\n" , __func__);xip_disable (map, chip, adr);
@@ -1707,7 +1674,7 @@ static int __xipram do_write_oneword_once(struct map_info *map,break ; } -if (chip_good (map, chip, adr, datum)) { +if (chip_ready (map, chip, adr, &datum)) {if (cfi_check_err_status (map, chip, adr)) ret = -EIO ;break ;
@@ -1975,18 +1942,18 @@ static int __xipram do_write_buffer_wait(struct map_info *map, }/* -* We check "time_after" and "!chip_good" before checking -* "chip_good" to avoid the failure due to scheduling. +* We check "time_after" and "!chip_ready" before checking +* "chip_ready" to avoid the failure due to scheduling. */ if (time_after (jiffies, timeo) && - !chip_good (map, chip, adr, datum)) { + !chip_ready (map, chip, adr, &datum)) {pr_err ("MTD %s(): software timeout, address:0x%.8lx.\n" , __func__, adr); ret = -EIO ;break ; } -if (chip_good (map, chip, adr, datum)) { +if (chip_ready (map, chip, adr, &datum)) {if (cfi_check_err_status (map, chip, adr)) ret = -EIO ;break ;
@@ -2195,7 +2162,7 @@ static int cfi_amdstd_panic_wait(struct map_info *map, struct flchip *chip,* If the driver thinks the chip is idle, and no toggle bits * are changing, then the chip is actually idle for sure. */ -if (chip->state ==FL_READY &&chip_ready (map, chip, adr)) +if (chip->state ==FL_READY &&chip_ready (map, chip, adr,NULL ))return 0 ;/*
@@ -2212,7 +2179,7 @@ static int cfi_amdstd_panic_wait(struct map_info *map, struct flchip *chip,/* wait for the chip to become ready */ for (i =0 ; i <jiffies_to_usecs (timeo); i++) { -if (chip_ready (map, chip, adr)) +if (chip_ready (map, chip, adr,NULL ))return 0 ;udelay (1 );
@@ -2276,13 +2243,13 @@ static int do_panic_write_oneword(struct map_info *map, struct flchip *chip,map_write (map, datum, adr);for (i =0 ; i <jiffies_to_usecs (uWriteTimeout); i++) { -if (chip_ready (map, chip, adr)) +if (chip_ready (map, chip, adr,NULL ))break ;udelay (1 ); } -if (!chip_good (map, chip, adr, datum) || +if (!chip_ready (map, chip, adr, &datum) ||cfi_check_err_status (map, chip, adr)) {/* reset on all failures. */ map_write (map,CMD (0xF0 ), chip->start);
@@ -2424,6 +2391,7 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)DECLARE_WAITQUEUE (wait, current);int ret;int retry_cnt =0 ; +map_word datum =map_word_ff (map); adr = cfi->addr_unlock1;
@@ -2478,7 +2446,7 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip) chip->erase_suspended =0 ; } -if (chip_good (map, chip, adr,map_word_ff (map))) { +if (chip_ready (map, chip, adr, &datum)) {if (cfi_check_err_status (map, chip, adr)) ret = -EIO ;break ;
@@ -2523,6 +2491,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,DECLARE_WAITQUEUE (wait, current);int ret;int retry_cnt =0 ; +map_word datum =map_word_ff (map); adr += chip->start;
@@ -2577,7 +2546,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, chip->erase_suspended =0 ; } -if (chip_good (map, chip, adr,map_word_ff (map))) { +if (chip_ready (map, chip, adr, &datum)) {if (cfi_check_err_status (map, chip, adr)) ret = -EIO ;break ;
@@ -2771,7 +2740,7 @@ static int __maybe_unused do_ppb_xxlock(struct map_info *map,*/ timeo = jiffies +msecs_to_jiffies (2000 );/* 2s max (un)locking */ for (;;) { -if (chip_ready (map, chip, adr)) +if (chip_ready (map, chip, adr,NULL ))break ;if (time_after (jiffies, timeo)) {
Signature · 1 line
2.32.0
PATCH v5 2/3 mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N
In reply to Tokunori IkegamiSince commit dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to check correct value") buffered writes fail on S29GL064N. This is because, on S29GL064N, reads return 0xFF at the end of DQ polling for write completion, where as, chip_good() check expects actual data written to the last location to be returned post DQ polling completion. Fix is to revert to using chip_good() for S29GL064N which only checks for DQ lines to settle down to determine write completion.
--- drivers/mtd/chips/cfi_cmdset_0002.c | 42 +++++++++++++++++++++++------ include/linux/mtd/cfi.h | 1 + 2 files changed, 35 insertions(+), 8 deletions(-)
drivers/mtd/chips/cfi_cmdset_0002.c +34 -8
@@ -59,6 +59,10 @@#define CFI_SR_WBASB BIT(3)#define CFI_SR_SLSB BIT(1) +enum cfi_quirks { +CFI_QUIRK_DQ_TRUE_DATA =BIT (0 ), +}; +static int cfi_amdstd_read (struct mtd_info *,loff_t ,size_t ,size_t *,u_char *);static int cfi_amdstd_write_words (struct mtd_info *,loff_t ,size_t ,size_t *,const u_char *);#if !FORCE_WORD_WRITE
@@ -436,6 +440,15 @@ static void fixup_s29ns512p_sectors(struct mtd_info *mtd) mtd->name); } +static void fixup_quirks (struct mtd_info *mtd) +{ +struct map_info *map = mtd->priv; +struct cfi_private *cfi = map->fldrv_priv; + +if (cfi->mfr ==CFI_MFR_AMD && cfi->id ==0x0c01 ) + cfi->quirks |=CFI_QUIRK_DQ_TRUE_DATA ; +} +/* Used to fix CFI-Tables of chips without Extended Query Tables */ static struct cfi_fixup cfi_nopri_fixup_table[] = { {CFI_MFR_SST ,0x234a , fixup_sst39vf },/* SST39VF1602 */
@@ -474,6 +487,7 @@ static struct cfi_fixup cfi_fixup_table[] = { #if !FORCE_WORD_WRITE { CFI_MFR_ANY, CFI_ID_ANY, fixup_use_write_buffers }, #endif + { CFI_MFR_ANY, CFI_ID_ANY, fixup_quirks }, { 0, 0, NULL } }; static struct cfi_fixup jedec_fixup_table[] = {
@@ -846,6 +860,18 @@ static int __xipram chip_ready(struct map_info *map, struct flchip *chip,return map_word_equal (map, t, *expected); } +static int __xipram chip_good(struct map_info *map, struct flchip *chip, +unsigned long addr,map_word *expected) +{ +struct cfi_private *cfi = map->fldrv_priv; +map_word *datum = expected; + +if (cfi->quirks &CFI_QUIRK_DQ_TRUE_DATA ) + datum =NULL ; + +return chip_ready (map, chip, addr, datum); +} +static int get_chip (struct map_info *map,struct flchip *chip,unsigned long adr,int mode) {DECLARE_WAITQUEUE (wait, current);
@@ -1662,11 +1688,11 @@ static int __xipram do_write_oneword_once(struct map_info *map, }/* -* We check "time_after" and "!chip_ready" before checking -* "chip_ready" to avoid the failure due to scheduling. +* We check "time_after" and "!chip_good" before checking +* "chip_good" to avoid the failure due to scheduling. */ if (time_after (jiffies, timeo) && - !chip_ready (map, chip, adr, &datum)) { + !chip_good (map, chip, adr, &datum)) {xip_enable (map, chip, adr);printk (KERN_WARNING "MTD %s(): software timeout\n" , __func__);xip_disable (map, chip, adr);
@@ -1674,7 +1700,7 @@ static int __xipram do_write_oneword_once(struct map_info *map,break ; } -if (chip_ready (map, chip, adr, &datum)) { +if (chip_good (map, chip, adr, &datum)) {if (cfi_check_err_status (map, chip, adr)) ret = -EIO ;break ;
@@ -1942,18 +1968,18 @@ static int __xipram do_write_buffer_wait(struct map_info *map, }/* -* We check "time_after" and "!chip_ready" before checking -* "chip_ready" to avoid the failure due to scheduling. +* We check "time_after" and "!chip_good" before checking +* "chip_good" to avoid the failure due to scheduling. */ if (time_after (jiffies, timeo) && - !chip_ready (map, chip, adr, &datum)) { + !chip_good (map, chip, adr, &datum)) {pr_err ("MTD %s(): software timeout, address:0x%.8lx.\n" , __func__, adr); ret = -EIO ;break ; } -if (chip_ready (map, chip, adr, &datum)) { +if (chip_good (map, chip, adr, &datum)) {if (cfi_check_err_status (map, chip, adr)) ret = -EIO ;break ;
include/linux/mtd/cfi.h +1 -0
@@ -286,6 +286,7 @@ struct cfi_private {map_word sector_erase_cmd;unsigned long chipshift;/* Because they're of the same type */ const char *im_name;/* inter_module name for cmdset_setup */ +unsigned long quirks;struct flchip chips[];/* per-chip data structure for each chip */ };
Signature · 1 line
2.32.0
PATCH v5 3/3 mtd: cfi_cmdset_0002: Add S29GL064N ID definition
In reply to Tokunori IkegamiIt is for the model number 01, 02, V1 and V2.
--- drivers/mtd/chips/cfi_cmdset_0002.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/mtd/chips/cfi_cmdset_0002.c +10 -9
@@ -48,6 +48,7 @@#define SST49LF040B 0x0050#define SST49LF008A 0x005a#define AT49BV6416 0x00d6 +#define S29GL064N_MN12 0x0c01/* * Status Register bit description. Used by flash devices that don't
@@ -445,7 +446,7 @@ static void fixup_quirks(struct mtd_info *mtd)struct map_info *map = mtd->priv;struct cfi_private *cfi = map->fldrv_priv; -if (cfi->mfr ==CFI_MFR_AMD && cfi->id ==0x0c01 ) +if (cfi->mfr ==CFI_MFR_AMD && cfi->id ==S29GL064N_MN12 ) cfi->quirks |=CFI_QUIRK_DQ_TRUE_DATA ; }
@@ -475,7 +476,7 @@ static struct cfi_fixup cfi_fixup_table[] = { { CFI_MFR_AMD, 0x0056, fixup_use_secsi }, { CFI_MFR_AMD, 0x005C, fixup_use_secsi }, { CFI_MFR_AMD, 0x005F, fixup_use_secsi }, - { CFI_MFR_AMD, 0x0c01, fixup_s29gl064n_sectors }, + { CFI_MFR_AMD, S29GL064N_MN12, fixup_s29gl064n_sectors }, { CFI_MFR_AMD, 0x1301, fixup_s29gl064n_sectors }, { CFI_MFR_AMD, 0x1a00, fixup_s29gl032n_sectors }, { CFI_MFR_AMD, 0x1a01, fixup_s29gl032n_sectors },
@@ -833,7 +834,7 @@ static int __xipram chip_ready(struct map_info *map, struct flchip *chip, unsigned long addr, map_word *expected) { struct cfi_private *cfi = map->fldrv_priv; -map_word d, t; +map_word oldd, curd;int ret;if (cfi_use_status_reg (cfi)) {
@@ -844,20 +845,20 @@ static int __xipram chip_ready(struct map_info *map, struct flchip *chip,*/ cfi_send_gen_cmd (0x70 , cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type,NULL ); - t =map_read (map, addr); + curd =map_read (map, addr); -return map_word_andequal (map, t, ready, ready); +return map_word_andequal (map, curd, ready, ready); } - d =map_read (map, addr); - t =map_read (map, addr); + oldd =map_read (map, addr); + curd =map_read (map, addr); - ret =map_word_equal (map, d, t); + ret =map_word_equal (map, oldd, curd);if (!ret || !expected)return ret; -return map_word_equal (map, t, *expected); +return map_word_equal (map, curd, *expected); } static int __xipram chip_good(struct map_info *map, struct flchip *chip,
Signature · 6 lines
2.32.0 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
Miquel Raynal
maintainerRe: [PATCH v5 3/3] mtd: cfi_cmdset_0002: Add S29GL064N ID definition
Hi Tokunori,
[email protected] wrote on Tue, 22 Mar 2022 11:10:01 +0900:
Quoted 64 lines
It is for the model number 01, 02, V1 and V2.
Signed-off-by Tokunori Ikegami <[email protected]>Cc Miquel Raynal <[email protected]>Cc Richard Weinberger <[email protected]>Cc Vignesh Raghavendra <[email protected]>--- drivers/mtd/chips/cfi_cmdset_0002.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)drivers/mtd/chips/cfi_cmdset_0002.c +7
-7@@ -48,6 +48,7 @@#define SST49LF040B 0x0050#define SST49LF008A 0x005a#define AT49BV6416 0x00d6 +#define S29GL064N_MN12 0x0c01/* * Status Register bit description. Used by flash devices that don't @@ -445,7 +446,7 @@ static void fixup_quirks(struct mtd_info *mtd)struct map_info *map = mtd->priv;struct cfi_private *cfi = map->fldrv_priv; -if (cfi->mfr ==CFI_MFR_AMD && cfi->id ==0x0c01 ) +if (cfi->mfr ==CFI_MFR_AMD && cfi->id ==S29GL064N_MN12 ) cfi->quirks |=CFI_QUIRK_DQ_TRUE_DATA ; }@@ -475,7 +476,7 @@ static struct cfi_fixup cfi_fixup_table[] = { { CFI_MFR_AMD, 0x0056, fixup_use_secsi }, { CFI_MFR_AMD, 0x005C, fixup_use_secsi }, { CFI_MFR_AMD, 0x005F, fixup_use_secsi }, - { CFI_MFR_AMD, 0x0c01, fixup_s29gl064n_sectors }, + { CFI_MFR_AMD, S29GL064N_MN12, fixup_s29gl064n_sectors }, { CFI_MFR_AMD, 0x1301, fixup_s29gl064n_sectors }, { CFI_MFR_AMD, 0x1a00, fixup_s29gl032n_sectors }, { CFI_MFR_AMD, 0x1a01, fixup_s29gl032n_sectors },@@ -833,7 +834,7 @@ static int __xipram chip_ready(struct map_info *map, struct flchip *chip, unsigned long addr, map_word *expected) { struct cfi_private *cfi = map->fldrv_priv; -map_word d, t; +map_word oldd, curd;int ret;if (cfi_use_status_reg (cfi)) {@@ -844,20 +845,20 @@ static int __xipram chip_ready(struct map_info *map, struct flchip *chip,*/ cfi_send_gen_cmd (0x70 , cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type,NULL ); - t =map_read (map, addr); + curd =map_read (map, addr); -return map_word_andequal (map, t, ready, ready); +return map_word_andequal (map, curd, ready, ready); } - d =map_read (map, addr); - t =map_read (map, addr); + oldd =map_read (map, addr);
drivers/mtd/chips/cfi_cmdset_0002.c static int __xipram chip_ready(struct map_info *map, struct flchip *chip, · line 861
Quoted 10 lines
drivers/mtd/chips/cfi_cmdset_0002.c +3
-2+ curd =map_read (map, addr); - ret =map_word_equal (map, d, t); + ret =map_word_equal (map, oldd, curd);if (!ret || !expected)return ret; -return map_word_equal (map, t, *expected); +return map_word_equal (map, curd, *expected);
Looks like there is a rebase issue.
drivers/mtd/chips/cfi_cmdset_0002.c static int __xipram chip_ready(struct map_info *map, struct flchip *chip, · line 864
Quoted 3 lines
drivers/mtd/chips/cfi_cmdset_0002.c +0
-0} static int __xipram chip_good(struct map_info *map, struct flchip *chip,
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Re: [PATCH v5 3/3] mtd: cfi_cmdset_0002: Add S29GL064N ID definition
Hi Miquel-san,
Quoted 73 lines · Miquel Raynal
Hi Tokunori,
[email protected] wrote on Tue, 22 Mar 2022 11:10:01 +0900:
Quoted 69 lines
It is for the model number 01, 02, V1 and V2.
Signed-off-by Tokunori Ikegami <[email protected]>Cc Miquel Raynal <[email protected]>Cc Richard Weinberger <[email protected]>Cc Vignesh Raghavendra <[email protected]>--- drivers/mtd/chips/cfi_cmdset_0002.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)drivers/mtd/chips/cfi_cmdset_0002.c +9
-8@@ -48,6 +48,7 @@#define SST49LF040B 0x0050#define SST49LF008A 0x005a#define AT49BV6416 0x00d6 +#define S29GL064N_MN12 0x0c01/* * Status Register bit description. Used by flash devices that don't @@ -445,7 +446,7 @@ static void fixup_quirks(struct mtd_info *mtd)struct map_info *map = mtd->priv;struct cfi_private *cfi = map->fldrv_priv; -if (cfi->mfr ==CFI_MFR_AMD && cfi->id ==0x0c01 ) +if (cfi->mfr ==CFI_MFR_AMD && cfi->id ==S29GL064N_MN12 ) cfi->quirks |=CFI_QUIRK_DQ_TRUE_DATA ; }@@ -475,7 +476,7 @@ static struct cfi_fixup cfi_fixup_table[] = { { CFI_MFR_AMD, 0x0056, fixup_use_secsi }, { CFI_MFR_AMD, 0x005C, fixup_use_secsi }, { CFI_MFR_AMD, 0x005F, fixup_use_secsi }, - { CFI_MFR_AMD, 0x0c01, fixup_s29gl064n_sectors }, + { CFI_MFR_AMD, S29GL064N_MN12, fixup_s29gl064n_sectors }, { CFI_MFR_AMD, 0x1301, fixup_s29gl064n_sectors }, { CFI_MFR_AMD, 0x1a00, fixup_s29gl032n_sectors }, { CFI_MFR_AMD, 0x1a01, fixup_s29gl032n_sectors },@@ -833,7 +834,7 @@ static int __xipram chip_ready(struct map_info *map, struct flchip *chip, unsigned long addr, map_word *expected) { struct cfi_private *cfi = map->fldrv_priv; -map_word d, t; +map_word oldd, curd;int ret;if (cfi_use_status_reg (cfi)) {@@ -844,20 +845,20 @@ static int __xipram chip_ready(struct map_info *map, struct flchip *chip,*/ cfi_send_gen_cmd (0x70 , cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type,NULL ); - t =map_read (map, addr); + curd =map_read (map, addr); -return map_word_andequal (map, t, ready, ready); +return map_word_andequal (map, curd, ready, ready); } - d =map_read (map, addr); - t =map_read (map, addr); + oldd =map_read (map, addr); + curd =map_read (map, addr); - ret =map_word_equal (map, d, t); + ret =map_word_equal (map, oldd, curd);
Quoted 6 lines
drivers/mtd/chips/cfi_cmdset_0002.c static int __xipram chip_ready(struct map_info *map, struct flchip *chip, · line 861
Quoted 5 lines
drivers/mtd/chips/cfi_cmdset_0002.c +1
-1if (!ret || !expected)return ret; -return map_word_equal (map, t, *expected); +return map_word_equal (map, curd, *expected);Looks like there is a rebase issue.
The changes added are for the patch v4 1/3 comment below. Sorry I missed to update the commit message so will update it as so. > A lot of the diff is just a rename. I am not against a rename if you
> feel it's better, but in this order:
> 1: prepare the fix
> 2: fix
> 3: rename/define id's, whatever
Regards,
Ikegami
Quoted 7 lines
drivers/mtd/chips/cfi_cmdset_0002.c static int __xipram chip_ready(struct map_info *map, struct flchip *chip, · line 864
Quoted 4 lines
drivers/mtd/chips/cfi_cmdset_0002.c +0
-0} static int __xipram chip_good(struct map_info *map, struct flchip *chip,Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/