From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: Lichao Liu <liulichao@loongson.cn>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Paul Burton <paulburton@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Max Filippov <jcmvbkbc@gmail.com>,
yuanjunqing@loongson.cn, linux-mips@vger.kernel.org
Subject: Re: [PATCH] MIPS: CPU_LOONGSON2EF need software to maintain cache consistency
Date: Tue, 26 May 2020 19:38:59 +0800 [thread overview]
Message-ID: <20200526193859.0adaea3b@halation.net.flygoat.com> (raw)
In-Reply-To: <20200526111438.3788-1-liulichao@loongson.cn>
On Tue, 26 May 2020 19:14:38 +0800
Lichao Liu <liulichao@loongson.cn> wrote:
> CPU_LOONGSON2EF need software to maintain cache consistency,
> so modify the 'cpu_needs_post_dma_flush' function to return true
> when the cpu type is CPU_LOONGSON2EF.
Hi Lichao,
I don't think that's required for Loongson-2EF,
According to the comment in code:
The affected CPUs below in 'cpu_needs_post_dma_flush()' can
speculatively
fill random cachelines with stale data at any time, requiring an
extra flush post-DMA.
And according to my understanding that's not going to happen on
Loongson-2EF. We're always allocating coherent DMA memory in uncached
range, Loongson-2EF's writeback policy will ensure it won't writeback
random lines to the memory but only modified dirty lines.
We've been fine without post flush for almost 10 years, there is no
stability issue revealed.
Btw: Please keep me CCed for Loongson-2EF patches. I'm not very active
on 2EF development but I'll still review patches.
Thanks.
> ---
> arch/mips/mm/dma-noncoherent.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/mips/mm/dma-noncoherent.c
> b/arch/mips/mm/dma-noncoherent.c index fcea92d95d86..563c2c0d0c81
> 100644 --- a/arch/mips/mm/dma-noncoherent.c
> +++ b/arch/mips/mm/dma-noncoherent.c
> @@ -33,6 +33,7 @@ static inline bool cpu_needs_post_dma_flush(void)
> case CPU_R10000:
> case CPU_R12000:
> case CPU_BMIPS5000:
> + case CPU_LOONGSON2EF:
> return true;
> default:
> /*
--
Jiaxun Yang
next prev parent reply other threads:[~2020-05-26 11:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-26 11:14 [PATCH] MIPS: CPU_LOONGSON2EF need software to maintain cache consistency Lichao Liu
2020-05-26 11:38 ` Jiaxun Yang [this message]
2020-05-26 12:40 ` Lichao Liu
2020-05-26 13:01 ` Thomas Bogendoerfer
2020-05-26 13:29 ` Robin Murphy
2020-05-26 15:01 ` Lichao Liu
2020-05-26 15:25 ` Jiaxun Yang
2020-05-26 16:00 ` Thomas Bogendoerfer
2020-05-26 16:42 ` Jiaxun Yang
2020-05-26 16:16 ` Thomas Bogendoerfer
2020-05-26 13:25 ` Jiaxun Yang
2020-05-26 14:50 ` Lichao Liu
2020-05-27 10:49 ` Thomas Bogendoerfer
-- strict thread matches above, loose matches on Subject: below --
2020-05-28 1:10 Lichao Liu
2020-05-28 6:05 ` Jiaxun Yang
2020-05-28 7:44 ` Thomas Bogendoerfer
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=20200526193859.0adaea3b@halation.net.flygoat.com \
--to=jiaxun.yang@flygoat.com \
--cc=geert@linux-m68k.org \
--cc=jcmvbkbc@gmail.com \
--cc=linux-mips@vger.kernel.org \
--cc=liulichao@loongson.cn \
--cc=paulburton@kernel.org \
--cc=robin.murphy@arm.com \
--cc=tsbogend@alpha.franken.de \
--cc=yuanjunqing@loongson.cn \
/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