From patchwork Mon Nov 30 22:10:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 550486 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 9840F140216; Tue, 1 Dec 2015 09:15:30 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1a3WjI-000249-K1; Mon, 30 Nov 2015 22:15:28 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1a3Weg-0007ht-Th for kernel-team@lists.ubuntu.com; Mon, 30 Nov 2015 22:10:42 +0000 Received: from 1.general.kamal.us.vpn ([10.172.68.52] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1a3Weg-0001il-NK; Mon, 30 Nov 2015 22:10:42 +0000 Received: from kamal by fourier with local (Exim 4.82) (envelope-from ) id 1a3Wee-0003PL-GH; Mon, 30 Nov 2015 14:10:40 -0800 From: Kamal Mostafa To: Sifan Naeem Subject: [3.19.y-ckt stable] Patch "i2c: img-scb: Clear line and interrupt status before starting a transfer" has been added to staging queue Date: Mon, 30 Nov 2015 14:10:39 -0800 Message-Id: <1448921439-13069-1-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.9.1 X-Extended-Stable: 3.19 Cc: kernel-team@lists.ubuntu.com, Kamal Mostafa , James Hogan , James Hartley , Wolfram Sang X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com This is a note to let you know that I have just added a patch titled i2c: img-scb: Clear line and interrupt status before starting a transfer to the linux-3.19.y-queue branch of the 3.19.y-ckt extended stable tree which can be found at: http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.19.y-queue This patch is scheduled to be released in version 3.19.8-ckt11. If you, or anyone else, feels it should not be added to this tree, please reply to this email. For more information about the 3.19.y-ckt tree, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable Thanks. -Kamal ------ From 570ad7d747813164d3e6c3b7a4f759fa5b796ccf Mon Sep 17 00:00:00 2001 From: Sifan Naeem Date: Thu, 10 Sep 2015 15:50:06 +0100 Subject: i2c: img-scb: Clear line and interrupt status before starting a transfer commit 1ed6faedfc9741cca2d97b25ab73902ba7177093 upstream. Clear line status and all generated interrupts from the interrupt status register before starting a transfer, as we may have unserviced interrupts from previous transfers that might be handled in the context of the new transfer. Fixes: commit 27bce457d588 ("i2c: img-scb: Add Imagination Technologies I2C SCB driver") Signed-off-by: Sifan Naeem Acked-by: James Hogan Reviewed-by: James Hartley Signed-off-by: Wolfram Sang Signed-off-by: Kamal Mostafa --- drivers/i2c/busses/i2c-img-scb.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 1.9.1 diff --git a/drivers/i2c/busses/i2c-img-scb.c b/drivers/i2c/busses/i2c-img-scb.c index 515cbb4..90ffb07 100644 --- a/drivers/i2c/busses/i2c-img-scb.c +++ b/drivers/i2c/busses/i2c-img-scb.c @@ -1058,6 +1058,15 @@ static int img_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, i2c->last_msg = (i == num - 1); reinit_completion(&i2c->msg_complete); + /* + * Clear line status and all interrupts before starting a + * transfer, as we may have unserviced interrupts from + * previous transfers that might be handled in the context + * of the new transfer. + */ + img_i2c_writel(i2c, SCB_INT_CLEAR_REG, ~0); + img_i2c_writel(i2c, SCB_CLEAR_REG, ~0); + if (atomic) img_i2c_atomic_start(i2c); else if (msg->flags & I2C_M_RD)