From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 1787E329370 for ; Fri, 9 Jan 2026 16:48:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767977311; cv=none; b=QucKVzMZ68wCJv9lxyOV0BJ3vPPS9wFQHgCOoHjW7/4c9P5Fm70JAQc4eZt7ZpywU2zFgovmFrdluWkeBJWji+gHy4r2xzOAC/agTjHyEsB3N5XHCmjcTTWt0kJuL4rIu6ShVMzW8GrDtbJnohP2Gw7d3iQmhRwEYo5/duWw6M0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767977311; c=relaxed/simple; bh=pEw9/Gq13SmQvUNgKh7svxPebv6jRefx4XLFdD5yY+8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Y6ZCiNpDFwtrbiHoEBdjsOU2rlqygjm9eiUk3pcA6oQ8Mfgcd42eQ4rpFQikQ6LDIwRadYm5xzHLQ+C//PZTi+EktxL7ZAvUwdnMuN/iBxIkHYvINdti/btNQr9ihtywiO1neXmgMPgNOQMvUnlrCjyqgo/HnF5NXVNdCas6qC4= 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=kLFIN7Q1; arc=none smtp.client-ip=209.85.221.52 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="kLFIN7Q1" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-430f2ee2f00so2514072f8f.3 for ; Fri, 09 Jan 2026 08:48:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767977308; x=1768582108; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=pEw9/Gq13SmQvUNgKh7svxPebv6jRefx4XLFdD5yY+8=; b=kLFIN7Q1ZiDoW0/03C3eoYLdPTDcVkj8MMragkw+nYu6G2abZ5qr0bZpyHdPLLxkqk DwehqhzLf8EW3UtS51X1B/dOIF8pSHobgfEbBmpSlSlo314OOUd7MPl/aphw5WhziCk1 LeEL60TT2rfFmGSIsgMXD7t+jvu99YkZw6/feLxdzLnGQNNoLGq0Al7m+YbI4beg0uNh yNRm72ipHXxwZhNldChfK8xGpahTZFTtI+EQuNsfz2rcNPg+/7hGG2lNV+AqPOCZHIb2 FC05Hjft+NZ5yIN3LtCJIwzKw2ni0s+IPSSiEB0zfahnHFGlK7HHM/jkQF/u4WIUDfvK CQ5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767977308; x=1768582108; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pEw9/Gq13SmQvUNgKh7svxPebv6jRefx4XLFdD5yY+8=; b=IJnk3s6szZycXA1CITqPMT1Cpgx7jL4kYQP5u16CgkBnn1SZO4CN1Lr1ViND87qF4V UfAZskY2rBlPGi87Q+bbteS84Ekd+c4HBjsAW4oCp/HvGVsEwQml7blTYljJFToJGSb8 KaYoh/9aaIvojvhSRx7rGQKFBgyLPY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000:40e1:b0:431:16d:63d1 with SMTP id ffacd0b85a97d-432c37a50aemr13343862f8f.44.1767977308388; Fri, 09 Jan 2026 08:48:28 -0800 (PST) Received: from ?IPV6:2001:9e8:f116:2801:5cbd:7d69:3b4c:169? ([2001:9e8:f116:2801:5cbd:7d69:3b4c:169]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-432d286cdecsm9542332f8f.7.2026.01.09.08.48.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Jan 2026 08:48:28 -0800 (PST) Message-ID: <397e0cdd-86de-4978-a068-da8237b6e247@gmail.com> Date: Fri, 9 Jan 2026 17:48:27 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v4] net: sfp: add SMBus I2C block support Content-Language: en-US To: Maxime Chevallier , Russell King , Andrew Lunn , Heiner Kallweit , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?Q?Bj=C3=B8rn_Mork?= References: <20260109101321.2804-1-jelonek.jonas@gmail.com> <466efdd2-ffe2-4d2e-b964-decde3d6369b@bootlin.com> From: Jonas Jelonek In-Reply-To: <466efdd2-ffe2-4d2e-b964-decde3d6369b@bootlin.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi Maxime, On 09.01.26 16:51, Maxime Chevallier wrote: > Hi, > > On 09/01/2026 11:13, Jonas Jelonek wrote: >> Commit 7662abf4db94 ("net: phy: sfp: Add support for SMBus module access") >> added support for SMBus-only controllers for module access. However, >> this is restricted to single-byte accesses and has the implication that >> hwmon is disabled (due to missing atomicity of 16-bit accesses) and >> warnings are printed. >> >> There are probably a lot of SMBus-only I2C controllers out in the wild >> which support block reads. Right now, they don't work with SFP modules. >> This applies - amongst others - to I2C/SMBus-only controllers in Realtek >> longan and mango SoCs. >> >> Downstream in OpenWrt, a patch similar to the abovementioned patch is >> used for current LTS kernel 6.12. However, this uses byte-access for all >> kinds of access and thus disregards the atomicity for wider access. >> >> Introduce read/write SMBus I2C block operations to support SMBus-only >> controllers with appropriate support for block read/write. Those >> operations are used for all accesses if supported, otherwise the >> single-byte operations will be used. With block reads, atomicity for >> 16-bit reads as required by hwmon is preserved and thus, hwmon can be >> used. >> >> The implementation requires the I2C_FUNC_SMBUS_I2C_BLOCK to be >> supported as it relies on reading a pre-defined amount of bytes. >> This isn't intended by the official SMBus Block Read but supported by >> several I2C controllers/drivers. >> >> Support for word access is not implemented due to issues regarding >> endianness. > This patch should probably be accompanied with a similar addition to the > mdio-i2c driver. for now, we only support full-featured I2C adapters, or > single-byte smbus, nothing in-between :( > > Do you have something like this in the pipe ? not that this blocks this > particular patch, however I think that Russell's suggestion of making > this generic is the way to go. I agree to Russell's suggestion and will work on that. Apart from that, I haven't considered a similar change for mdio-i2c yet. No issue to deal with that but  I think I have no way to test this properly. > Maxime Best, Jonas