mtd: onenand: omap2: Account waiting time as waiting on IO
authorLadislav Michl <ladis@linux-mips.org>
Fri, 12 Jan 2018 13:14:54 +0000 (14:14 +0100)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Fri, 12 Jan 2018 14:34:15 +0000 (15:34 +0100)
Use wait_for_completion_io_timeout, which has an impact on how the
task is accounted in scheduling stats.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Acked-by: Roger Quadros <rogerq@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/onenand/omap2.c

index 883993bbe40ba55b31c543c370d5cd6071d37701..0e7772e16d75b88b46890e6fb4981a148f4946c2 100644 (file)
@@ -170,9 +170,8 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state)
                if (result == 0) {
                        int retry_cnt = 0;
 retry:
-                       result = wait_for_completion_timeout(&c->irq_done,
-                                                   msecs_to_jiffies(20));
-                       if (result == 0) {
+                       if (!wait_for_completion_io_timeout(&c->irq_done,
+                                               msecs_to_jiffies(20))) {
                                /* Timeout after 20ms */
                                ctrl = read_reg(c, ONENAND_REG_CTRL_STATUS);
                                if (ctrl & ONENAND_CTRL_ONGO &&