From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f182.google.com (mail-dy1-f182.google.com [74.125.82.182]) (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 08918481664 for ; Tue, 12 May 2026 09:34:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778578485; cv=none; b=uH72SG1G4K36YbLS2nJBKiSPRyETIsS47Ik3Q1SvXvozQUYxfFG1h/6NBceg9QC1dUnUNnj12VpvmNS84mT/4/zcTOQxkY0qB5SoyijHdxnj6U5lTi6jj3Rz/kL49bp9QAc2z3b2ot65LeiNPIeKZhjTCv5GrOM9B95Cc4WbFjk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778578485; c=relaxed/simple; bh=RLXaDuMnAOgj7DffKute+j5a4bUQyT98lWmpj5fWoLA=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:From:To:Cc: References:In-Reply-To; b=G+5g3uNJb+XAFOg6nin6897sGjVs7oYgVeFmMzBzzv0jnoOMBN6um8njkxE0+WGyXzz4ug8zT2MJuCQaeng1lvHo9uK8XQI1Aq5RUnPUkI/TjDdruG02fCV3OYL5Fp/CxSkSz3ksjTsjiuFrvXDXqtHxnGccvfVWH8BmiW/KRvc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nexthop.ai; spf=pass smtp.mailfrom=nexthop.ai; dkim=pass (2048-bit key) header.d=nexthop.ai header.i=@nexthop.ai header.b=VlZ406x9; arc=none smtp.client-ip=74.125.82.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nexthop.ai Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nexthop.ai Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nexthop.ai header.i=@nexthop.ai header.b="VlZ406x9" Received: by mail-dy1-f182.google.com with SMTP id 5a478bee46e88-2f03d6cf77bso5881459eec.0 for ; Tue, 12 May 2026 02:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexthop.ai; s=google; t=1778578480; x=1779183280; darn=vger.kernel.org; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=EvccDdzgaBL7gkenW4WwoZl3iLgl46TscHBK94VPRTQ=; b=VlZ406x9kaJDkYjXMXVXtYms7vyxY11GF6Xsm5mU8OhEqZqFlCWKjjQ4KVD1sAp1qN nrwbh2K7woE1c5DL6qGRfpSo3pWo4edp4drYP3Km+bMTEdjIl3yN80Jy72yY0I8UKzZO uQjkUx5b7iSrD5HNeCLSRw5pKGa3GaWUWb6SaRKVnyBunFaoyf3YXhwlARGOzxt9eyDP /lnotFETb3NVfr5zyVtg5Q0URVsSWkvPMEoS4czXtt5FYp9N3F9cfEX2uZEtws3ZyeUp wu39QtuWJnWsVX38G+EM9SLW+JxIH3/aL/qAaAl/PVjBns9Sfgg9v5MXcEQUR87zJikY 5K7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778578480; x=1779183280; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=EvccDdzgaBL7gkenW4WwoZl3iLgl46TscHBK94VPRTQ=; b=W4rLA/QAt2aVaP2GJ4+msql2QD+CMHHpAXj2HTHqEWQl4dYbdxEqi0O2l7otX7kAfB AnLiDWnPQmE1tABx/LaeCll380ryX/gRSi0P0j5X0+sJkL4WgKAkHpgGRtaSaEyCpTps gAQ7m69mpu9EgChwLBP4AbSUSFHm+CbJHIbOvH2m2Stls4b20yvYSHjYahKcOUW/b1ax fc/LztLGQh4lZzOtbbyJ+0wKdkOHo9XOpJTgVRJv9o5Mnuk9g5lr7Tdlq7P8l+ERuIpY 6WqJQ3R/bhdajXUl6na3/xSaT3Dyo9lUKZ3g1rl2Snrl075dwmZC38or98rLszNN+96u nxvA== X-Forwarded-Encrypted: i=1; AFNElJ//yRqxBRIMbYnm477Gcvh45G9xqLn6fDVv7kqtHKwQlNGeA/Cs6LanBzDQEdCqDuv1z5435S/2QMvObhw=@vger.kernel.org X-Gm-Message-State: AOJu0YzGd/UXGo3l44lKdPyfAOERFZOEH8D5nHBwNezWF69I4CkZX093 hOL4pPvZVwogNKKMgVIuQNHaEdv+/lMcF67FcHUxsSXq5sNl9h2RD0qVT+uyDoV76Bc= X-Gm-Gg: Acq92OE6LSAhk9dyE9N+eyxpKB74F88YI3Zngsj+44Olp8xou6HuUUfMIEuL+k5oYIp 1CmxnakRVc2sOVSG8p0OifbIRYom2Nrz3RUZ2OaH3CauXBw23HJOhxqXAaBSW09mDTw5jJW/GdP /leqh6y0ZlR/1hspn+YJBcLU0fGwR0WaJsFymx83TDVHjK7WMas9FYiLu6RiqJSBKzRI3ypbRxT hjZHHqt2rHh6ykkRsztKFo0TZEyL4/olZ280xSu9kALIkNgiCXDHl/0ka2m9LDswjErxHSr5aep Ml2f4c2/FyNtcygl87UQov/9RbKFITmQ7PAOfX7IbKUxLC3zRlDmf8IKgZjT8tm7DjGgndIs2MU /xZnMwsNtv340P3qSW7TCPwOByCGVr47C2abNZoA2Yt9rhIHhy7gm87TPWKEnfxeuwK8pmFBBxx 1J3peeHQa1pqmzar40VbWb0ScAG6GQi+B/Yg== X-Received: by 2002:a05:7301:24a5:b0:2ed:2942:34ab with SMTP id 5a478bee46e88-2ffd57c438dmr1201927eec.3.1778578480090; Tue, 12 May 2026 02:34:40 -0700 (PDT) Received: from localhost ([50.145.100.174]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2f8884752a9sm16860963eec.16.2026.05.12.02.34.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 May 2026 02:34:39 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 12 May 2026 02:34:38 -0700 Message-Id: Subject: Re: [PATCH] i2c: mux: reg: use device property accessors From: "Abdurrahman Hussain" To: "Peter Rosin" , Cc: , , X-Mailer: aerc 0.21.0 References: <20260512075059.258309-1-peda@axentia.se> In-Reply-To: <20260512075059.258309-1-peda@axentia.se> On Tue May 12, 2026 at 12:50 AM PDT, Peter Rosin wrote: > [note change of email adress, I'm now using peda@lysator.liu.se] > > On Thu Feb 26, 2026 at 10:28 PM PST, Abdurrahman Hussain wrote: >> Hi Andy, Peter, >>=20 >> It looks like the patch is marked as "Changes Requested". I haven't >> heard any feedback lately. Did I miss something? > > Hi! > > First of all, as usual I'm sorry for being slow to respond. Hi Peter! > > One specific thing I noticed with your patch that is a potential > problem is that it replaces the open coded little-ending/big-endian > logic with a call to device_is_big_endian() which is not an exact > replacement. The logic provided by device_is_big_endian() is simply > not equivalent. Further, the new behavior does not match the device > tree bindings. > > At a minimum, you need a matching patch for the binding before doing > something like this. But that would of course only expose the risk > for regressions. > > Since there are apparently few who can test this driver, and even > fewer with endian issues, I'm reluctant to make these changes. I > would prefer to keep the endian logic exactly as it is. > You are right. Reviewing the helper: static inline bool fwnode_device_is_big_endian(const struct fwnode_handle= *fwnode) { if (fwnode_property_present(fwnode, "big-endian")) return true; if (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) && fwnode_property_present(fwnode, "native-endian")) return true; return false; } it does not consult "little-endian" at all, and on a big-endian host with no endian property in DT it returns false (so the patch would flip mux->data.little_endian from false to true, silently). That is a real behavioral change against existing users and not something this patch should be doing. I will keep the original three-way logic in v2 and only switch the accessors: if (device_property_read_bool(dev, "little-endian")) mux->data.little_endian =3D true; else if (device_property_read_bool(dev, "big-endian")) mux->data.little_endian =3D false; else mux->data.little_endian =3D IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN); That preserves the documented binding behaviour byte-for-byte and avoids touching device_is_big_endian(). > I have not looked all that closely, but you also make the call to > devm_platform_get_and_ioremap_resource() unconditional. Why will > that change not cause regressions? > You are right again =E2=80=94 that was an oversight. The original code guarded the platform-resource fallback with if (!mux->data.reg), which preserved the pre-mapped reg that a platdata user may have supplied through struct i2c_mux_reg_platform_data. Dropping that guard would clobber the platdata pointer with whatever platform_get_resource() returns (or fail outright if there is no MEM resource on the platform device). I will restore the guard in v2. > Your commit message is lacking, you make these changes but only > talk about extending support to non-OF platforms as if that is > the only thing that is going on. > Fair point. In v2 the changelog will spell out: - the conversion from of_* to device_property_* / fwnode_* accessors and what each replacement is equivalent to, - the new ACPI child-node handling via acpi_get_local_address(), - that the endian and platform-resource fallback paths are preserved byte-for-byte. > And, the initail problem still stands. I would like to see some > tags that indicate that the driver still works for existing users. > Especially so since there are changes that look problematic. > > Cheers, > Peter Understood. I do not have any of the existing in-tree users of i2c-mux-reg on hand (the DT consumers are on PowerPC and SH boards, none of which I have access to), so I can only test the ACPI/non-OF path I added. I will ask the existing DT board maintainers on Cc for v2 explicitly for Tested-by tags. If that does not produce coverage, I am happy to defer or drop the patch rather than push it through unverified. Thank you for the careful read. Best regards, Abdurrahman