[{"id":3685578,"web_url":"http://patchwork.ozlabs.org/comment/3685578/","msgid":"<afhX9z20oxSZxM6L@ninjato>","list_archive_url":null,"date":"2026-05-04T08:25:27","subject":"Re: [PATCH] i2c: stm32f7: Move reinit_completion() to\n stm32f7_i2c_xfer_core()","submitter":{"id":69646,"url":"http://patchwork.ozlabs.org/api/people/69646/","name":"Wolfram Sang","email":"wsa+renesas@sang-engineering.com"},"content":"On Sat, May 02, 2026 at 05:31:54PM +0200, Marek Vasut wrote:\n> Currently, the driver may repeatedly call reinit_completion() during\n> transfer which contains multiple messages, while another thread is\n> waiting for the completion.\n> \n> This happens during transfer with more than 1 message, invoked via\n> stm32f7_i2c_xfer_core() -> stm32f7_i2c_xfer_msg(). After invoking the\n> stm32f7_i2c_xfer_msg() to start transfer, stm32f7_i2c_xfer_core()\n> calls wait_for_completion_timeout() to wait for completion of the\n> transfer of all messages. When the first message transfer completes,\n> the hard IRQ handler triggers, and detects transfer completion, which\n> leads to stm32f7_i2c_isr_event_thread() IRQ thread being started. The\n> stm32f7_i2c_isr_event_thread() calls stm32f7_i2c_xfer_msg() in case\n> there are more messages.\n> \n> Without this change, the second and later stm32f7_i2c_xfer_msg() would\n> call reinit_completion() on the completion which is still being waited\n> for in stm32f7_i2c_xfer_core(). Fix this by moving the reinit_completion()\n> into stm32f7_i2c_xfer_core(), together with wait_for_completion_timeout().\n> \n> Since stm32f7_i2c_xfer_core() now waits for completion of the entire\n> transfer, increase the default timeout. This fixes sporadic transfer\n> timeouts on STM32MP25xx during kernel boot.\n> \n> Fixes: aeb068c57214 (\"i2c: i2c-stm32f7: add driver\")\n> Signed-off-by: Marek Vasut <marex@nabladev.com>\n\nReworded $subject a little and applied to for-current, thanks!","headers":{"Return-Path":"\n <linux-i2c+bounces-17212-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-i2c@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=sang-engineering.com header.i=@sang-engineering.com\n header.a=rsa-sha256 header.s=k1 header.b=mD/zbGAP;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-i2c+bounces-17212-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=sang-engineering.com\n header.i=@sang-engineering.com header.b=\"mD/zbGAP\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=194.117.254.33","smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=sang-engineering.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=sang-engineering.com"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g8F9R6FcXz1yJV\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 04 May 2026 18:26:35 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id AE205302000D\n\tfor <incoming@patchwork.ozlabs.org>; Mon,  4 May 2026 08:25:32 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 28D23330675;\n\tMon,  4 May 2026 08:25:32 +0000 (UTC)","from mail.zeus03.de (zeus03.de [194.117.254.33])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C49B2DEA9B\n\tfor <linux-i2c@vger.kernel.org>; Mon,  4 May 2026 08:25:30 +0000 (UTC)","(qmail 2102619 invoked from network); 4 May 2026 10:25:28 +0200","by mail.zeus03.de with UTF8SMTPSA (TLS_AES_256_GCM_SHA384 encrypted,\n authenticated); 4 May 2026 10:25:28 +0200"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777883131; cv=none;\n b=oCB0Z4/O8QF5lHlc8tFSPJFx8Ml8iJWXhJIr8m0MvffnTvyOTw+7enFpVURxpb3pKdNuUVSEeHyt41n9mXA6LteW2ys/LQf5qXBovmkAN28nZsD4Qzv9t2lllYVYWkMTuFiw/nfqan1uA6QNvR1FzkkyjgsCFsXxEXS13ABjG8Y=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777883131; c=relaxed/simple;\n\tbh=fYEreH4tV67pPT5Re5xMRgGqjBmpXFF4UFvyb5OI6Ws=;\n\th=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:\n\t Content-Type:Content-Disposition:In-Reply-To;\n b=JxJnhehl5tSxZYueoC+/q5C/EgsD7x6wauL+FC0Zb/dXzZmnKPUVgCEQhVugoq+ZXx++lK1Gx5H5Mk49Zxet7bIL3GxEiei/DBk95XawPgQWQBeC40DPWYQGiT8rKHko6LJiCfQBJNyZxhZB29BjqSa+1GeViMpzInxbYhnH1gs=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=sang-engineering.com;\n spf=pass smtp.mailfrom=sang-engineering.com;\n dkim=pass (2048-bit key) header.d=sang-engineering.com\n header.i=@sang-engineering.com header.b=mD/zbGAP;\n arc=none smtp.client-ip=194.117.254.33","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n\tsang-engineering.com; h=date:from:to:cc:subject:message-id\n\t:references:mime-version:content-type:in-reply-to; s=k1; bh=69yL\n\thlBI16XoVN9bn+X224Mok/47DWhaQAjx6HzSTTc=; b=mD/zbGAP2702YJM1OPmA\n\tub40M6Ut4DpN0w3RYqDDcsh29QDSXY0wM/vRVTbX0NA54uOKr4Jmry/szvORS14o\n\tFFBX/ozRpyki7PoKTe7eLJcKX76Y558PbSZKvcGRVuugNtLQZSvCz8eK7CkVCFGW\n\t43l8hbVWYFEwby8OeP8ETvg6pWyd/5ij4neBkuEu+YV5ZwfXIAdjQcieN4Cafpfy\n\te2Ue3Ndw2B84JuiaKEGxUkDvY5NHyqaR1t4nt9Zcs9Zhyq/yIXq0SRhOKOQ8Xlv8\n\tEoMHbpxFYI++ZYwWfA7ozfIVSfLir6TYYUA9dfQdwceeuVzEyv8Xmij7TJ58tBF5\n\tnQ==","X-UD-Smtp-Session":"l3s3148p1@hdhNrPlQZrcujnvR","Date":"Mon, 4 May 2026 10:25:27 +0200","From":"Wolfram Sang <wsa+renesas@sang-engineering.com>","To":"Marek Vasut <marex@nabladev.com>","Cc":"linux-i2c@vger.kernel.org, Alain Volmat <alain.volmat@foss.st.com>,\n\tAlexandre Torgue <alexandre.torgue@foss.st.com>,\n\tAndi Shyti <andi.shyti@kernel.org>,\n\tMaxime Coquelin <mcoquelin.stm32@gmail.com>,\n\tPierre-Yves MORDRET <pierre-yves.mordret@foss.st.com>,\n\tlinux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org,\n\tlinux-stm32@st-md-mailman.stormreply.com","Subject":"Re: [PATCH] i2c: stm32f7: Move reinit_completion() to\n stm32f7_i2c_xfer_core()","Message-ID":"<afhX9z20oxSZxM6L@ninjato>","References":"<20260502153218.56142-1-marex@nabladev.com>","Precedence":"bulk","X-Mailing-List":"linux-i2c@vger.kernel.org","List-Id":"<linux-i2c.vger.kernel.org>","List-Subscribe":"<mailto:linux-i2c+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-i2c+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20260502153218.56142-1-marex@nabladev.com>"}}]