From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752957AbcHHTPY (ORCPT ); Mon, 8 Aug 2016 15:15:24 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35896 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752444AbcHHTPS (ORCPT ); Mon, 8 Aug 2016 15:15:18 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sricharan R , Wolfram Sang Subject: [PATCH 4.4 61/68] i2c: qup: Fix wrong value of index variable Date: Mon, 8 Aug 2016 21:11:36 +0200 Message-Id: <20160808180212.746201842@linuxfoundation.org> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20160808180209.697765393@linuxfoundation.org> References: <20160808180209.697765393@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sricharan R commit d4f56c7773483b8829e89cfc739b7a5a071f6da0 upstream. index gets incremented during check to determine if the messages can be transferred with dma. But not reset after that, resulting in wrong start value in subsequent loop, causing failure. Fix it. Signed-off-by: Sricharan R Signed-off-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-qup.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/i2c/busses/i2c-qup.c +++ b/drivers/i2c/busses/i2c-qup.c @@ -435,6 +435,8 @@ static int qup_i2c_read_one(struct qup_i if (ret) goto err; + idx = 0; + do { left = wait_for_completion_timeout(&qup->xfer, HZ); if (!left) {