From: Jisheng Zhang <jszhang@kernel.org>
To: Conor Dooley <conor.dooley@microchip.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] riscv: Use asm-generic for {read,write}{bwlq} and their relaxed variant
Date: Mon, 27 Nov 2023 23:57:09 +0800 [thread overview]
Message-ID: <ZWS8VYwpsKoc56fV@xhacker> (raw)
In-Reply-To: <20231127-swell-garnish-3f2104647aa0@wendy>
On Mon, Nov 27, 2023 at 10:39:16AM +0000, Conor Dooley wrote:
> On Thu, Nov 23, 2023 at 10:20:03PM +0800, Jisheng Zhang wrote:
> > The asm-generic implementation is functionally identical to the riscv
> > version.
> >
> > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
>
> This fails to build for nommu:
> /tmp/tmp.ojumpiEgOt/arch/riscv/include/asm/timex.h:20:16: error: implicit declaration of function 'readq_relaxed' [-Werror=implicit-function-declaration]
> /tmp/tmp.ojumpiEgOt/include/asm-generic/io.h:342:23: error: conflicting types for 'readq_relaxed'; have 'u64(const volatile void *)' {aka 'long long unsigned int(const volatile void *)'}
>
> Cheers,
> Conor.
Hi,
Thanks for the report. I can reproduce the build error locally.
The problem is readl_relaxed usage in timex.h.
If include <asm/io.h> in timex.h, then we will meet issues which is
fixed by commit 0c3ac289.
If not include <asm/io.h>, then the readl_relaxed readq_relaxed
are not explictly declared as reported here.
I have two solutions:
solA: use __raw_readl and __raw_readq in timex, since I found other
architectures use the raw asm instructions for get_cycles()
solB: remove clint_time_val and export a function in timer-clint.c as below:
get_clint_cycles()
{
readl_relaxed(clint_time_val);
}
then
#define get_cycles get_clint_cycles
Both solutions can solve the issues. which one is better?
Thanks in advance
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: Jisheng Zhang <jszhang@kernel.org>
To: Conor Dooley <conor.dooley@microchip.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] riscv: Use asm-generic for {read,write}{bwlq} and their relaxed variant
Date: Mon, 27 Nov 2023 23:57:09 +0800 [thread overview]
Message-ID: <ZWS8VYwpsKoc56fV@xhacker> (raw)
In-Reply-To: <20231127-swell-garnish-3f2104647aa0@wendy>
On Mon, Nov 27, 2023 at 10:39:16AM +0000, Conor Dooley wrote:
> On Thu, Nov 23, 2023 at 10:20:03PM +0800, Jisheng Zhang wrote:
> > The asm-generic implementation is functionally identical to the riscv
> > version.
> >
> > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
>
> This fails to build for nommu:
> /tmp/tmp.ojumpiEgOt/arch/riscv/include/asm/timex.h:20:16: error: implicit declaration of function 'readq_relaxed' [-Werror=implicit-function-declaration]
> /tmp/tmp.ojumpiEgOt/include/asm-generic/io.h:342:23: error: conflicting types for 'readq_relaxed'; have 'u64(const volatile void *)' {aka 'long long unsigned int(const volatile void *)'}
>
> Cheers,
> Conor.
Hi,
Thanks for the report. I can reproduce the build error locally.
The problem is readl_relaxed usage in timex.h.
If include <asm/io.h> in timex.h, then we will meet issues which is
fixed by commit 0c3ac289.
If not include <asm/io.h>, then the readl_relaxed readq_relaxed
are not explictly declared as reported here.
I have two solutions:
solA: use __raw_readl and __raw_readq in timex, since I found other
architectures use the raw asm instructions for get_cycles()
solB: remove clint_time_val and export a function in timer-clint.c as below:
get_clint_cycles()
{
readl_relaxed(clint_time_val);
}
then
#define get_cycles get_clint_cycles
Both solutions can solve the issues. which one is better?
Thanks in advance
next prev parent reply other threads:[~2023-11-27 16:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-23 14:20 [PATCH] riscv: Use asm-generic for {read,write}{bwlq} and their relaxed variant Jisheng Zhang
2023-11-23 14:20 ` Jisheng Zhang
2023-11-27 10:39 ` Conor Dooley
2023-11-27 10:39 ` Conor Dooley
2023-11-27 15:57 ` Jisheng Zhang [this message]
2023-11-27 15:57 ` Jisheng Zhang
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=ZWS8VYwpsKoc56fV@xhacker \
--to=jszhang@kernel.org \
--cc=aou@eecs.berkeley.edu \
--cc=conor.dooley@microchip.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.