linux_dsm_epyc7002/include/linux/mtd
Boris Brezillon 013e6292aa mtd: rawnand: Simplify the locking
nand_get_device() was complex for apparently no good reason. Let's
replace this locking scheme with 2 mutexes: one attached to the
controller and another one attached to the chip.

Every time the core calls nand_get_device(), it will first lock the
chip and if the chip is not suspended, will then lock the controller.
nand_release_device() will release both lock in the reverse order.

nand_get_device() can sleep, just like the previous implementation,
which means you should never call that from an atomic context.

We also get rid of

- the chip->state field, since all it was used for was flagging the
  chip as suspended. We replace it by a field called chip->suspended
  and directly set it from nand_suspend/resume()
- the controller->wq and controller->active fields which are no longer
  needed since the new controller->lock (now a mutex) guarantees that
  all operations are serialized at the controller level
- panic_nand_get_device() which would anyway be a no-op. Talking about
  panic write, I keep thinking the rawnand implementation is unsafe
  because there's not negotiation with the controller to know when it's
  actually done with it's previous operation. I don't intend to fix
  that here, but that's probably something we should look at, or maybe
  we should consider dropping the ->_panic_write() implementation

Last important change to mention: we now return -EBUSY when someone
tries to access a device that as been suspended, and propagate this
error to the upper layer.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
2019-02-05 15:39:40 +01:00
..
bbm.h
blktrans.h mtd_blkdevs: convert to blk-mq 2018-10-16 08:09:58 -06:00
cfi_endian.h
cfi.h mtd: spi-nor: add macros related to MICRON flash 2018-12-10 21:59:07 +01:00
concat.h
doc2000.h
flashchip.h
ftl.h
gen_probe.h
inftl.h
jedec.h mtd: rawnand: Move JEDEC code to nand_jedec.c 2018-10-03 11:12:25 +02:00
latch-addr-flash.h
lpc32xx_mlc.h
lpc32xx_slc.h
map.h
mtd.h Char/Misc driver patches for 4.21-rc1 2018-12-28 20:54:57 -08:00
mtdram.h
nand_bch.h mtd: rawnand: Pass a nand_chip object to ecc->correct() 2018-10-03 11:12:25 +02:00
nand_ecc.h mtd: rawnand: Allow selection of ECC byte ordering at runtime 2018-10-03 11:12:25 +02:00
nand-gpio.h
nand.h mtd: nand: Fix nanddev_pos_next_page() kernel-doc header 2018-11-06 17:40:31 +01:00
ndfc.h
nftl.h
onenand_regs.h
onenand.h
onfi.h mtd: rawnand: Move ONFI code to nand_onfi.c 2018-10-03 11:12:25 +02:00
partitions.h
pfow.h
physmap.h
pismo.h
plat-ram.h
platnand.h mtd: rawnand: Move platform_nand_xxx definitions out of rawnand.h 2018-10-03 11:12:25 +02:00
qinfo.h
rawnand.h mtd: rawnand: Simplify the locking 2019-02-05 15:39:40 +01:00
sh_flctl.h mtd: rawnand: sh_flctl: convert to SPDX identifiers 2018-11-13 09:32:04 +01:00
sharpsl.h
spear_smi.h
spi-nor.h mtd: spi-nor: parse SFDP 4-byte Address Instruction Table 2018-12-10 21:59:08 +01:00
spinand.h mtd: spinand: add support for GigaDevice GD5FxGQ4xA 2018-12-07 10:59:23 +01:00
super.h
ubi.h
xip.h