Skip to content

Commit

Permalink
Merge tag 'mtd/fixes-for-5.5-rc7' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/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
  • Loading branch information
Linus Torvalds committed Jan 19, 2020
2 parents 244dc26 + d704866 commit 8f8972a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 10 additions & 1 deletion drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ static int gpmi_init(struct gpmi_nand_data *this)
struct resources *r = &this->resources;
int ret;

ret = pm_runtime_get_sync(this->dev);
if (ret < 0)
return ret;

ret = gpmi_reset_block(r->gpmi_regs, false);
if (ret)
goto err_out;
Expand Down Expand Up @@ -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);

return 0;
err_out:
pm_runtime_mark_last_busy(this->dev);
pm_runtime_put_autosuspend(this->dev);
return ret;
}

Expand Down Expand Up @@ -2722,6 +2727,10 @@ static int gpmi_pm_resume(struct device *dev)
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 */
ret = bch_set_geometry(this);
if (ret) {
Expand Down
6 changes: 3 additions & 3 deletions drivers/mtd/spi-nor/spi-nor.c
Original file line number Diff line number Diff line change
Expand Up @@ -2124,6 +2124,8 @@ static int spi_nor_sr2_bit1_quad_enable(struct spi_nor *nor)
if (nor->bouncebuf[0] & SR2_QUAD_EN_BIT1)
return 0;

nor->bouncebuf[0] |= SR2_QUAD_EN_BIT1;

return spi_nor_write_16bit_cr_and_check(nor, nor->bouncebuf[0]);
}

Expand Down Expand Up @@ -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)
{
struct mtd_info *mtd = &nor->mtd;

if (mtd->size <= SZ_16M)
if (nor->params.size <= SZ_16M)
return;

nor->flags |= SNOR_F_4B_OPCODES;
Expand Down

0 comments on commit 8f8972a

Please sign in to comment.