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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D3A00C71135 for ; Mon, 16 Jun 2025 09:42:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:CC:To:In-Reply-To:References :Message-ID:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=j9gCtZXn8FCUpQCQz+XhhMFUE2JWeUNDp3ENgTfCvvI=; b=2FZLjawHdu6oviCQ2YlG+FOypj H6AQieJQKGpvryfrBwhZOIoIeAmgFyjWp37/iGsnhP6ctszPB138hXptkVjVaY2OVRKiJh2N51fhW p69JOJui4HGQehmIxEpyI8wmYSXi0JRJVNG7pCMCZHgziKMqp6neokG1A1/FNB+cAK4IS6/yUywhx NF37CGRJrWMklyOkNxOLFrLeEGDJ+bawKS7LC0K+Fh9jNgOVf6Z9trbaDoYE+Xdxe/bw2aQs0XScU CvoiTeiByhwAAYiKfISPLfgKOOXLBnZ7U5BaF26YwsyEd0akEN7ZBTgJ+TVzv7Vd+KwUDaCAUCio+ NgjfHxGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uR6MQ-00000003waZ-1M4f; Mon, 16 Jun 2025 09:42:38 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uR5f8-00000003rMy-1nTT for linux-arm-kernel@lists.infradead.org; Mon, 16 Jun 2025 08:57:55 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55G5bVRv010526; Mon, 16 Jun 2025 10:57:25 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=selector1; bh= j9gCtZXn8FCUpQCQz+XhhMFUE2JWeUNDp3ENgTfCvvI=; b=8WpuCS/Cd0CRXgFF tc4Z5nD2wMCzQa1jwQBrt/ngnDr7lQW0hvxGU8lW+x7DOH4oavFMAq2LON8YiBwv kFx1OgFpFf26d4Ujf4Zj6FMfVQXlfOOtGhytaQL08Ius3hs6rhJpi6IPoxgrAFDt UgEHGMQ8EiTDNEMbFL6/Ss/dw7m5HeAcQgtkQkB6QhAVN220aW5m3kEpncplIFzw f7SYPa62woJbfRWC8EKv3pIu7zJb43+x7/UxKQoPQcDuQbjvWuE+39eseIDgpnSo SPsWHHJoFzytm/YxV1iqWKZwirAef2RmDq6Q6ABhzTI49UV9nVyDY2B/yb+p9rRe 1LxQKw== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 478x79qk3b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Jun 2025 10:57:25 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id EA5DE40073; Mon, 16 Jun 2025 10:56:06 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 100F95D5B26; Mon, 16 Jun 2025 10:54:44 +0200 (CEST) Received: from localhost (10.252.14.42) by SHFDAG1NODE2.st.com (10.75.129.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 16 Jun 2025 10:54:43 +0200 From: =?utf-8?q?Cl=C3=A9ment_Le_Goffic?= Date: Mon, 16 Jun 2025 10:53:55 +0200 Subject: [PATCH 2/3] i2c: stm32f7: unmap DMA mapped buffer MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-ID: <20250616-i2c-upstream-v1-2-42d3d5374e65@foss.st.com> References: <20250616-i2c-upstream-v1-0-42d3d5374e65@foss.st.com> In-Reply-To: <20250616-i2c-upstream-v1-0-42d3d5374e65@foss.st.com> To: Pierre-Yves MORDRET , Alain Volmat , Andi Shyti , "Maxime Coquelin" , Alexandre Torgue , Sumit Semwal , =?utf-8?q?Christian_K=C3=B6nig?= , "M'boumba Cedric Madianga" , Wolfram Sang CC: Pierre-Yves MORDRET , , , , , , , , =?utf-8?q?Cl=C3=A9ment_Le_Goffic?= X-Mailer: b4 0.15-dev-c25d1 X-Originating-IP: [10.252.14.42] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE2.st.com (10.75.129.70) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-16_03,2025-06-13_01,2025-03-28_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250616_015754_744349_7CB4523F X-CRM114-Status: UNSURE ( 8.87 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix an issue where the mapped DMA buffer was not unmapped. Fixes: 7ecc8cfde553 ("i2c: i2c-stm32f7: Add DMA support") Signed-off-by: Clément Le Goffic --- drivers/i2c/busses/i2c-stm32f7.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c index 973a3a8c6d4a..a05cac5ee9db 100644 --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c @@ -1622,6 +1622,8 @@ static irqreturn_t stm32f7_i2c_isr_event_thread(int irq, void *data) if (i2c_dev->use_dma) { stm32f7_i2c_disable_dma_req(i2c_dev); dmaengine_terminate_async(dma->chan_using); + dma_unmap_single(i2c_dev->dev, dma->dma_buf, dma->dma_len, + dma->dma_data_dir); } f7_msg->result = -ENXIO; } @@ -1642,6 +1644,8 @@ static irqreturn_t stm32f7_i2c_isr_event_thread(int irq, void *data) dev_dbg(i2c_dev->dev, "<%s>: Timed out\n", __func__); stm32f7_i2c_disable_dma_req(i2c_dev); dmaengine_terminate_async(dma->chan_using); + dma_unmap_single(i2c_dev->dev, dma->dma_buf, dma->dma_len, + dma->dma_data_dir); f7_msg->result = -ETIMEDOUT; } } -- 2.43.0