linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/14] Implement exec_op for GPMI nand driver
@ 2019-04-09 11:34 Sascha Hauer
  2019-04-09 11:34 ` [PATCH 01/14] mtd: rawnand: export nand operation tracer Sascha Hauer
                   ` (13 more replies)
  0 siblings, 14 replies; 36+ messages in thread
From: Sascha Hauer @ 2019-04-09 11:34 UTC (permalink / raw)
  To: linux-mtd
  Cc: kernel, Boris Brezillon, Richard Weinberger, Sascha Hauer,
	Vinod Koul, NXP Linux Team, Fabio Estevam, Miquel Raynal, Han Xu,
	Shawn Guo

The GPMI nand driver suffers from very poor performance. The read
performance can be roughly doubled with two steps: First is to use
runtime PM for controlling the clocks which prevents the driver from
spending a good amount of time en/disabling the clocks. The second step
is to implement exec_op which allows us to combine the steps necessary
to do a page read into a single DMA transaction.

I would prefer to let this go through the mtd tree with the ack of the
dmaengine maintainers

changes since v1:

- tested and fixed on i.MX28
- remove debugging leftover
- Add mxs dma specific header files to put the oddities of the mxs dma
  driver in
- Turn off BCH engine interrupts when not needed as they result in
  calling complete() on an uninitialized completion. This crashes
  on i.MX28

-----------------------------8<--------------------------------
Sascha Hauer (14):
  mtd: rawnand: export nand operation tracer
  mtd: rawnand: fsmc: Use nand_op_trace for operation tracing
  mtd: rawnand: gpmi: move all driver code into single file
  mtd: rawnand: gpmi: remove unused variable
  mtd: rawnand: gpmi: Remove unnecessary variables
  mtd: rawnand: gpmi: read buf in nand_read_page_op
  mtd: rawnand: gpmi: remove unused parameters
  mtd: rawnand: gpmi: Drop unnecessary restoring of previous
    chipselection
  mtd: rawnand: gpmi: use runtime PM to manage clocks
  dma: mxs: Drop unnecessary flag
  mtd: rawnand: gpmi: drop unnecessary flag
  dma: mxs: Add header file to be shared with gpmi nand driver
  dma: mxs: rename custom flag
  mtd: rawnand: gpmi: Implement exec_op

 drivers/dma/mxs-dma.c                      |   25 +-
 drivers/mtd/nand/raw/fsmc_nand.c           |   19 +-
 drivers/mtd/nand/raw/gpmi-nand/Makefile    |    1 -
 drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c  |  936 -----------
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 1687 ++++++++++++++------
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h |   64 +-
 drivers/mtd/nand/raw/nand_base.c           |   30 +-
 include/linux/dma/mxs-dma.h                |   24 +
 include/linux/mtd/rawnand.h                |   37 +
 9 files changed, 1264 insertions(+), 1559 deletions(-)
 delete mode 100644 drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
 create mode 100644 include/linux/dma/mxs-dma.h

