From patchwork Thu May 28 13:03:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Hiremath X-Patchwork-Id: 49109 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 28A33202A3 for ; Thu, 28 May 2015 13:07:02 +0000 (UTC) Received: by lbbqq2 with SMTP id qq2sf10405992lbb.0 for ; Thu, 28 May 2015 06:07:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=/YkAOexZlCLO+zJGtxcU2tW2yK5C3GMBRzUlnMJ9O4M=; b=c9PssKwOxbpD/X0zP8gvlOdJ5n1Rm3VqboR0c47GcM/kOyKRnjE7cG1CpIDij+JH73 RP+mUbVFOp4hRcMWVneBeyBxxGijMj4E9JqXktORD87h20x/k3G4z2nG+sH8wJyICC9e CD8iPx3W0DdtYHptfruHrCeB/iQhyM6x7lvfbQhcED6W85WjdgfmraOODw9ueiKfWChu sDnNF9fGyNyDiuPG1fGcDeaKbnnlWLFKdg2WjAsWUI3qbbbiJvDjE46IHF5KsimZI1sI 54pdNBmTSy8LyiFDP8ZbrigcIP7uboGd7v2SzO+816BS4NiyKc3jaJ+in9mpE9HEmbVW ZHXA== X-Gm-Message-State: ALoCoQn2S8u2I3VmHT+XH/JyqJRX5KXHc/B4NSLk7A8QJE4D5MF1Xqm4JGe2nAWS21RpXvfk2VRY X-Received: by 10.152.203.233 with SMTP id kt9mr2619852lac.7.1432818421030; Thu, 28 May 2015 06:07:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.246.35 with SMTP id xt3ls176279lac.37.gmail; Thu, 28 May 2015 06:07:00 -0700 (PDT) X-Received: by 10.152.5.164 with SMTP id t4mr2721562lat.16.1432818420882; Thu, 28 May 2015 06:07:00 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id qa7si1928230lbc.18.2015.05.28.06.07.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 06:07:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by labpy14 with SMTP id py14so19443957lab.0 for ; Thu, 28 May 2015 06:07:00 -0700 (PDT) X-Received: by 10.152.2.133 with SMTP id 5mr1337172lau.36.1432818420606; Thu, 28 May 2015 06:07:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1144544lbb; Thu, 28 May 2015 06:06:59 -0700 (PDT) X-Received: by 10.68.235.38 with SMTP id uj6mr5334384pbc.57.1432818417960; Thu, 28 May 2015 06:06:57 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id em5si3485083pbb.256.2015.05.28.06.06.57; Thu, 28 May 2015 06:06:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753746AbbE1NG4 (ORCPT + 1 other); Thu, 28 May 2015 09:06:56 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:34665 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752113AbbE1NG4 (ORCPT ); Thu, 28 May 2015 09:06:56 -0400 Received: by pabru16 with SMTP id ru16so23251196pab.1 for ; Thu, 28 May 2015 06:06:55 -0700 (PDT) X-Received: by 10.68.131.225 with SMTP id op1mr5356439pbb.86.1432818415663; Thu, 28 May 2015 06:06:55 -0700 (PDT) Received: from localhost.localdomain ([202.62.77.106]) by mx.google.com with ESMTPSA id dc5sm2392557pbc.53.2015.05.28.06.06.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 May 2015 06:06:54 -0700 (PDT) From: Vaibhav Hiremath To: linux-i2c@vger.kernel.org Cc: Wolfram Sang , linux-arm-kernel@lists.infradead.org, Vaibhav Hiremath , "Jett.Zhou" Subject: [PATCH 08/12] i2c: pxa: enable/disable irq across message xfer Date: Thu, 28 May 2015 18:33:40 +0530 Message-Id: <1432818224-17070-9-git-send-email-vaibhav.hiremath@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432818224-17070-1-git-send-email-vaibhav.hiremath@linaro.org> References: <1432818224-17070-1-git-send-email-vaibhav.hiremath@linaro.org> Sender: linux-i2c-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-i2c@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: vaibhav.hiremath@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In order to avoid "spurious irq" caused by CP polling mode, enable irq at the entry of i2c_pxa_xfer() fn and disable it again before exit. Also disable it before exiting probe function. Signed-off-by: Jett.Zhou [vaibhav.hiremath@linaro.org: Split & merge patches into logical changes and update the Changelog] Signed-off-by: Vaibhav Hiremath Signed-off-by: Vaibhav Hiremath --- drivers/i2c/busses/i2c-pxa.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index 3c6ebb5..a3ac97c 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -1163,6 +1163,7 @@ static int i2c_pxa_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num struct pxa_i2c *i2c = adap->algo_data; int ret, i; + enable_irq(i2c->irq); for (i = adap->retries; i >= 0; i--) { ret = i2c_pxa_do_xfer(i2c, msgs, num); if (ret != I2C_RETRY) @@ -1176,6 +1177,7 @@ static int i2c_pxa_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num ret = -EREMOTEIO; out: i2c_pxa_set_slave(i2c, ret); + disable_irq(i2c->irq); return ret; } @@ -1363,6 +1365,8 @@ static int i2c_pxa_probe(struct platform_device *dev) i2c_pxa_reset(i2c); + disable_irq(i2c->irq); + i2c->adap.algo_data = i2c; i2c->adap.dev.parent = &dev->dev; #ifdef CONFIG_OF