Commit 8f8972a3 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 244dc268 d7048666
...@@ -148,6 +148,10 @@ static int gpmi_init(struct gpmi_nand_data *this) ...@@ -148,6 +148,10 @@ static int gpmi_init(struct gpmi_nand_data *this)
struct resources *r = &this->resources; struct resources *r = &this->resources;
int ret; int ret;
ret = pm_runtime_get_sync(this->dev);
if (ret < 0)
return ret;
ret = gpmi_reset_block(r->gpmi_regs, false); ret = gpmi_reset_block(r->gpmi_regs, false);
if (ret) if (ret)
goto err_out; goto err_out;
...@@ -179,8 +183,9 @@ static int gpmi_init(struct gpmi_nand_data *this) ...@@ -179,8 +183,9 @@ static int gpmi_init(struct gpmi_nand_data *this)
*/ */
writel(BM_GPMI_CTRL1_DECOUPLE_CS, r->gpmi_regs + HW_GPMI_CTRL1_SET); writel(BM_GPMI_CTRL1_DECOUPLE_CS, r->gpmi_regs + HW_GPMI_CTRL1_SET);
return 0;
err_out: err_out:
pm_runtime_mark_last_busy(this->dev);
pm_runtime_put_autosuspend(this->dev);
return ret; return ret;
} }
...@@ -2722,6 +2727,10 @@ static int gpmi_pm_resume(struct device *dev) ...@@ -2722,6 +2727,10 @@ static int gpmi_pm_resume(struct device *dev)
return ret; return ret;
} }
/* Set flag to get timing setup restored for next exec_op */
if (this->hw.clk_rate)
this->hw.must_apply_timings = true;
/* re-init the BCH registers */ /* re-init the BCH registers */
ret = bch_set_geometry(this); ret = bch_set_geometry(this);
if (ret) { if (ret) {
......
...@@ -2124,6 +2124,8 @@ static int spi_nor_sr2_bit1_quad_enable(struct spi_nor *nor) ...@@ -2124,6 +2124,8 @@ static int spi_nor_sr2_bit1_quad_enable(struct spi_nor *nor)
if (nor->bouncebuf[0] & SR2_QUAD_EN_BIT1) if (nor->bouncebuf[0] & SR2_QUAD_EN_BIT1)
return 0; return 0;
nor->bouncebuf[0] |= SR2_QUAD_EN_BIT1;
return spi_nor_write_16bit_cr_and_check(nor, nor->bouncebuf[0]); return spi_nor_write_16bit_cr_and_check(nor, nor->bouncebuf[0]);
} }
...@@ -4769,9 +4771,7 @@ static void spi_nor_info_init_params(struct spi_nor *nor) ...@@ -4769,9 +4771,7 @@ static void spi_nor_info_init_params(struct spi_nor *nor)
static void spansion_post_sfdp_fixups(struct spi_nor *nor) static void spansion_post_sfdp_fixups(struct spi_nor *nor)
{ {
struct mtd_info *mtd = &nor->mtd; if (nor->params.size <= SZ_16M)
if (mtd->size <= SZ_16M)
return; return;
nor->flags |= SNOR_F_4B_OPCODES; nor->flags |= SNOR_F_4B_OPCODES;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment