From nobody Thu Mar 19 03:48:26 2026 Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90B8429E0F6 for ; Mon, 16 Feb 2026 12:38:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771245522; cv=none; b=U5Dm2QcWAUnGMjyXyYGfLO4yetlhbwD8wMJWBPbkQU3Rs0V6CJ++SRU9Om9gBRk8wd0UKj5hnNR214n+q9x8C4I/MMlmWUn4+VtOp4FSWBPV4yQxs+aWmhXd3+/OgV5efADY+WXMnkUiy15nMwkQxUFss3Z+E8WSGvUCR5p+584= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771245522; c=relaxed/simple; bh=srHk2JrYne2Lr9S+OWYkWWOBdPBDjyWH8AYFfVb4WM4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tXdiUuDbonI+wVZlFYq48ZaMsDsFqRxe3nYh5lC3zU6u2dDWwiApLG4fHl6syTgQ4Yzs+WkpJ0UTP/VQZdcyyKFyikrdraTwjZHwkXSLc5ToKkulfxziiNg0FusyEX0PTbNJv3XgpZv9eYx5jGuFJ5/OBXNuPExsBvPOSLmPHRM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YwrLouyb; arc=none smtp.client-ip=209.85.208.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YwrLouyb" Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-385e7cafef9so26268521fa.0 for ; Mon, 16 Feb 2026 04:38:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771245519; x=1771850319; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=yxYzimuJUPEidRiJMQ+HmOdyz4ofi/9h4aHUin0J/KI=; b=YwrLouybHT4dfq/CeGyOwir3iuaA47SjjoUOxsLplbqujF2WzIRCKgNQdVzIsqpPXa jQpjb59lhaVFvHj4KYCDwnpzKZzYYW8YLVtxpn29yR8qFJ8fsG0S3sfzeG/xe5OiEXq9 BZoc2UoGjbGDcYPtA9Zp5h5zV+WoDWYwXMxH8A9JBSDOihLmC6EXAPgR6X7lf15gVXKH hmwiwkKvDpWzlJdGZRXKOxMo90OL9TX28Bx7jGpSPw+NpnlZrXjYr+iPV6G9m12v4F8x 6ZLuzL7ur9oFdox+pd9zUJXAe/5WlZ3fx9DBipHZHtW6H+Fzc5jWdYBMvRHt1zmfkNUX YGlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771245519; x=1771850319; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=yxYzimuJUPEidRiJMQ+HmOdyz4ofi/9h4aHUin0J/KI=; b=td+8w9X5r8/mzgCYwPwBaqhNFMy/RkA/5qAK9PPT4iT2LkPovwL/vsS1zIRytpBuQr T/K/bdpH3nF4aniFXz2h08yJ6I8sy9C+i8hdc4LdCd6LtUL27wXvvlUSk9QO7Zhqifg1 MkyNAJU7lDtXlL5g1TJRPeHkQwfd3Z/PgopTPbBv8EoNuNP0TyBoWzGRAMEeLiukQdym tIWUQkbK68N12CdNkRz9yUlwETAcd03UA2ifp/M7t9nZmristNPg01BA2G4wYajvT8C7 ONDhj9f5v5XVZhgcBeoi4KpdrU1X2orB+LZUQrIjTIMRWfO14Umxd7FxyK7tFDEytUk3 se3Q== X-Forwarded-Encrypted: i=1; AJvYcCWuNMBCbx116PSPGt25kdT/CWxbrbm0KkCH2DELIVMlWH1qF/tlKEvxJ+OpTBgZipbn/yFpKajekI24GBU=@vger.kernel.org X-Gm-Message-State: AOJu0Yy9NPiYsY0Mj5mOlT9YiGnHVFwGD81q94H9111OtEn9A2hQUshK ur5VytNrimcaZTaNGZlljgP/8JFP6n8/xsyfu3if0V+ku0a1JH2Klz2v X-Gm-Gg: AZuq6aI9pm+W7l7He9zOcP8vy7SixTv8gk1yMrWOvqfExOhppmgC3yRKEfubGW5KJxh uEGqigIAtFbxRHIQ1EqZE/ISwQKjJAsD14643rUbo9qfeTDDzfMpR97JkoRGyHyxn0+LoBpJhZ1 Q+SkGD+0iMVGBf+B32aVZoz7IgagyJmYWaERHMnprQ5fKBia0UknGtfkiic/I6jBagJ6Xnuf6XD sBMGpBBoGBGhX1UtcrK0CTJC/RcgIm3LY1dasjQzVRPa4bo1WlKezka8oe57S868DhfN7ZJICe6 /SzfhOmGdu/OXo1/0azWSRq4wWKpVCcbii4EEZ40ca1Q04fh5VR/RjwxeEI8JhvYZPoF5XRi0yq JubIcVp4GI2DOfrHVj3vZOJyXoQdC4dp11CGxQFXT+W3IcqQTsGtSER4ANslEi9E3Af1tpOWqi2 sIsdVU3mBqwbsACcxxUibGO/FADmpH7ezyKkOXPbVotP6Ec76nDUZpAeoZgPx036nHECxb X-Received: by 2002:a05:6512:3349:b0:59e:1663:941 with SMTP id 2adb3069b0e04-59ef97e8962mr4718009e87.3.1771245518393; Mon, 16 Feb 2026 04:38:38 -0800 (PST) Received: from [192.168.1.135] (83-233-6-197.cust.bredband2.com. [83.233.6.197]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-59e5f5b0577sm3175920e87.71.2026.02.16.04.38.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Feb 2026 04:38:37 -0800 (PST) From: Marcus Folkesson Date: Mon, 16 Feb 2026 13:38:17 +0100 Subject: [PATCH v6 5/5] docs: i2c: i2c-topology: add section about bus speed Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260216-i2c-mux-v6-5-9be28ecfd7e3@gmail.com> References: <20260216-i2c-mux-v6-0-9be28ecfd7e3@gmail.com> In-Reply-To: <20260216-i2c-mux-v6-0-9be28ecfd7e3@gmail.com> To: Wolfram Sang , Peter Rosin , Michael Hennerich , Bartosz Golaszewski , Andi Shyti , Andy Shevchenko , Bartosz Golaszewski Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Marcus Folkesson X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=8169; i=marcus.folkesson@gmail.com; h=from:subject:message-id; bh=srHk2JrYne2Lr9S+OWYkWWOBdPBDjyWH8AYFfVb4WM4=; b=owEBbQKS/ZANAwAKAYiATm9ZXVIyAcsmYgBpkw/XbLu7lth7GLLf8U9ly9/S3XxpZEAm8IvRe sDkymr8Km2JAjMEAAEKAB0WIQQFUaLotmy1TWTBLGWIgE5vWV1SMgUCaZMP1wAKCRCIgE5vWV1S MrCeD/kBIgHp5wo4RriNM3Ho5EKUx0YkZ0shf+c7g0bha3DjkzejasJNnO3nGwrZ7CfwD6Kjvbi pZOyi/Raz5n76EulZwQ2NyFUfqAQn+PqznU+B/ROwqxkQUL1sXVhclqYirKwJxQTxVVFM8Hnslw Cc3nYhr7rmnooDTQAAZ1CrVnGCTjfa26jHTbHAMG/BQx+G3G9MoMxy6ND1HNPX5c9MZVXMzfAD3 G3dBar7nZD7Vh2q6gFWCuE3hUnpAWe/KL5ZjORVz+KLu2d/+2LfB+kQdB834cD4XiuWdI9GM+zn t/wMYtFwG3jbfdSOJB/Sgk4D89v31XylUqYxp0dn5sp41C+xt2wKmMgz0m3h36K4QzfkhnSbjaU UiFcZQi6gqJOR2bybnGP6lTnw6ysjHEm9XXxm7/ZN2vOzVXsNvmiWnOiJadCnOLzl6jCwl4w4Ws GF42Frn34dvlZVc5heSdQt5251OPVQSd1BpRqUz/mtmv1996ZoNq6jWW56KWB2dBf1+vRJzWIMi ym2n7LJcqR1Xt1xSwQRKF1c9zHFIxXM12eP0Xc7TiQhmqJHyBZOkQ8Lu6etwB3u799YsKc0pREh h+CZNcON10BgifHyMU3ZJ7aq+ftlqo2Iaw11Co+TFVrPbt/DrCqJB4L1830BI/xRXBWQtABLNLk w8r8L5jBMH6fE8Q== X-Developer-Key: i=marcus.folkesson@gmail.com; a=openpgp; fpr=AB91D46C7E0F6E6FB2AB640EC0FE25D598F6C127 Describe what needs to be consideraed and taken into account when using different bus speeds for different mux channels. Signed-off-by: Marcus Folkesson --- Documentation/i2c/i2c-topology.rst | 178 +++++++++++++++++++++++++++++++++= ++++ 1 file changed, 178 insertions(+) diff --git a/Documentation/i2c/i2c-topology.rst b/Documentation/i2c/i2c-top= ology.rst index 48fce0f7491b..24df553ca8c7 100644 --- a/Documentation/i2c/i2c-topology.rst +++ b/Documentation/i2c/i2c-topology.rst @@ -367,6 +367,184 @@ When D1 or D2 are accessed, accesses to D3 and D4 are= locked out while accesses to D5 may interleave. When D3 or D4 are accessed, accesses to all other devices are locked out. =20 +Bus Speed and I2C Multiplexers +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D + +I2C bus multiplexers allow multiple downstream channels to be exposed +as separate I2C adapters which also could set their own bus speed. + +The multiplexer itself cannot change the bus speed as it use the upstream +clock and data lines to communicate with the downstream devices. The speed +is therefore changed in the root adapter resulting in that the whole bus is +affected. + +This increases the complexity of the topology and some considerations must +be taken into account. + +Bus speed +---------- + +Downstream channels of an I2C multiplexer can only operate at the same or +lower bus speed as the upstream bus. This is because the upstream bus may +have devices that cannot operate at higher speeds and those will be affect= ed +by the speed change. + +The example below illustrates the problem. +The root adapter is operating at 100kHz. D2 can only operate with 100kHz, +but D1 can operate at 400kHz. When D1 is selected, the bus speed of the +root adapter would have to be set to 400kHz, a speed that D2 may not suppo= rt. + +This topology is therefor not allowed: :: + + .----------. 400kHz .--------. + .--------. 100kHz | mux- |--------| dev D1 | + | root |--+-----| locked | '--------' + '--------' | | mux M1 | + | '----------' + | .--------. + '--| dev D2 | + '--------' + + +This topology is allowed: :: + + .----------. 100kHz .--------. + .--------. 400kHz | mux- |--------| dev D2 | + | root |--+-----| locked | '--------' + '--------' | mux M1 |--. 400kHz .--------. + '----------' '--------| dev D1 | + '--------' + +Preferred topology +------------------- + +The preferred topology when using different bus speeds is to have the mult= iplexer +connected directly to the root adapter without any devices as siblings. +By this arrangement, the bus speed can be changed without affecting any ot= her devices +and many of the caveats are avoided. + +Other multiplexers in parallel is still okay as those are locked out durin= g transfers. + +This is the preferred topology: :: + + .----------. 100kHz .--------. + .--------. 400kHz | mux- |--------| dev D2 | + | root |--+-----| locked | '--------' + '--------' | mux M1 |--. 400kHz .--------. + '----------' '--------| dev D1 | + '--------' + +Locking +-------- + +If the multiplexer is mux-locked, transfers to D3 may interleave between t= he +select-transfer-deselect to D1 or D2. +This results in a situation where the bus speed to D3 may be lower than it +is supposed to be. This is usually not a problem. + +This topology is allowed but some transfers to D3 may be at 100kHz: :: + + .----------. 100kHz .--------. + .--------. 400kHz | mux- |--------| dev D1 | + | root |--+-----| locked | '--------' + '--------' | | mux M1 |--. 400kHz .--------. + | '----------' '--------| dev D2 | + | .--------. '--------' + '--| dev D3 | + '--------' + +Multiple muxes in series +-------------------------- + +When multiple muxes are used in series the same rules applies. + +Transfers to D3 may interleave between select-transfer-deselect to D1, whi= ch +results that the bus speed to D2 or D3 will be at 100KHz. + +Transfers to D2 may interleave between select-transfer-deselect to D1, whi= ch +results in that the bus speed to D1 may be at 400kHz as the transfer to D2 +will set the bus speed to before the transfer to D1 starts. + +This is probably a bad topology :: + + .----------. 400kHz .----------. 100kHz .--------. + .--------.400kHz | mux- |--------| mux- |--------| dev D1 | + | root |--+----| locked | 400kHz | locked | '--------' + '--------' | | mux M1 |--. | mux M2 | + | '----------' | '----------' + | .--------. | .--------. + '--| dev D3 | '--| dev D2 | + '--------' '--------' + +Multiple muxes in parallel +---------------------------- + +When multiple muxes are used in parallel all access to other muxes are loc= ked out +so this is not a problem. + +If the muxes are mux-locked, access to D3 may still interleave though. + +In the example below, D3 may not interleave between select-transfer-desele= ct for D1 +or D2 as both muxes are parent-locked: :: + + + .----------. 100kHz .--------. + | parent- |----------| dev D1 | + .--| locked | '--------' + | | mux M1 | + | '----------' + | .----------. 400KHz .--------. + .--------. 400kHz | parent- |---------| dev D2 | + | root |--+------| locked | '--------' + '--------' | | mux M2 | + | '----------' + | .--------. + '--| dev D3 | + '--------' + +Idle state +----------- + +Muxes have an idle state, which is the state the channels are put into whe= n no channel +is active. The state is typically one of the following: + +- All channels are disconnected +- The last selected channel is left as-is +- A predefined channel is selected + +Muxes that support an idle state where all channels are disconnected are p= referred when using +different bus speeds. Otherwise high bus speeds may "leak" through to devi= ces that +may not support that higher speed. + +Consider the following example: :: + + .----------. 100kHz .--------. + .--------. 400kHz | mux- |--------| dev D1 | + | root |--+-----| locked | '--------' + '--------' | | mux M1 |--. 400kHz .--------. + | '----------' '--------| dev D2 | + | .--------. '--------' + '--| dev D3 | + '--------' + +If the idle state of M1 is: + +- All channels disconnected: No problem, D1 and D2 are not affected by com= munication + to D3. +- Last selected channel: Problem if D1 was the last selected channel. High= speed + communication to D3 will be "leaked" to D1. +- Predefined channel: Problem if the predefined channel D1. Set predefined= channel + to D2 as D2 may handle 400kHz. + +Supported controllers +----------------------- + +Not all I2C controllers support setting the bus speed dynamically. +At the time of writing, the following controllers have support: + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +i2c-davinci Supports dynamic bus speed +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 Mux type of existing device drivers =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 2.52.0