mtd: rawnand: Remove docg4
Subsystems (2)
RFC PATCH 1/1 mtd: rawnand: Remove docg4
The diskonchip G4 driver does not fit very well in the raw/parallel NAND framework simply because such chips have an internal controller translating DoC-specific commands into NAND ones.
Keeping such a driver in the raw NAND framework is a real burden for NAND maintainers.
Not to mention that some part in this drivers are a bit worrisome:
- writes are done by subpages, even though we're interfacing with an MLC chip which are known to not support subpage writes very well (it might be that the FTL handles the complexity for us though)
- some part of the code are simply ignoring return codes of function that can fail in a few occasions
- there's a hack to support OOB writes when no data is provided. This operation is not supported by the chip and should have been rejected, and nandwrite and other userspace tools should have been patched to deal with such devices
- the driver is apparently broken when ignore_badblocks module param is not set to 1 and nobody noticed that (don't know since when this is the case, but it's not a recent change)
http://lists.infradead.org/pipermail/linux-mtd/2018-July/082472.html
Add to that the fact that we already have a docg3 driver in drivers/mtd/devices/docg3.c and, looking at the code (and regs), it seems docg3 and docg4 have a lot in common (even the author of this driver seemed to have realized that interfacing with the raw NAND framework might have been a bad idea
http://lists.infradead.org/pipermail/linux-mtd/2012-January/039517.html).
For all these reasons, I'm proposing to remove this driver. If anyone ever wants to add support for this chip back, I'd suggest extending the docg3 driver instead of adding a completely new driver.
---
Hello,
Just a side note to say that I hate removing drivers without coming with a good alternative to replace it, so I started converting this driver to use the generic NAND framework and move it into drivers/mtd/nand/diskonchip/docg4.c. While doing that I realized that I couldn't really tests the changes I was doing and thought it was useless to do the work if no one cares about this driver, plus, I found out that the docg3 reg layout was really close to the docg4 one, and that docg3 had taken a better approach in interfacing directly with the MTD layer (we could probably move docg3 in drivers/mtd/nand/diskonchip and adapt it to use the generic NAND layer, but that's a different story).
Anyway, enough time trying to justify my choice. I'm here to help anyone that wants to have docg4 supported again, actually, if I see that someone shows interest in docg4, I'm willing to help him add support for it in docg3 (or anywhere else) before removing the driver. On the other hand, if that's not the case, I'd like to see this driver removed because, as I say in my commit message, having such drivers in the raw NAND subsystem prevents us from moving on with the changes we recently started (replace ->cmdfunc() by ->exec_op()).
So, anyone against this removal, please let us know quickly, because I'm seriously considering asking Miquel to queue this change for 4.20.
Regards,
Boris
--- drivers/mtd/nand/raw/Kconfig | 20 - drivers/mtd/nand/raw/Makefile | 1 - drivers/mtd/nand/raw/docg4.c | 1442 ----------------------------------------- 3 files changed, 1463 deletions(-) delete mode 100644 drivers/mtd/nand/raw/docg4.c
drivers/mtd/nand/raw/Kconfig +0 -20
@@ -228,26 +228,6 @@ config MTD_NAND_DISKONCHIP_BBTWRITE load time (assuming you build diskonchip as a module) with the module parameter "inftl_bbt_write=1". -config MTD_NAND_DOCG4 - tristate "Support for DiskOnChip G4" - depends on HAS_IOMEM - select BCH - select BITREVERSE - help - Support for diskonchip G4 nand flash, found in various smartphones and - PDAs, among them the Palm Treo680, HTC Prophet and Wizard, Toshiba - Portege G900, Asus P526, and O2 XDA Zinc. - - With this driver you will be able to use UBI and create a ubifs on the - device, so you may wish to consider enabling UBI and UBIFS as well. - - These devices ship with the Mys/Sandisk SAFTL formatting, for which - there is currently no mtd parser, so you may want to use command line - partitioning to segregate write-protected blocks. On the Treo680, the - first five erase blocks (256KiB each) are write-protected, followed - by the block containing the saftl partition table. This is probably - typical. - config MTD_NAND_SHARPSL tristate "Support for NAND Flash on Sharp SL Series (C7xx + others)" depends on ARCH_PXA || COMPILE_TEST
drivers/mtd/nand/raw/Makefile +0 -1
@@ -15,7 +15,6 @@ obj-$(CONFIG_MTD_NAND_S3C2410) += s3c2410.o obj-$(CONFIG_MTD_NAND_TANGO) += tango_nand.o obj-$(CONFIG_MTD_NAND_DAVINCI) += davinci_nand.o obj-$(CONFIG_MTD_NAND_DISKONCHIP) += diskonchip.o -obj-$(CONFIG_MTD_NAND_DOCG4) += docg4.o obj-$(CONFIG_MTD_NAND_FSMC) += fsmc_nand.o obj-$(CONFIG_MTD_NAND_SHARPSL) += sharpsl.o obj-$(CONFIG_MTD_NAND_NANDSIM) += nandsim.o
drivers/mtd/nand/raw/docg4.c deleted +0 -1442
1,442 lines not on this page · raw message
Signature · 1 line
2.14.1
Miquel Raynal
maintainerHi Boris,
Boris Brezillon <[email protected]> wrote on Mon, 30 Jul 2018 22:13:41 +0200:
Quoted 37 lines
The diskonchip G4 driver does not fit very well in the raw/parallel NAND framework simply because such chips have an internal controller translating DoC-specific commands into NAND ones.
Keeping such a driver in the raw NAND framework is a real burden for NAND maintainers.
Not to mention that some part in this drivers are a bit worrisome:
- writes are done by subpages, even though we're interfacing with an MLC chip which are known to not support subpage writes very well (it might be that the FTL handles the complexity for us though)
- some part of the code are simply ignoring return codes of function that can fail in a few occasions
- there's a hack to support OOB writes when no data is provided. This operation is not supported by the chip and should have been rejected, and nandwrite and other userspace tools should have been patched to deal with such devices
- the driver is apparently broken when
ignore_badblocksmodule param is not set to 1 and nobody noticed that (don't know since when this is the case, but it's not a recent change)
http://lists.infradead.org/pipermail/linux-mtd/2018-July/082472.htmlAdd to that the fact that we already have a docg3 driver in
drivers/mtd/devices/docg3.cand, looking at the code (and regs), it seems docg3 and docg4 have a lot in common (even the author of this driver seemed to have realized that interfacing with the raw NAND framework might have been a bad idea
http://lists.infradead.org/pipermail/linux-mtd/2012-January/039517.html).For all these reasons, I'm proposing to remove this driver. If anyone ever wants to add support for this chip back, I'd suggest extending the docg3 driver instead of adding a completely new driver.
Quoted 5 lines
Signed-off-by Boris Brezillon <[email protected]>Cc Mike Dunn <[email protected]>Cc Robert Jarzmik <[email protected]>Cc Sergey Larin <[email protected]>---
I do agree in removing this driver.
I just checked for docg4 references and it looks like palmeo.c board file has some code related to it, enclosed in a
#if IS_ENABLED(CONFIG_MTD_NAND_DOCG4)
Besides the fact that it is the only user, that's probably something we should also remove.
Plus, I recently added a mention to the docg4 driver in nand_base.c during the conversion to nand_scan() (to skip nand_scan_ident()). It might be worth removing the extra code or at least the reference in the comment.
Thanks,
Miquèl
Quoted 50 lines · Miquel Raynal
Hi Boris,
Boris Brezillon <[email protected]> wrote on Mon, 30 Jul 2018 22:13:41 +0200:
Quoted 37 lines
The diskonchip G4 driver does not fit very well in the raw/parallel NAND framework simply because such chips have an internal controller translating DoC-specific commands into NAND ones.
Keeping such a driver in the raw NAND framework is a real burden for NAND maintainers.
Not to mention that some part in this drivers are a bit worrisome:
- writes are done by subpages, even though we're interfacing with an MLC chip which are known to not support subpage writes very well (it might be that the FTL handles the complexity for us though)
- some part of the code are simply ignoring return codes of function that can fail in a few occasions
- there's a hack to support OOB writes when no data is provided. This operation is not supported by the chip and should have been rejected, and nandwrite and other userspace tools should have been patched to deal with such devices
- the driver is apparently broken when
ignore_badblocksmodule param is not set to 1 and nobody noticed that (don't know since when this is the case, but it's not a recent change)
http://lists.infradead.org/pipermail/linux-mtd/2018-July/082472.htmlAdd to that the fact that we already have a docg3 driver in
drivers/mtd/devices/docg3.cand, looking at the code (and regs), it seems docg3 and docg4 have a lot in common (even the author of this driver seemed to have realized that interfacing with the raw NAND framework might have been a bad idea
http://lists.infradead.org/pipermail/linux-mtd/2012-January/039517.html).For all these reasons, I'm proposing to remove this driver. If anyone ever wants to add support for this chip back, I'd suggest extending the docg3 driver instead of adding a completely new driver.
Quoted 5 lines
Signed-off-by Boris Brezillon <[email protected]>Cc Mike Dunn <[email protected]>Cc Robert Jarzmik <[email protected]>Cc Sergey Larin <[email protected]>---
I do agree in removing this driver.
Quoted 7 lines
I just checked for docg4 references and it looks like
palmeo.cboard file has some code related to it, enclosed in a#if IS_ENABLED(CONFIG_MTD_NAND_DOCG4)Besides the fact that it is the only user, that's probably something we should also remove.
Thanks for the heads-up.
Yes, it seems reasonable to remove it, if that helps you in the MTD area. These boards are not really maintained by anybody. Robert and I will gradually move them over to DT over the next releases, and drop things that are no longer supported. They can then be added back by anyone with such hardware at hand.
Thanks,
Daniel
Quoted 55 lines · On Tue, 31 Jul 2018 10:20:35 +0200 Miquel Raynal <[email protected]>…
Hi Boris,
Boris Brezillon <[email protected]> wrote on Mon, 30 Jul 2018 22:13:41 +0200:
Quoted 37 lines
The diskonchip G4 driver does not fit very well in the raw/parallel NAND framework simply because such chips have an internal controller translating DoC-specific commands into NAND ones.
Keeping such a driver in the raw NAND framework is a real burden for NAND maintainers.
Not to mention that some part in this drivers are a bit worrisome:
- writes are done by subpages, even though we're interfacing with an MLC chip which are known to not support subpage writes very well (it might be that the FTL handles the complexity for us though)
- some part of the code are simply ignoring return codes of function that can fail in a few occasions
- there's a hack to support OOB writes when no data is provided. This operation is not supported by the chip and should have been rejected, and nandwrite and other userspace tools should have been patched to deal with such devices
- the driver is apparently broken when
ignore_badblocksmodule param is not set to 1 and nobody noticed that (don't know since when this is the case, but it's not a recent change)
http://lists.infradead.org/pipermail/linux-mtd/2018-July/082472.htmlAdd to that the fact that we already have a docg3 driver in
drivers/mtd/devices/docg3.cand, looking at the code (and regs), it seems docg3 and docg4 have a lot in common (even the author of this driver seemed to have realized that interfacing with the raw NAND framework might have been a bad idea
http://lists.infradead.org/pipermail/linux-mtd/2012-January/039517.html).For all these reasons, I'm proposing to remove this driver. If anyone ever wants to add support for this chip back, I'd suggest extending the docg3 driver instead of adding a completely new driver.
Quoted 5 lines
Signed-off-by Boris Brezillon <[email protected]>Cc Mike Dunn <[email protected]>Cc Robert Jarzmik <[email protected]>Cc Sergey Larin <[email protected]>---
I do agree in removing this driver.
I just checked for docg4 references and it looks like
palmeo.cboard file has some code related to it, enclosed in a#if IS_ENABLED(CONFIG_MTD_NAND_DOCG4)
Quoted 7 lines
Besides the fact that it is the only user, that's probably something we should also remove.
Plus, I recently added a mention to the docg4 driver in
nand_base.cduring the conversion tonand_scan()(to skipnand_scan_ident()). It might be worth removing the extra code or at least the reference in the comment.
Yep. Let's wait for more feedback, and if we all agree that this driver should be removed I'll send a new version with 2 new patches to remove the unused code.