From patchwork Thu Jun 6 13:43:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Ruppert X-Patchwork-Id: 249424 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 98EB42C0079 for ; Thu, 6 Jun 2013 23:44:38 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751892Ab3FFNoS (ORCPT ); Thu, 6 Jun 2013 09:44:18 -0400 Received: from mail.abilis.ch ([195.70.19.74]:27317 "EHLO mail.abilis.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751862Ab3FFNoO (ORCPT ); Thu, 6 Jun 2013 09:44:14 -0400 Received: from vzimbra0.lan (vzimbra0.lan [10.41.22.42]) by mail.abilis.ch (8.13.8/8.13.8) with ESMTP id r56Dhd97025971; Thu, 6 Jun 2013 15:43:39 +0200 Received: from ab42.lan (ab42.lan [10.41.22.170]) by vzimbra0.lan (Postfix) with ESMTP id 35C6990117F; Thu, 6 Jun 2013 15:43:39 +0200 (CEST) Received: by ab42.lan (Postfix, from userid 2100) id 33D2615C2; Thu, 6 Jun 2013 15:43:39 +0200 (CEST) From: Christian Ruppert To: Wolfram Sang , Mika Westerberg Cc: Jean Delvare , Pierrick Hascoet , Christian Ruppert , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] i2c: designware: make i2c xfers non-interruptible Date: Thu, 6 Jun 2013 15:43:36 +0200 Message-Id: <1370526216-10060-2-git-send-email-christian.ruppert@abilis.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1370526216-10060-1-git-send-email-christian.ruppert@abilis.com> References: <1370526216-10060-1-git-send-email-christian.ruppert@abilis.com> X-Spam-Status: No, score=-1.5 required=5.0 tests=ALL_TRUSTED,BAYES_05 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on dmmail0.lan Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org When the process at the source of an i2c transfer is killed in the middle of the transfer, the transfer is interrupted. Interrupted transfers might cause buggy slaves on the bus (or higher level drivers) to go haywire. This patch forces ongoing i2c transfers to finish properly, even if the initiating process is killed. Signed-off-by: Christian Ruppert --- drivers/i2c/busses/i2c-designware-core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c index 65c0c7a..d903368 100644 --- a/drivers/i2c/busses/i2c-designware-core.c +++ b/drivers/i2c/busses/i2c-designware-core.c @@ -585,7 +585,7 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) i2c_dw_xfer_init(dev); /* wait for tx to complete */ - ret = wait_for_completion_interruptible_timeout(&dev->cmd_complete, HZ); + ret = wait_for_completion_timeout(&dev->cmd_complete, HZ); if (ret == 0) { dev_err(dev->dev, "controller timed out\n"); /* i2c_dw_init implicitly disables the adapter */