From: Sandipan Das <sandipan@linux.ibm.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>, mpe@ellerman.id.au
Cc: aneesh.kumar@linux.ibm.com, rashmica.g@gmail.com,
jniethe5@gmail.com, linuxppc-dev@lists.ozlabs.org,
david@redhat.com
Subject: Re: [PATCH] powerpc/powernv/memtrace: Fix dcache flushing
Date: Sat, 1 May 2021 21:01:26 +0530 [thread overview]
Message-ID: <6d585ff1-f238-d18b-5cc5-9259ebddbdbd@linux.ibm.com> (raw)
In-Reply-To: <cb700884-b9f3-f3b9-4fae-272d678d1626@csgroup.eu>
On 30/04/21 2:12 pm, Christophe Leroy wrote:
>
>
> Le 30/04/2021 à 09:55, Sandipan Das a écrit :
>> Trace memory is cleared and the corresponding dcache lines
>> are flushed after allocation. However, this should not be
>> done using the PFN. This adds the missing __va() conversion.
>>
>> Fixes: 2ac02e5ecec0 ("powerpc/mm: Remove dcache flush from memory remove.")
>> Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
>> ---
>> arch/powerpc/platforms/powernv/memtrace.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/powerpc/platforms/powernv/memtrace.c b/arch/powerpc/platforms/powernv/memtrace.c
>> index 71c1262589fe..a31f13814f2e 100644
>> --- a/arch/powerpc/platforms/powernv/memtrace.c
>> +++ b/arch/powerpc/platforms/powernv/memtrace.c
>> @@ -104,8 +104,8 @@ static void memtrace_clear_range(unsigned long start_pfn,
>> * Before we go ahead and use this range as cache inhibited range
>> * flush the cache.
>> */
>> - flush_dcache_range_chunked(PFN_PHYS(start_pfn),
>> - PFN_PHYS(start_pfn + nr_pages),
>> + flush_dcache_range_chunked((unsigned long)__va(PFN_PHYS(start_pfn)),
>> + (unsigned long)__va(PFN_PHYS(start_pfn + nr_pages)),
>
> Can you use pfn_to_virt() instead ?
>
>> FLUSH_CHUNK_SIZE);
>> }
>>
Sure, that looks cleaner. Thanks for the suggestion.
- Sandipan
prev parent reply other threads:[~2021-05-01 15:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-30 7:55 [PATCH] powerpc/powernv/memtrace: Fix dcache flushing Sandipan Das
2021-04-30 8:03 ` Aneesh Kumar K.V
2021-04-30 8:42 ` Christophe Leroy
2021-05-01 15:31 ` Sandipan Das [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=6d585ff1-f238-d18b-5cc5-9259ebddbdbd@linux.ibm.com \
--to=sandipan@linux.ibm.com \
--cc=aneesh.kumar@linux.ibm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=david@redhat.com \
--cc=jniethe5@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=rashmica.g@gmail.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;
as well as URLs for NNTP newsgroup(s).