netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] mtd: Simplify erase handling
@ 2018-02-12 21:03 Boris Brezillon
  2018-02-12 21:03 ` [PATCH 1/5] mtd: Initialize ->fail_addr early in mtd_erase() Boris Brezillon
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Boris Brezillon @ 2018-02-12 21:03 UTC (permalink / raw)
  To: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, linux-mtd
  Cc: devel, Bert Kenward, Solarflare linux maintainers,
	Artem Bityutskiy, Miquel Raynal, Michael Ellerman, linuxppc-dev,
	Joern Engel, Greg Kroah-Hartman, Kyungmin Park, netdev,
	Paul Mackerras, Benjamin Herrenschmidt, Edward Cree,
	Robert Jarzmik

Hello,

This series aims at simplifying erase handling both in MTD drivers and
MTD users code.

Historically, the erase operation has been designed to be asynchronous,
which, in theory, is a good thing since erasing a block usually takes
longer that reading/writing to a flash. In practice, all drivers are
implementing ->_erase() in a synchronous manner. Moreover, both drivers
and users are inconsistently updating/checking the erase_info fields.

In order to simplify things, let's assume ->_erase() is and will always
be synchronous. This also make error code checking more consistent and
allows us to get rid of a few hundred lines of code.

Regards,

Boris

Boris Brezillon (5):
  mtd: Initialize ->fail_addr early in mtd_erase()
  mtd: Get rid of unused fields in struct erase_info
  mtd: Stop assuming mtd_erase() is asynchronous
  mtd: Unconditionally update ->fail_addr and ->addr in part_erase()
  mtd: Stop updating erase_info->state and calling mtd_erase_callback()

 drivers/mtd/chips/cfi_cmdset_0001.c      | 16 +-----
 drivers/mtd/chips/cfi_cmdset_0002.c      | 26 ++-------
 drivers/mtd/chips/cfi_cmdset_0020.c      |  3 --
 drivers/mtd/chips/map_ram.c              |  2 -
 drivers/mtd/devices/bcm47xxsflash.c      | 12 +----
 drivers/mtd/devices/block2mtd.c          |  7 +--
 drivers/mtd/devices/docg3.c              | 16 +-----
 drivers/mtd/devices/lart.c               |  4 --
 drivers/mtd/devices/mtd_dataflash.c      |  4 --
 drivers/mtd/devices/mtdram.c             |  2 -
 drivers/mtd/devices/phram.c              |  2 -
 drivers/mtd/devices/pmc551.c             |  2 -
 drivers/mtd/devices/powernv_flash.c      | 11 +---
 drivers/mtd/devices/slram.c              |  2 -
 drivers/mtd/devices/spear_smi.c          |  3 --
 drivers/mtd/devices/sst25l.c             |  3 --
 drivers/mtd/devices/st_spi_fsm.c         |  4 --
 drivers/mtd/ftl.c                        | 52 +++---------------
 drivers/mtd/inftlmount.c                 |  8 ++-
 drivers/mtd/lpddr/lpddr2_nvm.c           | 10 +---
 drivers/mtd/lpddr/lpddr_cmds.c           |  2 -
 drivers/mtd/mtdblock.c                   | 21 --------
 drivers/mtd/mtdchar.c                    | 34 +-----------
 drivers/mtd/mtdconcat.c                  | 48 +----------------
 drivers/mtd/mtdcore.c                    | 17 +++---
 drivers/mtd/mtdoops.c                    | 20 -------
 drivers/mtd/mtdpart.c                    | 23 ++------
 drivers/mtd/mtdswap.c                    | 34 ------------
 drivers/mtd/nand/nand_base.c             | 16 ++----
 drivers/mtd/nand/nand_bbt.c              |  1 -
 drivers/mtd/nftlmount.c                  |  5 +-
 drivers/mtd/onenand/onenand_base.c       | 17 ------
 drivers/mtd/rfd_ftl.c                    | 93 ++++++++++----------------------
 drivers/mtd/sm_ftl.c                     | 19 -------
 drivers/mtd/sm_ftl.h                     |  4 --
 drivers/mtd/spi-nor/spi-nor.c            |  3 --
 drivers/mtd/tests/mtd_test.c             |  5 --
 drivers/mtd/tests/speedtest.c            |  7 ---
 drivers/mtd/ubi/gluebi.c                 |  3 --
 drivers/mtd/ubi/io.c                     | 36 -------------
 drivers/net/ethernet/sfc/falcon/mtd.c    | 11 +---
 drivers/net/ethernet/sfc/mtd.c           | 11 +---
 drivers/staging/goldfish/goldfish_nand.c |  3 --
 fs/jffs2/erase.c                         | 37 ++-----------
 include/linux/mtd/mtd.h                  | 19 +------
 45 files changed, 79 insertions(+), 599 deletions(-)

-- 
2.14.1

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-03-18 21:22 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-12 21:03 [PATCH 0/5] mtd: Simplify erase handling Boris Brezillon
2018-02-12 21:03 ` [PATCH 1/5] mtd: Initialize ->fail_addr early in mtd_erase() Boris Brezillon
2018-02-12 21:47   ` Richard Weinberger
2018-03-18 21:22   ` Boris Brezillon
2018-02-12 21:03 ` [PATCH 2/5] mtd: Get rid of unused fields in struct erase_info Boris Brezillon
2018-02-12 21:47   ` Richard Weinberger
2018-02-12 21:03 ` [PATCH 3/5] mtd: Stop assuming mtd_erase() is asynchronous Boris Brezillon
2018-02-12 21:58   ` Richard Weinberger
2018-02-12 21:03 ` [PATCH 4/5] mtd: Unconditionally update ->fail_addr and ->addr in part_erase() Boris Brezillon
2018-02-12 22:05   ` Richard Weinberger
2018-02-12 21:03 ` [PATCH 5/5] mtd: Stop updating erase_info->state and calling mtd_erase_callback() Boris Brezillon
2018-02-12 22:17   ` Richard Weinberger
2018-02-13  7:42   ` Miquel Raynal
2018-02-13  8:17     ` Boris Brezillon
2018-02-13  8:33       ` Miquel Raynal
2018-02-13 12:09   ` Bert Kenward

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).