From patchwork Sat Feb 3 07:58:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Abhishek Sahu X-Patchwork-Id: 868857 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=codeaurora.org header.i=@codeaurora.org header.b="fA9X2/4F"; dkim=pass (1024-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="dTV4tAwx"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zYR837159z9t5s for ; Sat, 3 Feb 2018 18:59:15 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751869AbeBCH6o (ORCPT ); Sat, 3 Feb 2018 02:58:44 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:35270 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751546AbeBCH6e (ORCPT ); Sat, 3 Feb 2018 02:58:34 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 47626609EF; Sat, 3 Feb 2018 07:58:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1517644714; bh=TNxchBdNZaAiZ7QocHsrx+asXnEaIlyDE4lTYZYCoGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fA9X2/4FUQ1WclyiT7rpdJYUgALtzYVdEdRFkKNW89wbxLk5ZkfB9KjQUIh3d7iU8 C8Gw8O3l+/U8b5Xa86Kom4RKrGe8iHFIPLcH8vOM+xWmgg54T80dv6iODLVk1+HY+j SLEnW1MoGYoVI0IU6yl9mHHXX1YkeeF/FUnsI4Ig= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from absahu-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: absahu@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 647C96050D; Sat, 3 Feb 2018 07:58:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1517644712; bh=TNxchBdNZaAiZ7QocHsrx+asXnEaIlyDE4lTYZYCoGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dTV4tAwx40IWVe9+EgfKq+Cxwgt+WfsTE6XEVEIE5W7jmY8UyYFOvoTtUDwYu3fIK fziFGu3x2zVDWP0VaOrQVJGEcerBWU5USoAVgFPcNqIqB0lVGZoRXhUoItNgeGzNBf lAUxjir0rMl/bxqHorPlSFqneHjiuWZ9F73y+uA4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 647C96050D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=absahu@codeaurora.org From: Abhishek Sahu To: Andy Gross , Wolfram Sang Cc: David Brown , Sricharan R , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Abhishek Sahu Subject: [PATCH 01/12] i2c: qup: fixed releasing dma without flush operation completion Date: Sat, 3 Feb 2018 13:28:06 +0530 Message-Id: <1517644697-30806-2-git-send-email-absahu@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1517644697-30806-1-git-send-email-absahu@codeaurora.org> References: <1517644697-30806-1-git-send-email-absahu@codeaurora.org> MIME-Version: 1.0 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org The QUP BSLP BAM generates the following error sometimes if the current I2C DMA transfer fails and the flush operation has been scheduled “bam-dma-engine 7884000.dma: Cannot free busy channel” If any I2C error comes during BAM DMA transfer, then the QUP I2C interrupt will be generated and the flush operation will be carried out to make i2c consume all scheduled DMA transfer. Currently, the same completion structure is being used for BAM transfer which has already completed without reinit. It will make flush operation wait_for_completion_timeout completed immediately and will proceed for freeing the DMA resources where the descriptors are still in process. Signed-off-by: Abhishek Sahu Reviewed-by: Austin Christ Reviewed-by: Andy Gross --- drivers/i2c/busses/i2c-qup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c index 08f8e01..9faa26c41a 100644 --- a/drivers/i2c/busses/i2c-qup.c +++ b/drivers/i2c/busses/i2c-qup.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2013, The Linux Foundation. All rights reserved. + * Copyright (c) 2009-2013, 2016-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2014, Sony Mobile Communications AB. * * @@ -844,6 +844,8 @@ static int qup_i2c_bam_do_xfer(struct qup_i2c_dev *qup, struct i2c_msg *msg, } if (ret || qup->bus_err || qup->qup_err) { + reinit_completion(&qup->xfer); + if (qup_i2c_change_state(qup, QUP_RUN_STATE)) { dev_err(qup->dev, "change to run state timed out"); goto desc_err;