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: 6498581 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 93F299F38C for ; Thu, 28 May 2015 13:15:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E7ACD20529 for ; Thu, 28 May 2015 13:15:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0289A205C4 for ; Thu, 28 May 2015 13:15:19 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yxxbi-0000jH-JO; Thu, 28 May 2015 13:12:22 +0000 Received: from mail-pa0-f50.google.com ([209.85.220.50]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YxxWn-00056P-FG for linux-arm-kernel@lists.infradead.org; Thu, 28 May 2015 13:07:19 +0000 Received: by paza2 with SMTP id a2so23314391paz.3 for ; Thu, 28 May 2015 06:06:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=e31KjAocwkImmx6Gn9YVCiIjD9Je9TKJyeE1Kbqk3MI=; b=Jtih/uWIrGIoqYBQi4Qbp9LOwhkf7uFVEqsocjuajZKRgdU3XxlylHEwgzWYEJTvr+ hk6akSsEdPo0Hx6Uo4kNdTYKDfJthZYHBYSP4PHkwfPq7qf8gsWFcLbzKEfIVXX1+Aqe lCrzf+JvY/QDGEJXYe4fbpZNHJqqXDogAsQOy981B7TtdJ67aviu+q/gX/umJujq3zrs 1qhwa3VtJQ+JkQvhSE93rJcti5Knv9Oodz/cyGkoWznPHmQSMSn+Mtgy37Xk5j7nH82W VUxAYQKK/pVF1653FlRxut9famMjYE0Rkj+R2ld6rU9vMAkr3A+sowFtj5Xa2utkLy5U AD2A== X-Gm-Message-State: ALoCoQkna274PPugYrJ7mFeFHQXvVIhvhnhLp/dX7vgcc+4HDoqZP8hp2DGmQQqPrri+EICdqPai 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150528_060717_619293_03B02650 X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: "Jett.Zhou" , Vaibhav Hiremath , linux-arm-kernel@lists.infradead.org, Wolfram Sang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 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