Commit d580e80c authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-linus-20170825' of git://git.infradead.org/linux-mtd

Pull MTD fixes from Brian Norris:
 "Two fixes - one for a 4.13 regression, and the other for an older one:

   - Atmel NAND: since we started utilizing ONFI timings, we found that
     we were being too restrict at rejecting them, partly due to
     discrepancies in ONFI 4.0 and earlier versions. Relax the
     restriction to keep these platforms booting. This is a 4.13-rc1
     regression.

   - nandsim: repeated probe/removal may not work after a failed init,
     because we didn't free up our debugfs files properly on the failure
     path. This has been around since 3.8, but it's nice to get this
     fixed now in a nice easy patch that can target -stable, since
     there's already refactoring work (that also fixes the issue)
     targeted for the next merge window"

* tag 'for-linus-20170825' of git://git.infradead.org/linux-mtd:
  mtd: nand: atmel: Relax tADL_min constraint
  mtd: nandsim: remove debugfs entries in error path
parents 0b31c3ec be3e83e3
...@@ -1364,7 +1364,18 @@ static int atmel_smc_nand_prepare_smcconf(struct atmel_nand *nand, ...@@ -1364,7 +1364,18 @@ static int atmel_smc_nand_prepare_smcconf(struct atmel_nand *nand,
ret = atmel_smc_cs_conf_set_timing(smcconf, ret = atmel_smc_cs_conf_set_timing(smcconf,
ATMEL_HSMC_TIMINGS_TADL_SHIFT, ATMEL_HSMC_TIMINGS_TADL_SHIFT,
ncycles); ncycles);
if (ret) /*
* Version 4 of the ONFI spec mandates that tADL be at least 400
* nanoseconds, but, depending on the master clock rate, 400 ns may not
* fit in the tADL field of the SMC reg. We need to relax the check and
* accept the -ERANGE return code.
*
* Note that previous versions of the ONFI spec had a lower tADL_min
* (100 or 200 ns). It's not clear why this timing constraint got
* increased but it seems most NANDs are fine with values lower than
* 400ns, so we should be safe.
*/
if (ret && ret != -ERANGE)
return ret; return ret;
ncycles = DIV_ROUND_UP(conf->timings.sdr.tAR_min, mckperiodps); ncycles = DIV_ROUND_UP(conf->timings.sdr.tAR_min, mckperiodps);
......
...@@ -2373,6 +2373,7 @@ static int __init ns_init_module(void) ...@@ -2373,6 +2373,7 @@ static int __init ns_init_module(void)
return 0; return 0;
err_exit: err_exit:
nandsim_debugfs_remove(nand);
free_nandsim(nand); free_nandsim(nand);
nand_release(nsmtd); nand_release(nsmtd);
for (i = 0;i < ARRAY_SIZE(nand->partitions); ++i) for (i = 0;i < ARRAY_SIZE(nand->partitions); ++i)
......
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