From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6D8A6ECD994 for ; Thu, 5 Feb 2026 18:12:55 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4f6QLY6tVLz2yF1; Fri, 06 Feb 2026 05:12:53 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=pass smtp.remote-ip=136.143.188.112 arc.chain=zohomail.com ARC-Seal: i=2; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1770312561; cv=pass; b=j99oKcnX6P8L5wNwYAlGhZT8naWJMCsPBptY2zWmhFj6u4VbL2iFwCv69ndj2Ve814B/BxCURBz5x+bRAF/9iPAzc/ufuI/I8walUKSRe9ABXJfZyJqaXjAGM/nBkdlk5rqNkIeKMp5LwVtB0c6eTlZreK2NBX0Eq/gkUArdt9AEDh9xAbI85hlS/2soWZoAPptJHBcpnjqJbR14IXExqCjynmpHvxoF//AQgP86cuUujYktxNEqXKtHjnh62KFfmvla8p8k8GlZIegFPkhXCTVNjpPpjPXavQDYN4u15lVPbxFR9B4wRIfD4zCpmQu2HtaTscyRo+BZ/vorLx0XNw== ARC-Message-Signature: i=2; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1770312561; c=relaxed/relaxed; bh=M3obdoKTXeSYmymRy2ZWHekuDCWgCx8je6+4eO2cz9k=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=oLgtTYOiSGFcXVAAZ5wHnr+cl8SbbaKazDNNI8u4OKqh6kcquQ2RHhfYEy1H1T4hN0t6m41CXje6ovgFpNPFGQI8pgwjfHHXgUkTaMYZ5PDxxS69HWHmP5O25nUCYrNmB6ZeTbmoc+d3JW/IsTEg3W1Plvv3wXGeN8xF9aBrB1Qn8JvRGaNBEW7R+Vc8UY9xJh1uZuOXVJtLPwSNJ+9QbW7gOm+CmhBvrQg7Bzi22c7P3gEehm6BMEv/8JFLWGdyqLaiSHtd6+PvvlVQj+rfWIkTltsEewyK9W8REj61yYxn4yU1Ddb/9xpLFaw0Pb/SMR3RLd4erQ7vJXrJ+OPjPw== ARC-Authentication-Results: i=2; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=collabora.com; dkim=pass (1024-bit key; unprotected) header.d=collabora.com header.i=daniel.almeida@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=Yc9/zHHe; dkim-atps=neutral; spf=pass (client-ip=136.143.188.112; helo=sender4-pp-f112.zoho.com; envelope-from=daniel.almeida@collabora.com; receiver=lists.ozlabs.org) smtp.mailfrom=collabora.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=collabora.com header.i=daniel.almeida@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=Yc9/zHHe; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=collabora.com (client-ip=136.143.188.112; helo=sender4-pp-f112.zoho.com; envelope-from=daniel.almeida@collabora.com; receiver=lists.ozlabs.org) Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4f6PNH39p7z2xQC for ; Fri, 06 Feb 2026 04:29:18 +1100 (AEDT) ARC-Seal: i=1; a=rsa-sha256; t=1770312503; cv=none; d=zohomail.com; s=zohoarc; b=KY6VO4SW0l1XxLDMZAUouQ9cD/iD79peHutQ0KQl5cAI58ncNvJiwtti9CY+/LYTVq8LVGaLx336qvFBW1nK0uYYN2FuP/dNcWPaFKQ6jtUH8q6nkX08vhqiZNfvamEqVNCEL490lsca1gNnCM+e8ABuf1gRRhdJeaEVBl/m0ds= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770312503; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=M3obdoKTXeSYmymRy2ZWHekuDCWgCx8je6+4eO2cz9k=; b=AI9TcGWkwp+RSBSUD9nITIIqJfIVXzeaXrynOiGtGCeC7xga1Mx2FZqa545SafwUkohb0usPV2V+uykcUAtSnpNwHPaADnqfWKH5kkc58PPZkwlRvwUMF96l42SKABb/Ab8vR9WJ01ZMPFDwFKGvWfLr0+koo4PQJpOuC2fqL2E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=daniel.almeida@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1770312503; s=zohomail; d=collabora.com; i=daniel.almeida@collabora.com; h=Content-Type:Mime-Version:Subject:Subject:From:From:In-Reply-To:Date:Date:Cc:Cc:Content-Transfer-Encoding:Message-Id:Message-Id:References:To:To:Reply-To; bh=M3obdoKTXeSYmymRy2ZWHekuDCWgCx8je6+4eO2cz9k=; b=Yc9/zHHe5skqGxSIwFV74mpj8b7Z8wpKWECEoqUHgcOO/reDAn1SN404GZ5Hqgyx WCLGah93CW5lnhrUrCd7P5HLtEWOa6Aq6dSg99urt9jhv8/vJFTRFq6KzJpIG68pkpU uWM6vu+6u0jcTtdMq20BY875GeV0LtkJT1Jsjj1M= Received: by mx.zohomail.com with SMTPS id 1770312501926532.5023520135724; Thu, 5 Feb 2026 09:28:21 -0800 (PST) Content-Type: text/plain; charset=utf-8 X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: [PATCH v2 1/4] rust: io: Add big-endian read and write functions From: Daniel Almeida In-Reply-To: Date: Thu, 5 Feb 2026 14:28:01 -0300 Cc: Danilo Krummrich , Link Mauve , rust-for-linux@vger.kernel.org, Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Srinivas Kandagatla , Miguel Ojeda , Boqun Feng , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Ard Biesheuvel , "Martin K. Petersen" , Eric Biggers , Greg Kroah-Hartman , Lyude Paul , Asahi Lina , Viresh Kumar , Lorenzo Stoakes , Tamir Duberstein , FUJITA Tomonori , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, officialTechflashYT@gmail.com, Ash Logan , Roberto Van Eeden , =?utf-8?Q?Jonathan_Neusch=C3=A4fer?= Content-Transfer-Encoding: quoted-printable Message-Id: References: <20260204040505.8447-1-linkmauve@linkmauve.fr> <20260204040505.8447-2-linkmauve@linkmauve.fr> To: Gary Guo X-Mailer: Apple Mail (2.3826.700.81) X-ZohoMailClient: External > On 5 Feb 2026, at 12:16, Gary Guo wrote: >=20 > On Thu Feb 5, 2026 at 2:28 PM GMT, Daniel Almeida wrote: >>=20 >>=20 >>> On 4 Feb 2026, at 12:18, Danilo Krummrich wrote: >>>=20 >>> On Wed Feb 4, 2026 at 5:04 AM CET, Link Mauve wrote: >>>> Another option would be to call u32::swap_bytes() on the data being >>>> read/written, but these helpers make the Rust code as ergonomic as = the C >>>> code. >>>>=20 >>>> Signed-off-by: Link Mauve >>>=20 >>> The I/O stuff recently changed quite significantly, please have a = look at the >>> driver-core-next branch [1] in the driver-core tree. >>>=20 >>> Also, instead of providing additional *be() methods, we should just = create a new >>> type io::Endianness and use it to indicate the device endianness = when requesting >>> the I/O resource. >>>=20 >>> For instance, for your driver we could have >>>=20 >>> request.iomap_exclusive_sized::<8>(Endianness::Big)? >>=20 >> Can we please structure this in a way that LittleEndian is the = default? >> Perhaps using a const generic that is defaulted, or something along = these lines. >=20 > I think we should have everything default to little endian, and have = wrapper > types that do big endian which require expicit construction, similar = to > RelaxedMmio in Alex's series. >=20 > Best, > Gary >=20 Ah yes, the RelaxedMmio pattern is definitely a good one. I agree that = we should head in this direction. =E2=80=94 Daniel