From: Ralf Baechle <ralf@linux-mips.org>
To: Petri Gynther <pgynther@google.com>
Cc: linux-mips@linux-mips.org, cernekee@gmail.com, f.fainelli@gmail.com
Subject: Re: [PATCH] MIPS: BMIPS: fix bmips_wr_vec()
Date: Thu, 28 May 2015 18:40:37 +0200 [thread overview]
Message-ID: <20150528164037.GB7012@linux-mips.org> (raw)
In-Reply-To: <20150527062508.CD24722020B@puck.mtv.corp.google.com>
On Tue, May 26, 2015 at 11:25:08PM -0700, Petri Gynther wrote:
> bmips_wr_vec() copies exception vector code from start to dst.
>
> The call to dma_cache_wback() needs to flush (end-start) bytes,
> starting at dst, from write-back cache to memory.
>
> Signed-off-by: Petri Gynther <pgynther@google.com>
> ---
> arch/mips/kernel/smp-bmips.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c
> index fd528d7..336708a 100644
> --- a/arch/mips/kernel/smp-bmips.c
> +++ b/arch/mips/kernel/smp-bmips.c
> @@ -444,7 +444,7 @@ struct plat_smp_ops bmips5000_smp_ops = {
> static void bmips_wr_vec(unsigned long dst, char *start, char *end)
> {
> memcpy((void *)dst, start, end - start);
> - dma_cache_wback((unsigned long)start, end - start);
> + dma_cache_wback(dst, end - start);
dma_cache_wback is a guess what - DMA function. It doesn't handle
I-caches at all and on some platforms might actually do nothing at all.
or use other optimizations that only work for DMA buffers and it's not
SMP aware - nor will it. So if it ever worked for your case then just
because you're lucky. This really should use flush_icache_range which
also conveniently for your code takes an end pointer as argument.
Ralf
next prev parent reply other threads:[~2015-05-28 16:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-27 6:25 [PATCH] MIPS: BMIPS: fix bmips_wr_vec() Petri Gynther
2015-05-27 17:36 ` Florian Fainelli
2015-05-28 16:41 ` Ralf Baechle
2015-05-27 20:31 ` Kevin Cernekee
2015-05-28 16:40 ` Ralf Baechle [this message]
2015-05-28 16:47 ` Kevin Cernekee
2015-05-28 18:25 ` Petri Gynther
2015-05-28 18:59 ` Ralf Baechle
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=20150528164037.GB7012@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=cernekee@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=linux-mips@linux-mips.org \
--cc=pgynther@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox