From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx08-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2A1929824B; Fri, 27 Jun 2025 10:18:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.207.212.93 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751019532; cv=none; b=grMMBxQ8pKjvXsWhMvzc2uFCAavGtxrXN5qCN5L/d8t0GjArYAlaLSd3ZAGQd7UQYkbt9mJ5HY78MkGdZDQoPbpjUOZcT6ovfmy1Qj8E+lPTramTorr8YalQHnArxdkgnDajxtIuBBbSzwl4adWTYEaJsbI19XghkB5Z3v17PAs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751019532; c=relaxed/simple; bh=kM3TXzNybCjTjgZN0qMiw5dJGyngY0bp3+js19Cq5Hw=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=SYpv18r6IGRHWAHJvdH64zQXFCFcHsCnbaR/S8XsNjgD96zI+dEfgPxpmmeTB7JjLSNv7L6ggx08G7C93MLR8cwMF8w/9Eq8tUQAg76/UwilxUfEvFe/x1JxR6xiJQ69AnEaPLq7JR9cYy2b68BrLe9S7Apo6WrPHKfYKqybE9Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com; spf=pass smtp.mailfrom=foss.st.com; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b=jSnTASSp; arc=none smtp.client-ip=91.207.212.93 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foss.st.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b="jSnTASSp" Received: from pps.filterd (m0369457.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55R9hWB5006538; Fri, 27 Jun 2025 12:18:32 +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= JT/oZIZ3g44uQwFbSBm3mpKN5NBsBXZqXoDPZXCZ6qI=; b=jSnTASSp2oBQkLw2 Qztvz8e1Qcq6x2XtbPu46cXqFGcZVewFDLTPfYdWrK+EmKBpLAXq5vHLcY0shDlV 06M7TVBh5kBSOU1ffW6b54hqFfLjxiiUDfGAk7n5PBP2OQnu3+p0Krlqq27dYfJ2 ufGczDWmxh3DaJ7oV7la4zPl6Z6OE9x3mRghUpzj9hXlJazoIYx4BZa/15hapccW 37D2a84ioyvi3WwzycdcbG59eONlrCH9c6A1r1VLgD3UucFgNZXUn/q/E5eCaZ4G BRk1Z/dmdw8HTvOuDXkSdKvq6xckNLe7l0Wl9/BiTJZFMEHwUkxVyffuO1im/veP nW8oGw== 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 47e7ppr59e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Jun 2025 12:18:32 +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 1D30A4005B; Fri, 27 Jun 2025 12:17:09 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id AC6FABE10A9; Fri, 27 Jun 2025 12:16:13 +0200 (CEST) Received: from [10.48.86.185] (10.48.86.185) 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; Fri, 27 Jun 2025 12:16:12 +0200 Message-ID: <813dda8d-7871-46ca-bf22-4e231be4cbf1@foss.st.com> Date: Fri, 27 Jun 2025 12:16:12 +0200 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] i2c: stm32f7: unmap DMA mapped buffer To: Alain Volmat CC: Pierre-Yves MORDRET , Andi Shyti , Maxime Coquelin , Alexandre Torgue , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , M'boumba Cedric Madianga , Wolfram Sang , "Pierre-Yves MORDRET" , , , , , , , References: <20250616-i2c-upstream-v1-0-42d3d5374e65@foss.st.com> <20250616-i2c-upstream-v1-2-42d3d5374e65@foss.st.com> <20250626090301.GC348766@gnbcxd0016.gnb.st.com> Content-Language: en-US From: Clement LE GOFFIC In-Reply-To: <20250626090301.GC348766@gnbcxd0016.gnb.st.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) 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.1.7,FMLib:17.12.80.40 definitions=2025-06-27_03,2025-06-26_05,2025-03-28_01 On 6/26/25 11:03, Alain Volmat wrote: > Hi Clément, > > thanks for the patch. > > On Mon, Jun 16, 2025 at 10:53:55AM +0200, Clément Le Goffic wrote: >> 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; >> } >> } >> > > Sounds good to me, however there might be an additional place to fix > within the function stm32f7_i2c_handle_isr_errs: > Could you also take care of the unmap in the error ITs handling ? Ack > > Regards, > Alain > >> -- >> 2.43.0 >>