-- 
2.20.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 36+ messages in thread
* [PATCH v3 00/14] Implement exec_op for GPMI nand driver
@ 2019-04-25 12:56 Sascha Hauer
  2019-04-25 12:56 ` [PATCH 05/14] mtd: rawnand: gpmi: Remove unnecessary variables Sascha Hauer
  0 siblings, 1 reply; 36+ messages in thread
From: Sascha Hauer @ 2019-04-25 12:56 UTC (permalink / raw)
  To: linux-mtd
  Cc: kernel, Boris Brezillon, Richard Weinberger, Sascha Hauer,
	Vinod Koul, NXP Linux Team, Fabio Estevam, Miquel Raynal, Han Xu,
	Shawn Guo

The GPMI nand driver suffers from very poor performance. The read
performance can be roughly doubled with two steps: First is to use
runtime PM for controlling the clocks which prevents the driver from
spending a good amount of time en/disabling the clocks. The second step
is to implement exec_op which allows us to combine the steps necessary
to do a page read into a single DMA transaction.

I would prefer to let this go through the mtd tree with the ack of the
dmaengine maintainers

changes since v2:

- s/dma/dmaengine in dmaengine specific patches
- s/nand/NAND/
- Add reviewed-by Miquel
- Add Acked-by Vinod

changes since v1:

- tested and fixed on i.MX28
- remove debugging leftover
- Add mxs dma specific header files to put the oddities of the mxs dma
  driver in
- Turn off BCH engine interrupts when not needed as they result in
  calling complete() on an uninitialized completion. This crashes
  on i.MX28

Sascha Hauer (14):
  mtd: rawnand: export NAND operation tracer
  mtd: rawnand: fsmc: Use nand_op_trace for operation tracing
  mtd: rawnand: gpmi: move all driver code into single file
  mtd: rawnand: gpmi: remove unused variable
  mtd: rawnand: gpmi: Remove unnecessary variables
  mtd: rawnand: gpmi: read buf in nand_read_page_op
  mtd: rawnand: gpmi: remove unused parameters
  mtd: rawnand: gpmi: Drop unnecessary restoring of previous chipselection
  mtd: rawnand: gpmi: use runtime PM to manage clocks
  dmaengine: mxs: Drop unnecessary flag
  mtd: rawnand: gpmi: drop unnecessary flag
  dmaengine: mxs: Add header file to be shared with gpmi nand driver
  dmaengine: mxs: rename custom flag
  mtd: rawnand: gpmi: Implement exec_op

 drivers/dma/mxs-dma.c                      |   25 +-
 drivers/mtd/nand/raw/fsmc_nand.c           |   19 +-
 drivers/mtd/nand/raw/gpmi-nand/Makefile    |    1 -
 drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c  |  936 -----------
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 1687 ++++++++++++++------
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h |   64 +-
 drivers/mtd/nand/raw/nand_base.c           |   30 +-
 include/linux/dma/mxs-dma.h                |   24 +
 include/linux/mtd/rawnand.h                |   37 +
 9 files changed, 1264 insertions(+), 1559 deletions(-)
 delete mode 100644 drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
 create mode 100644 include/linux/dma/mxs-dma.h

-- 
2.20.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 36+ messages in thread
* [PATCH v4 00/14] Implement exec_op for GPMI nand driver
@ 2019-05-21  7:06 Sascha Hauer
  2019-05-21  7:06 ` [PATCH 05/14] mtd: rawnand: gpmi: Remove unnecessary variables Sascha Hauer
  0 siblings, 1 reply; 36+ messages in thread
From: Sascha Hauer @ 2019-05-21  7:06 UTC (permalink / raw)
  To: linux-mtd
  Cc: kernel, Richard Weinberger, Sascha Hauer, Vinod Koul,
	NXP Linux Team, Fabio Estevam, Miquel Raynal, Han Xu, Shawn Guo

When rebasing on v5.2-rc1 I observe this backtrace:

