From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (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 EC4373E276C for ; Fri, 8 May 2026 13:14:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778246077; cv=none; b=mn3Yodv6iAGOnrLPWlBP4sZ8dLOxnYXS5Z1BB7jWCQONwOD9K1kZVkyNux/yXbM8gzGePSeD9a2IiWYr9sP5n0fs0WAjK68W5SftmB3XHdSn/ifihFukOsBmv0hf/qMtKLs5yaD88JeyK6LqMVcNwGK3ftyF0cRROQSnq4FT8uM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778246077; c=relaxed/simple; bh=s9Z0tLT8SzOsO7em8Q3C4bP32B+Hxk35n24bYsnKKDE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JEDz5K29PGKvtnzRCY9UKRSBJ0EaSmufJuIpu4sf/495WHtG6KOUMMQdn89hWpsd8bg/EtubHA5jK8E/LUGJNp8gLJ9EAbZ6CHTYgppORVk/F8Xwaar2FSBzozgqQYqjgkpXB+GCoBfAyGN2jFrMynI9GLN8bFbpZTAkaq/odrU= 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=ChueBdVn; arc=none smtp.client-ip=209.85.167.51 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="ChueBdVn" Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-5a742b8b72eso1940598e87.1 for ; Fri, 08 May 2026 06:14:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778246074; x=1778850874; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=5Jyuo4pdqxp+5k2cLL5SvSNM1ufmKJNN793e/W3zYnw=; b=ChueBdVnZk7zm0eIwf+OzuyZ7CiQ3VRnriDS37L46hYXoXocN3NJwJI4vTv/D3wNL9 Djx5EOvNVRR0NQY43MnqitLuMuziU83QBtAKko8obj/4lmWTlqFOfGQfTPJdwSQisC0N lZIpaCcyfBKZwBiVKgmwENHi6gn+4uIkWfF0wM37JPxVzRCYZtzW1sZjQ/MY9Rm0+qO3 EBNUeYhsKnN6rkIqScxfvpGHQBvEYxfOy3EQQ+JKeQGoM9qVjFO68VaaBaUiuLYBzaIq nqlD7KvX8ogswCdeoPtAP9niIIJMYDjulm5Ib8lM9fohfn3o2CQY/gDjLUO7jj8sToWw dXFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778246074; x=1778850874; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5Jyuo4pdqxp+5k2cLL5SvSNM1ufmKJNN793e/W3zYnw=; b=pwb51ZMp777LG07fHlrcGCrA99RozqxWVByQGpLlVx4vDVZHvPKcneT5VoTfK5cff0 EDSxC6M4MshEvD3td17W4/s1lEGpNsTMgzl+DVQpcrKHg+tr0rG2ShjuKC5+GnTmxgXU BuEerYp6x2AfLWY74cqOlApIq6qUrkuiPYb7rVz/mtyQ5d63tFQpJgZKMiwnDHq49Pjh tdqsiGmyaYHcq27GbVuO6bjsL9zOrjZILBEPhsX+3s7rjylPfEPgEy2sz6ONGbyZs3Fa IMXOkWpFuCTAkiDKfdV88rZqs5OF0eVyMZNTA9E7xnKafcfqbW2dh7KzQg/DcO1vn993 6G3Q== X-Forwarded-Encrypted: i=1; AFNElJ/39lHr8lbA7WT4Jir8alneSugYf16wlDD1xVU2iOrzluu0ut4X8RlndAtCWfJrDC+RtjBJB8WWyl6qgDw=@vger.kernel.org X-Gm-Message-State: AOJu0YxloxhKJxZTcLrt7sBbe2QuhBDKwsN18F2KprOgeTtixVrbCsDp VedcVX7RSc6HGCKEvzh2Vo0poNJW4tMbcaBhr6bcFeqwqTUR1sOg8FGW X-Gm-Gg: Acq92OFufaPsub5GngTIw6NrSAsPWbIVeZ9r2cpzJGUC+IaGgZD8qk+JyYroTlwL994 jmlQMwexufWded+QG6EkRDVH5Unq0izqYlO4y+Jymn8DPA3fA5nscj8f/JzjRCHIHTPKTBti0KH /BzCJVOG6czfqW1t5BBZOdpsz5F0cVgT/gApUT8OG+IpObhR8P6WC+tCIL0fUMw41HQvw2x+p8H afYP4JyzNzWTo7l7fWgBUDWOJjkHfnpogr5qNfJFTW+wibFgc2zOrkwWB84ExWzMsfDA8kyKs3l IzI5O4cXu67vQS8Ao4fGuRoFcT4Uf/ev6GhuX0Gqld49RZP+tQtS17eUeW+6V/uzhDmQ+Gu9S/J yKygcAdiady8777tofJeHvva1eeoFIAZiTqsQMNpFfw7jWI55mPTZCc+IVDUtQw8MmlrX1AO2Lh wddT+z24lFk0H7QeC1p66VyL/Fht3vIC5ywQFFcxVKCsLnYr8TOSGHqEoLg3nj X-Received: by 2002:a05:6512:2345:b0:5a8:891f:388 with SMTP id 2adb3069b0e04-5a8891f03dfmr4959267e87.29.1778246073843; Fri, 08 May 2026 06:14:33 -0700 (PDT) Received: from gmail.com (83-233-6-197.cust.bredband2.com. [83.233.6.197]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a8a951cfb4sm502098e87.20.2026.05.08.06.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2026 06:14:33 -0700 (PDT) Date: Fri, 8 May 2026 15:14:31 +0200 From: Marcus Folkesson 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 Subject: Re: [PATCH v9 0/5] I2C Mux per channel bus speed Message-ID: References: <20260324-i2c-mux-v9-0-5292b0608243@gmail.com> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20260324-i2c-mux-v9-0-5292b0608243@gmail.com> On Tue, Mar 24, 2026 at 02:54:14PM +0100, Marcus Folkesson wrote: > This was a RFC on how to implement a feature to have different bus > speeds on different channels with an I2C multiplexer/switch. > As no major complaints on the design came up during the review, I > decided to submit the series without the RFC tag. >=20 > The benefit with this feature is that you may group devices after > the fastest bus speed they can handle. > A real-world example is that you could have e.g. a display running @400kHz > and a smart battery running @100kHz using the same I2C controller. >=20 > There are many corner cases where this may cause a problem for some > hardware topologies. I've tried to describe those I could think of > in the documentation, see Patch #5. >=20 > E.g. one risk is that if the mux driver does not disconnect channels > when Idle, this may cause a higher frequency to "leak" through to > devices that are supposed to run at lower bus speed. > This is not only a "problem" for changing bus speed but could also be > an issue for potential address conflicts. >=20 > This patchset has been used and tested heavily the last months > on a custom board based on a da850 (DaVinci) platform. >=20 > The implementation is split up into several patches: >=20 > Patch #1 Introduce a callback for the i2c controller to set bus speed > Patch #2 Introduce functionality to adjust bus speed depending on mux > channel. > Patch #3 Cleanup i2c-davinci driver a bit to prepare it for set_clk_freq > Parch #4 Implement set_clk_freq for the i2c-davinci driver > Parch #5 Update documentation with this feature >=20 > Signed-off-by: Marcus Folkesson > --- > Changes in v9: > - Fix stray blank line > - Link to v8: https://lore.kernel.org/r/20260314-i2c-mux-v8-0-fb1738a4df0= a@gmail.com >=20 > Changes in v8: > - Fix gramatics and change %d to %u were appropriate > - Link to v7: https://lore.kernel.org/r/20260223-i2c-mux-v7-0-ec75b214718= a@gmail.com >=20 > Changes in v7: > - Remove code for finding first mux-locked ancestor > - Introduce a unlocked (i2c_adapter_set_clk_freq) and unlocked > (__i2c_adapter_set_clk_freq) variant > - Let the locking be handled in __i2c_adapter_set_clk_freq > - Use I2C_MAX_STANDARD_MODE_FREQ instead of magic numbers where > appropriate=20 > - Link to v6: https://lore.kernel.org/r/20260216-i2c-mux-v6-0-9be28ecfd7e= 3@gmail.com >=20 > Changes in v6: > - Change logic to find which ancestor to lock with I2C_LOCK_ROOT_ADAPTER > It now find the first mux-locked ancestor and then lock its parent. >=20 > - Remove bus_freq_hz in i2c-davinci and only use clock_hz instead > - Mention in commit message that clock_hz can be used to store frequency = in an uniform way >=20 > - Swap order for change freq/deselect to keep symmetry > - Only allow bus frequency to be lowered in select() > This to not allow an intermediate frequency to be set when it is not > supposed to >=20 > - check if(ret) instead of ret(<0) where appropriate > - Fix typos in documentation > - Change i2c_adapter.clock_hz from int to u32 > - Simplify i2c_adapter_set_clk_freq() by removing 'ret' > - Link to v5: https://lore.kernel.org/r/20260213-i2c-mux-v5-0-fb2cbf9979b= 3@gmail.com >=20 > Changes in v5: > - Take the lock of the top-most mutex locked mux to make sure that the > root is locked > - Link to v4: https://lore.kernel.org/r/20260128-i2c-mux-v4-0-dee49ce276c= 0@gmail.com >=20 > Changes in v4: > - Rebase on master > - Swap order for printing warning about "channel %u is slower than > parent on a non parent-locked mux\n" > - Fix typo in comment, adaper->adapter > - Link to v3: https://lore.kernel.org/r/20251020-i2c-mux-v3-0-908ac5cf922= 3@gmail.com >=20 > Changes in v3: > - Return -EINVAL if channel is faster than parent (kernel test robot) > - Link to v2: https://lore.kernel.org/r/20251002-i2c-mux-v2-0-b698564cd95= 6@gmail.com >=20 > Changes in v2: > - Changed bus_freq field to bus_freq_hz in davinci_i2c_dev (Bartosz Golas= zewski) > - Removed idle_state from mux core (Peter Rosin) > - Link to v1: https://lore.kernel.org/r/20250922-i2c-mux-v1-0-28c94a61093= 0@gmail.com >=20 > --- Friendly ping on this series. Thanks, Med v=E4nliga h=E4lsningar / Best regards Marcus Folkesson