From patchwork Fri Jan 12 13:14:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ladislav Michl X-Patchwork-Id: 10160817 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1F589602A7 for ; Fri, 12 Jan 2018 13:15:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D50C289E4 for ; Fri, 12 Jan 2018 13:15:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0214F289E8; Fri, 12 Jan 2018 13:14:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA598289E4 for ; Fri, 12 Jan 2018 13:14:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933465AbeALNO5 (ORCPT ); Fri, 12 Jan 2018 08:14:57 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:39368 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933458AbeALNO5 (ORCPT ); Fri, 12 Jan 2018 08:14:57 -0500 Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23994659AbeALNO4U-6jd (ORCPT ); Fri, 12 Jan 2018 14:14:56 +0100 Date: Fri, 12 Jan 2018 14:14:54 +0100 From: Ladislav Michl To: linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org Cc: Boris Brezillon , Roger Quadros , Peter Ujfalusi , Kyungmin Park , Aaro Koskinen , Tony Lindgren Subject: [PATCH v6 07/14] mtd: onenand: omap2: Account waiting time as waiting on IO Message-ID: <20180112131454.GH13810@lenoch> References: <20180112131105.GA13810@lenoch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180112131105.GA13810@lenoch> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use wait_for_completion_io_timeout, which has an impact on how the task is accounted in scheduling stats. Signed-off-by: Ladislav Michl Reviewed-by: Peter Ujfalusi Reviewed-by: Sebastian Reichel Acked-by: Roger Quadros Tested-by: Tony Lindgren Tested-by: Aaro Koskinen --- Changes in v6: None Changes in v5: None Changes in v4: - new patch Changes in v3: None Changes in v2: None drivers/mtd/onenand/omap2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c index 883993bbe40b..0e7772e16d75 100644 --- a/drivers/mtd/onenand/omap2.c +++ b/drivers/mtd/onenand/omap2.c @@ -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 &&