From patchwork Fri Jul 10 05:09:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vignesh Raghavendra X-Patchwork-Id: 6761321 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4C5A4C05AC for ; Fri, 10 Jul 2015 05:11:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DDED20713 for ; Fri, 10 Jul 2015 05:11:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 683222068A for ; Fri, 10 Jul 2015 05:11:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752118AbbGJFLX (ORCPT ); Fri, 10 Jul 2015 01:11:23 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:38656 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751772AbbGJFLV (ORCPT ); Fri, 10 Jul 2015 01:11:21 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id t6A5BGeV022748; Fri, 10 Jul 2015 00:11:16 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t6A5BFW3019506; Fri, 10 Jul 2015 00:11:16 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Fri, 10 Jul 2015 00:10:58 -0500 Received: from uda0132425.apr.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t6A5BDOQ019671; Fri, 10 Jul 2015 00:11:14 -0500 From: Vignesh R To: Tony Lindgren , Wolfram Sang CC: , , , Vignesh R Subject: [RFC PATCH] i2c: busses: i2c-omap: Increase timeout for i2c interrupt Date: Fri, 10 Jul 2015 10:39:54 +0530 Message-ID: <1436504994-31137-1-git-send-email-vigneshr@ti.com> X-Mailer: git-send-email 2.4.5 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When system is under load and there is an i2c transaction running following warning appears on the console: [ 730.003617] omap_i2c 48070000.i2c: controller timed out [ 731.023643] omap_i2c 48070000.i2c: controller timed out This is because, the completion() call, which is done in bottom half of the interrupt handler, happens after the timeout period(1s) has elapsed for the wait_for_completion_timeout() in omap_i2c_xfer_msg(). The interrupt is raised within a second but due to system load (or other interrupts), the bottom half does not get scheduled within a second. Hence even though the interrupt has happened within required time frame, due to delayed scheduling of bottom half, spurious timeout errors are reported on the console and i2c controller is reset. i2c timeout is a rare condition, hence increase timeout to 60s in order to avoid reporting false timeout events under load. Signed-off-by: Vignesh R --- I reproduced this while running i2cdump in a loop and reading from flash using dd command. drivers/i2c/busses/i2c-omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index d1c22e3fdd14..fa7758f0302c 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -50,7 +50,7 @@ #define OMAP_I2C_REV_ON_4430_PLUS 0x50400002 /* timeout waiting for the controller to respond */ -#define OMAP_I2C_TIMEOUT (msecs_to_jiffies(1000)) +#define OMAP_I2C_TIMEOUT (msecs_to_jiffies(60 * 1000)) /* timeout for pm runtime autosuspend */ #define OMAP_I2C_PM_TIMEOUT 1000 /* ms */