[   10.789761] WARNING: CPU: 0 PID: 1 at /ptx/work/WORK_OOGHO/sha/backup/linux/linux/drivers/mtd/nand/raw/internals.h:
114 nand_reset_op+0x194/0x1c4
[   10.803137] Modules linked in:
[   10.806441] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.2.0-rc1-00014-g793f23e5adb0-dirty #676
[   10.815297] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[   10.822054] [<c0112928>] (unwind_backtrace) from [<c010d140>] (show_stack+0x10/0x14)
[   10.830054] [<c010d140>] (show_stack) from [<c0bd65cc>] (dump_stack+0xd8/0x110)
[   10.837609] [<c0bd65cc>] (dump_stack) from [<c0127148>] (__warn+0xe0/0x10c)
[   10.844791] [<c0127148>] (__warn) from [<c0127288>] (warn_slowpath_null+0x3c/0x48)
[   10.852604] [<c0127288>] (warn_slowpath_null) from [<c070be50>] (nand_reset_op+0x194/0x1c4)
[   10.861207] [<c070be50>] (nand_reset_op) from [<c070db44>] (nand_reset+0x58/0xb4)
[   10.868924] [<c070db44>] (nand_reset) from [<c070f454>] (nand_scan_with_ids+0x152c/0x1624)
[   10.877444] [<c070f454>] (nand_scan_with_ids) from [<c071a8a8>] (gpmi_nand_probe+0x2f8/0x6ac)
[   10.886235] [<c071a8a8>] (gpmi_nand_probe) from [<c067c2cc>] (platform_drv_probe+0x48/0x98)
[   10.894844] [<c067c2cc>] (platform_drv_probe) from [<c067a15c>] (really_probe+0xec/0x2c8)
[   10.903272] [<c067a15c>] (really_probe) from [<c067a494>] (driver_probe_device+0x5c/0x168)
[   10.911781] [<c067a494>] (driver_probe_device) from [<c067a748>] (device_driver_attach+0x58/0x60)
[   10.920909] [<c067a748>] (device_driver_attach) from [<c067a7d4>] (__driver_attach+0x84/0xc0)
[   10.929684] [<c067a7d4>] (__driver_attach) from [<c06785dc>] (bus_for_each_dev+0x70/0xb4)
[   10.938107] [<c06785dc>] (bus_for_each_dev) from [<c06795fc>] (bus_add_driver+0x154/0x1e0)
[   10.946615] [<c06795fc>] (bus_add_driver) from [<c067b430>] (driver_register+0x74/0x108)
[   10.954952] [<c067b430>] (driver_register) from [<c010317c>] (do_one_initcall+0x80/0x330)
[   10.963385] [<c010317c>] (do_one_initcall) from [<c11011a0>] (kernel_init_freeable+0x2e8/0x3cc)
[   10.972346] [<c11011a0>] (kernel_init_freeable) from [<c0bf0c60>] (kernel_init+0x8/0x114)
[   10.980768] [<c0bf0c60>] (kernel_init) from [<c01010b4>] (ret_from_fork+0x14/0x20)

I also reported this as an answer to the original patch introducing
this backtrace here:

http://lists.infradead.org/pipermail/linux-mtd/2019-May/089600.html

No idea what goes wrong here, but in the hope that it's not the fault of this
series I'm resending this rebased version anyway.

The GPMI nand driver suffers from very poor performance. The read
performance can be roughly doubled with two steps: First is to use
runtime PM for controlling the clocks which prevents the driver from
spending a good amount of time en/disabling the clocks. The second step
is to implement exec_op which allows us to combine the steps necessary
to do a page read into a single DMA transaction.

changes since v3:

- Rebase on v5.2-rc1

changes since v2:

- s/dma/dmaengine in dmaengine specific patches
- s/nand/NAND/
- Add reviewed-by Miquel
- Add Acked-by Vinod

changes since v1:

- tested and fixed on i.MX28
- remove debugging leftover
- Add mxs dma specific header files to put the oddities of the mxs dma
  driver in
- Turn off BCH engine interrupts when not needed as they result in
  calling complete() on an uninitialized completion. This crashes
  on i.MX28

