From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 175F4C433FF for ; Fri, 2 Aug 2019 09:59:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB5F12067D for ; Fri, 2 Aug 2019 09:59:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564739996; bh=ctxtzsTqbKx85BXupl4d4d0HHrp90z4CQv0kcxHld48=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=MvHyZogOUjiV3T235xjuSC/WY58PnIneEU4Sb80jIVgMPaprWSGPHHHVhJfvdDx/C lUbVFRqxQSWGLMYjngpn/qhXVN30SsJyklCmVqRNYw7ZLu3jbCv7Gu5bDo8bgxdXyw QhCu+2PHeR4B5uOxrjt3p0MvM4Tdzl/tYyD/Gp98= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406135AbfHBJzO (ORCPT ); Fri, 2 Aug 2019 05:55:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:33588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406485AbfHBJzK (ORCPT ); Fri, 2 Aug 2019 05:55:10 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AE2CC206A2; Fri, 2 Aug 2019 09:55:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564739710; bh=ctxtzsTqbKx85BXupl4d4d0HHrp90z4CQv0kcxHld48=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GRrKBZEN74bgKZgc5TD+f4sVQ3ifQCDHiX7Gp/+wInEkoMfPX6YAHuh7MDaweS8+Y uK+xZRESbAnt01aefCQsqECR8mC4yW6VIC+TACWMZpirIzRHgwS6yS/ltg1YT/Vzc7 /Gz2ZhgtlRRjAmj7xq0MIhxR31nsjduNRSVO2TAs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Abhishek Sahu , Sricharan R , Austin Christ , Andy Gross , Wolfram Sang , Amit Pundir Subject: [PATCH 4.14 07/25] i2c: qup: fixed releasing dma without flush operation completion Date: Fri, 2 Aug 2019 11:39:39 +0200 Message-Id: <20190802092100.708534648@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092058.428079740@linuxfoundation.org> References: <20190802092058.428079740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Abhishek Sahu commit 7239872fb3400b21a8f5547257f9f86455867bd6 upstream. 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 Signed-off-by: Wolfram Sang Signed-off-by: Amit Pundir 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 @@ -844,6 +844,8 @@ static int qup_i2c_bam_do_xfer(struct qu } 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;