Received: by 10.223.176.5 with SMTP id f5csp337693wra; Sat, 3 Feb 2018 00:20:26 -0800 (PST) X-Google-Smtp-Source: AH8x2267rLY4quhkl3SxGqvhQZH0yFP16MvxPfSKjq36IcBGlhoxcqWIjB2JDcK3V+cZC+Gv6UQ+ X-Received: by 10.98.5.129 with SMTP id 123mr42941183pff.75.1517646026446; Sat, 03 Feb 2018 00:20:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517646026; cv=none; d=google.com; s=arc-20160816; b=aUhfOuEuL/QZ0xhwboFL9BMYfBHCzGm47BB633sWroNcmbGSLTtHdI+N1xI91YFgaJ 9K1N/uq5tHvoaoiQMAAj2H/hk5e9jKgZSjGOXqQ9ExJRzMkswMDYsG2D+pq9LXWVMrXs RT6RRvhRH6Bm/rdUIWI6wpaFX+sgtdWg3iUrTgSay90ZpA+dy+XGJvh2gNAAd2zo0uw/ 5f4feg3YrsQL3//4fdSmbXKsK9NxJzac5+fDc89Y9Zk8aJ+SjGmH/Ms/U2sdJU+ozUAA 4Avczki+pHvjmb+0m8OuI5ILGHm6ynHguMMuIMMPyn0+66ZaAg/cYyai+o3/D4261+gs L/pg== 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=5lbG5iIKX3mnde6/CEuK5us1Zsj9/Nb2sAS86DKAggw=; b=mo340inBhgP3GjfCg4Of1WhJMLTtB/xXlqIn/HZoIY3TykzYu0DDQlPLQEarq0T6h4 6ipVro/vABrD7ApmsSC63eJs1ASKLlyvfdzdppMNYXxYbwmnd6qG9z8tLsxPEgLlq5l6 jOWO1YJy5zWV7V/8UGvjXTSuUaunaNngOEvWouQNVAbwq0lO0tqm9CSusW8MigZtwXNb bT3R0wG1Kr8Q1h5xDA6sMNnkfaH1c2RLBIIQPtIMZM2/fuZqoIKQmO9k+kXA1QNDAKTA 6nEeSL1VFFbEjbIgQKrxHkhmBOchkUgLVLKBxq5nC2/jXo+DEzRXG1GSJsXBQ4GHka3N 5pEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=fA9X2/4F; dkim=pass header.i=@codeaurora.org header.s=default header.b=dTV4tAwx; 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 s72si1228936pgc.632.2018.02.03.00.20.11; Sat, 03 Feb 2018 00:20:26 -0800 (PST) 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=fA9X2/4F; dkim=pass header.i=@codeaurora.org header.s=default header.b=dTV4tAwx; 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 S1751958AbeBCH6t (ORCPT + 99 others); Sat, 3 Feb 2018 02:58:49 -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 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 --- 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; -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation