From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH] nvme: Fix cache alignment
Date: Sun, 7 Feb 2021 19:20:14 +0100 [thread overview]
Message-ID: <571fcc35-303e-cedf-48ea-29c24bf09248@gmail.com> (raw)
In-Reply-To: <20210204165747.GC10169@bill-the-cat>
On 2/4/21 5:57 PM, Tom Rini wrote:
[...]
>>>>>>>> +static void nvme_flush_dcache_range(void *start, unsigned long size)
>>>>>>>> +{
>>>>>>>> + unsigned long s, e;
>>>>>>>> + nvme_align_dcache_range(start, size, &s, &e);
>>>>>>>> + flush_dcache_range(s, e);
>>>>>>
>>>>>> There is no good reason for alignment restrictions when it comes to
>>>>>> clean (& invalidate), so there is no need for this wrapper.
>>>>>
>>>>> Is that on ARM64-specific or is that applicable in general ? The driver
>>>>> is expected to work on any CPU.
>>>>
>>>> Cache clean (actually: cache clean&invalidate) is what happens on evictions
>>>> all of the time, at the cache controller's discretion. So there is no
>>>> real harm in that operation per se. When an eviction happens on a
>>>> *clean* cache line, this is basically just an invalidate, which is also not
>>>> harmful.
>>>>
>>>> There are harmful cases when buffers sharing a cache line are both "just invalidated"
>>>> and "cleaned" at different points in time.
>>>
>>> Is that on ARM64-specific or is that applicable in general ? (the above
>>> does not answer that question)
>>
>> I would say that's a property of *every* write-back cache
>> implementation:
>> https://en.wikipedia.org/wiki/Cache_(computing)#/media/File:Write-back_with_write-allocation.svg
>
> I've been reading and digesting the thread as it goes, and the only
> thing I do want to chime in on here right now is that yes, U-Boot
> does and will continue to support every CPU that someone wants to run it
> on, and one of the takeaways I see from this thread is we need some
> better documented abstractions around cache, as it's very tricky to get
> right all the time.
Documenting the u-boot cache function behavior precisely is fine by me,
but that is somewhat separate topic from this bugfix.
So I will ask a simple question -- is there anything blocking this
bugfix from being applied ?
next prev parent reply other threads:[~2021-02-07 18:20 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-30 17:53 [PATCH] nvme: Fix cache alignment Marek Vasut
2021-02-02 3:55 ` Bin Meng
2021-02-02 8:05 ` Marek Vasut
2021-02-02 8:54 ` Bin Meng
2021-02-02 9:04 ` Marek Vasut
2021-02-02 9:12 ` Bin Meng
2021-02-02 16:09 ` Marek Vasut
2021-02-02 13:04 ` Andre Przywara
2021-02-02 16:08 ` Marek Vasut
2021-02-02 16:23 ` Andre Przywara
2021-02-02 21:18 ` Marek Vasut
2021-02-03 10:42 ` Andre Przywara
2021-02-03 13:08 ` Marek Vasut
2021-02-04 10:26 ` Andre Przywara
2021-02-04 16:57 ` Tom Rini
2021-02-07 18:20 ` Marek Vasut [this message]
2021-02-07 19:13 ` Tom Rini
2021-02-08 13:32 ` Andre Przywara
2021-02-08 15:11 ` Bin Meng
2021-02-08 15:51 ` Marek Vasut
2021-02-08 15:49 ` Marek Vasut
2021-02-08 16:30 ` Andre Przywara
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=571fcc35-303e-cedf-48ea-29c24bf09248@gmail.com \
--to=marek.vasut@gmail.com \
--cc=u-boot@lists.denx.de \
/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