mbox series

[v3,00/14] Implement exec_op for GPMI nand driver

Message ID 20190425125643.29990-1-s.hauer@pengutronix.de
Headers show
Series Implement exec_op for GPMI nand driver | expand

Message

Sascha Hauer April 25, 2019, 12:56 p.m. UTC
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

Comments

Miquel Raynal May 20, 2019, 2:30 p.m. UTC | #1
Hi Sascha,

Sascha Hauer <s.hauer@pengutronix.de> wrote on Thu, 25 Apr 2019
14:56:29 +0200:

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

Please ignore the previous message telling the patch was applied, I
have to manually fix all the conflicts, I canceled the operation: would
you mind rebasing on v5.2-rc1 and respin?


Thanks and sorry for the trouble,
Miquèl
Sascha Hauer May 21, 2019, 7:12 a.m. UTC | #2
On Mon, May 20, 2019 at 04:30:38PM +0200, Miquel Raynal wrote:
> Hi Sascha,
> 
> Sascha Hauer <s.hauer@pengutronix.de> wrote on Thu, 25 Apr 2019
> 14:56:29 +0200:
> 
> > 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
> > 
> 
> Please ignore the previous message telling the patch was applied, I
> have to manually fix all the conflicts, I canceled the operation: would
> you mind rebasing on v5.2-rc1 and respin?

Yes, due to the patch merging the two files into one the rebase was a
bit tricky with the changes to the driver in the last merge window. It
basically meant redoing "mtd: rawnand: gpmi: move all driver code into
single file" completely to get the changes from the last window into
that patch. Don't worry, I pretty much expected that. Find a new version
in your inbox.

Sascha
Miquel Raynal May 21, 2019, 7:31 a.m. UTC | #3
Hi Sascha,

Sascha Hauer <s.hauer@pengutronix.de> wrote on Tue, 21 May 2019
09:12:36 +0200:

> On Mon, May 20, 2019 at 04:30:38PM +0200, Miquel Raynal wrote:
> > Hi Sascha,
> > 
> > Sascha Hauer <s.hauer@pengutronix.de> wrote on Thu, 25 Apr 2019
> > 14:56:29 +0200:
> >   
> > > 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
> > >   
> > 
> > Please ignore the previous message telling the patch was applied, I
> > have to manually fix all the conflicts, I canceled the operation: would
> > you mind rebasing on v5.2-rc1 and respin?  
> 
> Yes, due to the patch merging the two files into one the rebase was a
> bit tricky with the changes to the driver in the last merge window. It
> basically meant redoing "mtd: rawnand: gpmi: move all driver code into
> single file" completely to get the changes from the last window into
> that patch. Don't worry, I pretty much expected that. Find a new version
> in your inbox.
> 

Thank you very much!

Miquèl