Received: by 10.213.65.68 with SMTP id h4csp47525imn; Mon, 12 Mar 2018 06:19:51 -0700 (PDT) X-Google-Smtp-Source: AG47ELv8JFHYkkgbeAAAbqSS/0HmAAaZmY+F10KlP4oOHP1xjdAfJCTZz/keb3ixcWFtPx1hHAVF X-Received: by 10.98.89.85 with SMTP id n82mr7889374pfb.233.1520860791758; Mon, 12 Mar 2018 06:19:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520860791; cv=none; d=google.com; s=arc-20160816; b=vnIGB7MxVGTZkgQEZmwPbL/AA8vysFQQvd6jPy+E6M9P53qGl+giGSU9bIq5XppJ9q t1yZa8sYNIlvreqjEd6JtPJvmpjnzgPfnFf2sHIXGNXl/8YaXezZ2OOROaPNVVPQToga hJzP6tVOn7PxdulqRK7cdVslgbqpIk/vXCeHTG1zvxRi3lJ/I72mUYiAXpxuctEXL8Dw UFBDgZEf0tiydcLuiKawlGS3XZN3CDWuf228wflXDWveVoBm7tzjwCcxonWNKkkQRzLC 9Ypx12cLBo6Jj8BW6tKTdYpZhTNNSGZ7z48JO9OEehXxgNmETGFoijZrC7X0SguyO7Mq bCuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=gCamhzUeBMqtxP1Fef3bJdklOHV0VjPKDWbaknhDAfs=; b=F0pe3LEL5rups0fyaFQadFHarpVNG1m3oeWmpa3rQDNyevYu8mToiyWvcz9k0JSLin Rc2jnvsETdzkDDu9NVR3tN2/QqVuKX5ePYvOFDe4X5+Qbz23HObRqb7uvXtfi7x7e8HP c9CtFj5QCnpzIjSsj6ccBVz963x3po6Pu0BL7GXWz4hyBHWAcmcHxPe+IP+Ok3gic44r Zx9uCHdQ5oxFfy5Y89S2O/Kk8FcKU9x/SiToQmzCSuQIL8MqVCKqUBVGc29PYMN3O9LN bnrekBCb6vOPj8v44gm9CVAA0uLwBIcYY9MAdRb7K4ozcATB2kJL0uIgMPOyUReiX34j WIpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=dDDjqCw9; dkim=pass header.i=@codeaurora.org header.s=default header.b=dDDjqCw9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o18si5013368pge.300.2018.03.12.06.19.37; Mon, 12 Mar 2018 06:19:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=dDDjqCw9; dkim=pass header.i=@codeaurora.org header.s=default header.b=dDDjqCw9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751473AbeCLNPa (ORCPT + 99 others); Mon, 12 Mar 2018 09:15:30 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:41606 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751345AbeCLNPX (ORCPT ); Mon, 12 Mar 2018 09:15:23 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id DCE5660817; Mon, 12 Mar 2018 13:15:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520860522; bh=aNb4xy5h2Twsh34xlWn18QIO/Ii6GU2FnQ8aBI5yA4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dDDjqCw9Kunlc15G0Lre4MolXvP7/mjtrqFsmkrv4QYl6rvFM6pjbHew9yucO3JxZ dCkSqEbLMUp0tXTMEDN4TKO1oCl82vtaox4q6mpwJ7X3d0tpYt+txwM0USUAtfpIce +rQwmu5c0uW7gBtUZwY0g9yj9VCbwu7kVEImE9gc= 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 5202A605FB; Mon, 12 Mar 2018 13:15:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520860522; bh=aNb4xy5h2Twsh34xlWn18QIO/Ii6GU2FnQ8aBI5yA4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dDDjqCw9Kunlc15G0Lre4MolXvP7/mjtrqFsmkrv4QYl6rvFM6pjbHew9yucO3JxZ dCkSqEbLMUp0tXTMEDN4TKO1oCl82vtaox4q6mpwJ7X3d0tpYt+txwM0USUAtfpIce +rQwmu5c0uW7gBtUZwY0g9yj9VCbwu7kVEImE9gc= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5202A605FB 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 , Austin Christ , 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 v2 02/13] i2c: qup: fixed releasing dma without flush operation completion Date: Mon, 12 Mar 2018 18:44:51 +0530 Message-Id: <1520860502-14886-3-git-send-email-absahu@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1520860502-14886-1-git-send-email-absahu@codeaurora.org> References: <1520860502-14886-1-git-send-email-absahu@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 Acked-by: Sricharan R Reviewed-by: Austin Christ Reviewed-by: Andy Gross --- * Changes from v1: 1. Removed copyright and added in separate patch with SPDX license change drivers/i2c/busses/i2c-qup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c index ac5edfa..75e9819 100644 --- a/drivers/i2c/busses/i2c-qup.c +++ b/drivers/i2c/busses/i2c-qup.c @@ -835,6 +835,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; -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation