[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1522163426.21176.24.camel@linux.intel.com>
Date: Tue, 27 Mar 2018 18:10:26 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: hpa@...or.com, peterz@...radead.org, tglx@...utronix.de,
mingo@...nel.org, torvalds@...ux-foundation.org,
linux-kernel@...r.kernel.org, lkp@...el.com, sohil.mehta@...el.com,
mitake@....info.waseda.ac.jp, linux-tip-commits@...r.kernel.org
Subject: Re: [tip:x86/urgent] x86/io: Define readq()/writeq() to use 64-bit
type
On Tue, 2018-02-13 at 08:58 -0800, tip-bot for Andy Shevchenko wrote:
> Commit-ID: 0fc8483b698620ea3d8cc6635b54eccc613c23a3
> Gitweb: https://git.kernel.org/tip/0fc8483b698620ea3d8cc6635b54ecc
> c613c23a3
> Author: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> AuthorDate: Fri, 19 Jan 2018 16:33:22 +0200
> Committer: Ingo Molnar <mingo@...nel.org>
> CommitDate: Tue, 13 Feb 2018 17:14:41 +0100
As of today I don't see this in linux-next
% git tag --contains 0fc8483b69862
next-20180214
next-20180215
next-20180216
What happened to this change?
>
> x86/io: Define readq()/writeq() to use 64-bit type
>
> Since non atomic readq() and writeq() were added some of the drivers
> would like to use it in a manner of:
>
> #include <io-64-nonatomic-lo-hi.h>
> ...
> pr_debug("Debug value of some register: %016llx\n", readq(addr));
>
> However, lo_hi_readq() always returns __u64 data, while readq()
> on x86_64 defines it as unsigned long. and thus compiler warns
> about type mismatch, although they are both 64-bit on x86_64.
>
> Convert readq() and writeq() on x86 to operate on deterministic
> 64-bit type. The most of architectures in the kernel already are using
> either unsigned long long, or u64 type for readq() / writeq().
> This change propagates consistency in that sense.
>
> While this is not an issue per se, though if someone wants to address
> it,
> the anchor could be the commit
>
> 797a796a13df ("asm-generic: architecture independent readq/writeq
> for 32bit environment")
>
> where non-atomic variants had been introduced.
>
> Note, there are only few users of above pattern and they will not be
> affected because they do cast returned value. The actual warning has
> been issued on not-yet-upstreamed code.
>
> Potentially we might get a new warnings if some 64-bit only code
> assigns returned value to unsigned long type of variable. This is
> assumed to be addressed on case-by-case basis.
>
> Reported-by: lkp <lkp@...el.com>
> Tested-by: Sohil Mehta <sohil.mehta@...el.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Cc: Hitoshi Mitake <mitake@....info.waseda.ac.jp>
> Cc: Linus Torvalds <torvalds@...ux-foundation.org>
> Cc: Mehta, Sohil <sohil.mehta@...el.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Link: http://lkml.kernel.org/r/20180119143322.16555-1-andriy.shevchenk
> o@...ux.intel.com
> Signed-off-by: Ingo Molnar <mingo@...nel.org>
> ---
> arch/x86/include/asm/io.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
> index 95e9486..365f5ba 100644
> --- a/arch/x86/include/asm/io.h
> +++ b/arch/x86/include/asm/io.h
> @@ -94,10 +94,10 @@ build_mmio_write(__writel, "l", unsigned int, "r",
> )
>
> #ifdef CONFIG_X86_64
>
> -build_mmio_read(readq, "q", unsigned long, "=r", :"memory")
> -build_mmio_read(__readq, "q", unsigned long, "=r", )
> -build_mmio_write(writeq, "q", unsigned long, "r", :"memory")
> -build_mmio_write(__writeq, "q", unsigned long, "r", )
> +build_mmio_read(readq, "q", unsigned long long, "=r", :"memory")
> +build_mmio_read(__readq, "q", unsigned long long, "=r", )
> +build_mmio_write(writeq, "q", unsigned long long, "r", :"memory")
> +build_mmio_write(__writeq, "q", unsigned long long, "r", )
>
> #define readq_relaxed(a) __readq(a)
> #define writeq_relaxed(v, a) __writeq(v, a)
--
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Intel Finland Oy
Powered by blists - more mailing lists