From: Ben Dooks <ben.dooks@codethink.co.uk>
To: Chenghai Huang <huangchenghai2@huawei.com>,
arnd@arndb.de, catalin.marinas@arm.com, will@kernel.org,
akpm@linux-foundation.org, anshuman.khandual@arm.com,
ryan.roberts@arm.com, andriy.shevchenko@linux.intel.com,
herbert@gondor.apana.org.au, linux-kernel@vger.kernel.org,
linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-crypto@vger.kernel.org, linux-api@vger.kernel.org
Cc: fanghao11@huawei.com, shenyang39@huawei.com,
liulongfang@huawei.com, qianweili@huawei.com
Subject: Re: [PATCH RFC 3/4] io-128-nonatomic: introduce io{read|write}128_{lo_hi|hi_lo}
Date: Wed, 12 Nov 2025 14:48:23 +0000 [thread overview]
Message-ID: <59f8bc30-c1c6-4f07-87dd-cd2893ae87f7@codethink.co.uk> (raw)
In-Reply-To: <20251112015846.1842207-4-huangchenghai2@huawei.com>
On 12/11/2025 01:58, Chenghai Huang wrote:
> From: Weili Qian <qianweili@huawei.com>
>
> In order to provide non-atomic functions for io{read|write}128.
> We define a number of variants of these functions in the generic
> iomap that will do non-atomic operations.
>
> These functions are only defined if io{read|write}128 are defined.
> If they are not, then the wrappers that always use non-atomic operations
> from include/linux/io-128-nonatomic*.h will be used.
>
> Signed-off-by: Weili Qian <qianweili@huawei.com>
> Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
> ---
> include/linux/io-128-nonatomic-hi-lo.h | 35 ++++++++++++++++++++++++++
> include/linux/io-128-nonatomic-lo-hi.h | 34 +++++++++++++++++++++++++
> 2 files changed, 69 insertions(+)
> create mode 100644 include/linux/io-128-nonatomic-hi-lo.h
> create mode 100644 include/linux/io-128-nonatomic-lo-hi.h
>
> diff --git a/include/linux/io-128-nonatomic-hi-lo.h b/include/linux/io-128-nonatomic-hi-lo.h
> new file mode 100644
> index 000000000000..b5b083a9e81b
> --- /dev/null
> +++ b/include/linux/io-128-nonatomic-hi-lo.h
> @@ -0,0 +1,35 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _LINUX_IO_128_NONATOMIC_HI_LO_H_
> +#define _LINUX_IO_128_NONATOMIC_HI_LO_H_
> +
> +#include <linux/io.h>
> +#include <asm-generic/int-ll64.h>
> +
> +static inline u128 ioread128_hi_lo(const void __iomem *addr)
> +{
> + u32 low, high;
did you mean u64 here?
> + high = ioread64(addr + sizeof(u64));
> + low = ioread64(addr);
> +
> + return low + ((u128)high << 64);
> +}
> +
> +static inline void iowrite128_hi_lo(u128 val, void __iomem *addr)
> +{
> + iowrite64(val >> 64, addr + sizeof(u64));
> + iowrite64(val, addr);
> +}
> +
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
https://www.codethink.co.uk/privacy.html
next prev parent reply other threads:[~2025-11-12 14:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-12 1:58 [PATCH RFC 0/4] Introduce 128-bit IO access Chenghai Huang
2025-11-12 1:58 ` [PATCH RFC 1/4] UAPI: Introduce 128-bit types and byteswap operations Chenghai Huang
2025-11-12 1:58 ` [PATCH RFC 2/4] asm-generic/io.h: add io{read,write}128 accessors Chenghai Huang
2025-11-12 1:58 ` [PATCH RFC 3/4] io-128-nonatomic: introduce io{read|write}128_{lo_hi|hi_lo} Chenghai Huang
2025-11-12 14:48 ` Ben Dooks [this message]
2025-11-13 11:10 ` huangchenghai
2025-11-12 1:58 ` [PATCH RFC 4/4] arm64/io: Add {__raw_read|__raw_write}128 support Chenghai Huang
2025-11-12 12:28 ` Mark Rutland
2025-11-12 14:01 ` David Laight
2025-11-12 14:17 ` Mark Rutland
2025-11-13 14:19 ` huangchenghai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=59f8bc30-c1c6-4f07-87dd-cd2893ae87f7@codethink.co.uk \
--to=ben.dooks@codethink.co.uk \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=anshuman.khandual@arm.com \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=fanghao11@huawei.com \
--cc=herbert@gondor.apana.org.au \
--cc=huangchenghai2@huawei.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liulongfang@huawei.com \
--cc=qianweili@huawei.com \
--cc=ryan.roberts@arm.com \
--cc=shenyang39@huawei.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox