]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: nand: denali: use interrupt instead of polling for bank reset
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 13 Jun 2017 13:45:41 +0000 (22:45 +0900)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Tue, 20 Jun 2017 07:14:37 +0000 (09:14 +0200)
commite513912fe6214d58be6b07e93144baa2920f0239
treea128e070ed70fc11e3ddaa1c752523be78a5b526
parentcae5e028916da39580045a9fe8e2e8c2b9e82290
mtd: nand: denali: use interrupt instead of polling for bank reset

The current bank reset implementation polls the INTR_STATUS register
until interested bits are set.  This is not good because:

- polling simply wastes time-slice of the thread

- The while() loop may continue eternally if no bit is set, for
  example, due to the controller problem.  The denali_wait_for_irq()
  uses wait_for_completion_timeout(), which is safer.

We can use interrupt by moving the denali_reset_bank() call below
the interrupt setup.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/denali.c