From patchwork Fri Dec 14 16:34:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1879611 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 0A21540079 for ; Fri, 14 Dec 2012 16:41:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756698Ab2LNQls (ORCPT ); Fri, 14 Dec 2012 11:41:48 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:60141 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756659Ab2LNQls (ORCPT ); Fri, 14 Dec 2012 11:41:48 -0500 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id qBEGfObT003999; Fri, 14 Dec 2012 10:41:24 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id qBEGfOPL031664; Fri, 14 Dec 2012 10:41:24 -0600 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Fri, 14 Dec 2012 10:41:23 -0600 Received: from localhost (h79-2.vpn.ti.com [172.24.79.2]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id qBEGfMNK013158; Fri, 14 Dec 2012 10:41:23 -0600 From: Felipe Balbi To: Wolfram Sang CC: , Linux OMAP Mailing List , Linux ARM Kernel Mailing List , Tony Lindgren , Felipe Balbi Subject: [PATCH REBASE 2/6] i2c: omap: also complete() when stat becomes zero Date: Fri, 14 Dec 2012 18:34:05 +0200 Message-ID: <1355502849-9289-3-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.8.1.rc1.5.g7e0651a In-Reply-To: <1355502849-9289-1-git-send-email-balbi@ti.com> References: <1355502849-9289-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org In case we loop on IRQ handler until stat is finally zero, we would end up in a situation where all I2C transfers would misteriously timeout because we were not calling complete() in that situation. Fix the issue by moving omap_i2c_complete_cmd() call inside the 'out' label. Signed-off-by: Felipe Balbi --- drivers/i2c/busses/i2c-omap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 9a9cf7c..fcecb0b 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -1022,9 +1022,8 @@ omap_i2c_isr_thread(int this_irq, void *dev_id) } } while (stat); - omap_i2c_complete_cmd(dev, err); - out: + omap_i2c_complete_cmd(dev, err); spin_unlock_irqrestore(&dev->lock, flags); return IRQ_HANDLED;