Skip to content

Commit 8f8972a

Browse files
committed
Merge tag 'mtd/fixes-for-5.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux
Pull MTD fixes from Miquel Raynal: "Raw NAND: - GPMI: Fix the suspend/resume SPI-NOR: - Fix quad enable on Spansion like flashes - Fix selection of 4-byte addressing opcodes on Spansion" * tag 'mtd/fixes-for-5.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: mtd: rawnand: gpmi: Restore nfc timing setup after suspend/resume mtd: rawnand: gpmi: Fix suspend/resume problem mtd: spi-nor: Fix quad enable for Spansion like flashes mtd: spi-nor: Fix selection of 4-byte addressing opcodes on Spansion
2 parents 244dc26 + d704866 commit 8f8972a

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ static int gpmi_init(struct gpmi_nand_data *this)
148148
struct resources *r = &this->resources;
149149
int ret;
150150

151+
ret = pm_runtime_get_sync(this->dev);
152+
if (ret < 0)
153+
return ret;
154+
151155
ret = gpmi_reset_block(r->gpmi_regs, false);
152156
if (ret)
153157
goto err_out;
@@ -179,8 +183,9 @@ static int gpmi_init(struct gpmi_nand_data *this)
179183
*/
180184
writel(BM_GPMI_CTRL1_DECOUPLE_CS, r->gpmi_regs + HW_GPMI_CTRL1_SET);
181185

182-
return 0;
183186
err_out:
187+
pm_runtime_mark_last_busy(this->dev);
188+
pm_runtime_put_autosuspend(this->dev);
184189
return ret;
185190
}
186191

@@ -2722,6 +2727,10 @@ static int gpmi_pm_resume(struct device *dev)
27222727
return ret;
27232728
}
27242729

2730+
/* Set flag to get timing setup restored for next exec_op */
2731+
if (this->hw.clk_rate)
2732+
this->hw.must_apply_timings = true;
2733+
27252734
/* re-init the BCH registers */
27262735
ret = bch_set_geometry(this);
27272736
if (ret) {

drivers/mtd/spi-nor/spi-nor.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,6 +2124,8 @@ static int spi_nor_sr2_bit1_quad_enable(struct spi_nor *nor)
21242124
if (nor->bouncebuf[0] & SR2_QUAD_EN_BIT1)
21252125
return 0;
21262126

2127+
nor->bouncebuf[0] |= SR2_QUAD_EN_BIT1;
2128+
21272129
return spi_nor_write_16bit_cr_and_check(nor, nor->bouncebuf[0]);
21282130
}
21292131

@@ -4769,9 +4771,7 @@ static void spi_nor_info_init_params(struct spi_nor *nor)
47694771

47704772
static void spansion_post_sfdp_fixups(struct spi_nor *nor)
47714773
{
4772-
struct mtd_info *mtd = &nor->mtd;
4773-
4774-
if (mtd->size <= SZ_16M)
4774+
if (nor->params.size <= SZ_16M)
47754775
return;
47764776

47774777
nor->flags |= SNOR_F_4B_OPCODES;

0 commit comments

Comments
 (0)