From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 43BF947B429; Tue, 16 Jun 2026 17:43:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781631840; cv=none; b=fQ4e6DW+bz1D7nZL8QYLeJq0wqIGLWoQh11apUK3JJg4b9UJ0zu6Ar4MhmQHQO+kFTTCOQGKz7p+3mdZoli/X4v22jICmXQucPrs0c0dk6ALcp7rvtqs56FkU1K32uMX4oLRzbbs5KSe2T4Ue3z8eWIQcGDUM6jrbN/aBfYCPL8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781631840; c=relaxed/simple; bh=wOeE0D/acMrt5ko9ARABpGHRPx0Se7o/snK0TGBXJqw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ccXSOQYpDuVslAuNpqKZ0uos2IiD20l5W7Uuly7RpiYyZLs/YPtgZ8IvfY1JtsA4N9DH6Nvizb4ekgFAZsD5BuKkUBUW5Jgafm2FnPI4rzjszSSKMEMnaSyEGr1Y4VUisrWUX1n+loZi4T37Twwsl6kWOD6c1BZ1NduGlL9rFLM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Jn6VU8d8; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Jn6VU8d8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D84291F000E9; Tue, 16 Jun 2026 17:43:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781631837; bh=Ck9+W41Y8mwjmdmOmpRSMPfeFmrghcAh4AKxm0jdubo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Jn6VU8d8UTEnRr3N4sIEhCV5gaQhUHEOOQaeun79Se0P/kz+FYlA7y014RW5riwc/ Y4M9oGswvNGPVQfGS/SsLcnNWWg0up1U8o0T0yunjGHeJl2B2u3A7mSTLy6iYdnS7u 6nQrHlRdQWgYIV2/3cir59JgXUT8Z4e+++JDR/M0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Guillermo=20Rodr=C3=ADguez?= , Alain Volmat , Andi Shyti Subject: [PATCH 6.1 296/522] i2c: stm32f7: fix timing computation ignoring i2c-analog-filter Date: Tue, 16 Jun 2026 20:27:23 +0530 Message-ID: <20260616145139.763741115@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145125.307082728@linuxfoundation.org> References: <20260616145125.307082728@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guillermo Rodríguez commit a124579c0763da7bc408f4cd7e8f606cadc94855 upstream. stm32f7_i2c_compute_timing() uses i2c_dev->analog_filter to pick the analog filter delay, but i2c_dev->analog_filter is parsed from the "i2c-analog-filter" DT property only after the compute_timing loop in stm32f7_i2c_setup_timing(), so in practice the timing calculations always ignore the analog filter. On an STM32MP1 board with clock-frequency = <400000> and i2c-analog-filter set, measured SCL frequency was ~382 kHz. This also affects (widens) the computed SDADEL range. At high bus clock speeds, this can select an SDADEL value that violates tVD;DAT (data valid time). Fix by parsing "i2c-analog-filter" before the compute_timing loop. Fixes: 83c3408f7b9c ("i2c: stm32f7: support DT binding i2c-analog-filter") Signed-off-by: Guillermo Rodríguez Cc: # v5.13+ Acked-by: Alain Volmat Signed-off-by: Andi Shyti Link: https://lore.kernel.org/r/20260526091210.20383-1-guille.rodriguez@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-stm32f7.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c @@ -679,6 +679,9 @@ static int stm32f7_i2c_setup_timing(stru if (!of_property_read_bool(i2c_dev->dev->of_node, "i2c-digital-filter")) i2c_dev->dnf_dt = STM32F7_I2C_DNF_DEFAULT; + i2c_dev->analog_filter = of_property_read_bool(i2c_dev->dev->of_node, + "i2c-analog-filter"); + do { ret = stm32f7_i2c_compute_timing(i2c_dev, setup, &i2c_dev->timing); @@ -700,9 +703,6 @@ static int stm32f7_i2c_setup_timing(stru return ret; } - i2c_dev->analog_filter = of_property_read_bool(i2c_dev->dev->of_node, - "i2c-analog-filter"); - dev_dbg(i2c_dev->dev, "I2C Speed(%i), Clk Source(%i)\n", setup->speed_freq, setup->clock_src); dev_dbg(i2c_dev->dev, "I2C Rise(%i) and Fall(%i) Time\n",