Sascha Hauer (14):
  mtd: rawnand: export NAND operation tracer
  mtd: rawnand: fsmc: Use nand_op_trace for operation tracing
  mtd: rawnand: gpmi: move all driver code into single file
  mtd: rawnand: gpmi: remove unused variable
  mtd: rawnand: gpmi: Remove unnecessary variables
  mtd: rawnand: gpmi: read buf in nand_read_page_op
  mtd: rawnand: gpmi: remove unused parameters
  mtd: rawnand: gpmi: Drop unnecessary restoring of previous
    chipselection
  mtd: rawnand: gpmi: use runtime PM to manage clocks
  dmaengine: mxs: Drop unnecessary flag
  mtd: rawnand: gpmi: drop unnecessary flag
  dmaengine: mxs: Add header file to be shared with gpmi nand driver
  dmaengine: mxs: rename custom flag
  mtd: rawnand: gpmi: Implement exec_op

 drivers/dma/mxs-dma.c                      |   25 +-
 drivers/mtd/nand/raw/fsmc_nand.c           |   19 +-
 drivers/mtd/nand/raw/gpmi-nand/Makefile    |    1 -
 drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c  |  923 -----------
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 1685 ++++++++++++++------
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h |   64 +-
 drivers/mtd/nand/raw/nand_base.c           |   30 +-
 include/linux/dma/mxs-dma.h                |   24 +
 include/linux/mtd/rawnand.h                |   36 +
 9 files changed, 1261 insertions(+), 1546 deletions(-)
 create mode 100644 include/linux/dma/mxs-dma.h

-- 
2.20.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2019-06-03  8:04 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-09 11:34 [PATCH v2 00/14] Implement exec_op for GPMI nand driver Sascha Hauer
2019-04-09 11:34 ` [PATCH 01/14] mtd: rawnand: export nand operation tracer Sascha Hauer
2019-04-17 10:22   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 02/14] mtd: rawnand: fsmc: Use nand_op_trace for operation tracing Sascha Hauer
2019-04-17 10:22   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 03/14] mtd: rawnand: gpmi: move all driver code into single file Sascha Hauer
2019-04-17 10:23   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 04/14] mtd: rawnand: gpmi: remove unused variable Sascha Hauer
2019-04-17 10:24   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 05/14] mtd: rawnand: gpmi: Remove unnecessary variables Sascha Hauer
2019-04-17 10:24   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 06/14] mtd: rawnand: gpmi: read buf in nand_read_page_op Sascha Hauer
2019-04-17 10:25   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 07/14] mtd: rawnand: gpmi: remove unused parameters Sascha Hauer
2019-04-17 10:26   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 08/14] mtd: rawnand: gpmi: Drop unnecessary restoring of previous chipselection Sascha Hauer
2019-04-17 10:27   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 09/14] mtd: rawnand: gpmi: use runtime PM to manage clocks Sascha Hauer
2019-04-17 10:28   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 10/14] dma: mxs: Drop unnecessary flag Sascha Hauer
2019-04-17  8:16   ` Miquel Raynal
2019-04-23  5:21     ` Vinod Koul
2019-04-23  5:22   ` Vinod Koul
2019-04-09 11:34 ` [PATCH 11/14] mtd: rawnand: gpmi: drop " Sascha Hauer
2019-04-17 10:28   ` Miquel Raynal
2019-04-09 11:34 ` [PATCH 12/14] dma: mxs: Add header file to be shared with gpmi nand driver Sascha Hauer
2019-04-23  5:24   ` Vinod Koul
2019-04-09 11:34 ` [PATCH 13/14] dma: mxs: rename custom flag Sascha Hauer
2019-04-23  5:25   ` Vinod Koul
2019-04-09 11:34 ` [PATCH 14/14] mtd: rawnand: gpmi: Implement exec_op Sascha Hauer
2019-04-17 10:33   ` Miquel Raynal
2019-04-24  7:09     ` Sascha Hauer
2019-04-29  7:23       ` Miquel Raynal
2019-04-25 12:56 [PATCH v3 00/14] Implement exec_op for GPMI nand driver Sascha Hauer
2019-04-25 12:56 ` [PATCH 05/14] mtd: rawnand: gpmi: Remove unnecessary variables Sascha Hauer
2019-05-21  7:06 [PATCH v4 00/14] Implement exec_op for GPMI nand driver Sascha Hauer
2019-05-21  7:06 ` [PATCH 05/14] mtd: rawnand: gpmi: Remove unnecessary variables Sascha Hauer
2019-06-03  8:03   ` Miquel Raynal

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).