From: Randy Dunlap <rdunlap@infradead.org>
To: guoren@kernel.org, arnd@arndb.de
Cc: linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org,
linux-arch@vger.kernel.org, Guo Ren <guoren@linux.alibaba.com>
Subject: Re: [PATCH] csky: syscache: Fixup duplicate cache flush
Date: Tue, 4 May 2021 10:21:12 -0700 [thread overview]
Message-ID: <00cd7f1a-c6d4-b8ed-ba60-5c74516f4534@infradead.org> (raw)
In-Reply-To: <1620112488-18773-1-git-send-email-guoren@kernel.org>
On 5/4/21 12:14 AM, guoren@kernel.org wrote:
> From: Guo Ren <guoren@linux.alibaba.com>
>
> The current csky logic of sys_cacheflush is wrong, it'll cause
> icache flush call dcache flush again. Now fixup it with a
> conditional "break & fallthrough".
>
> Fixes: 997153b9a75c ("csky: Add flush_icache_mm to defer flush icache all")
> Fixes: 0679d29d3e23 ("csky: fix syscache.c fallthrough warning")
> Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
> Cc: Randy Dunlap <rdunlap@infradead.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
more below:
> ---
> arch/csky/mm/syscache.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/arch/csky/mm/syscache.c b/arch/csky/mm/syscache.c
> index 4e51d63..a7b53b0 100644
> --- a/arch/csky/mm/syscache.c
> +++ b/arch/csky/mm/syscache.c
> @@ -12,15 +12,18 @@ SYSCALL_DEFINE3(cacheflush,
> int, cache)
> {
> switch (cache) {
> - case ICACHE:
> case BCACHE:
> - flush_icache_mm_range(current->mm,
> - (unsigned long)addr,
> - (unsigned long)addr + bytes);
> - fallthrough;
> case DCACHE:
> dcache_wb_range((unsigned long)addr,
> (unsigned long)addr + bytes);
> + if (cache == BCACHE)
> + fallthrough;
> + else
> + break;
I think the above would be more readable as:
if (cache != BCACHE)
break;
fallthrough;
fwiw.
> + case ICACHE:
> + flush_icache_mm_range(current->mm,
> + (unsigned long)addr,
> + (unsigned long)addr + bytes);
> break;
> default:
> return -EINVAL;
>
thanks.
--
~Randy
prev parent reply other threads:[~2021-05-04 17:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-04 7:14 [PATCH] csky: syscache: Fixup duplicate cache flush guoren
2021-05-04 17:21 ` Randy Dunlap [this message]
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=00cd7f1a-c6d4-b8ed-ba60-5c74516f4534@infradead.org \
--to=rdunlap@infradead.org \
--cc=arnd@arndb.de \
--cc=guoren@kernel.org \
--cc=guoren@linux.alibaba.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-csky@vger.kernel.org \
--cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).