Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-11-07 Thread york sun
On 11/07/2016 06:12 AM, Mark Rutland wrote: > On Fri, Oct 28, 2016 at 09:35:37PM +, york sun wrote: >> I am struggling on the dcache_disable() which implies all dcache is >> flushed. I don't have a reasonable way to flush all if I want to skip >> L3. I tried to benchmark flushing by VA to

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-11-07 Thread Mark Rutland
On Fri, Oct 28, 2016 at 09:35:37PM +, york sun wrote: > I am struggling on the dcache_disable() which implies all dcache is > flushed. I don't have a reasonable way to flush all if I want to skip > L3. I tried to benchmark flushing by VA to cover my entire 16GB memory. > It took 30+

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-11-07 Thread Mark Rutland
On Fri, Oct 28, 2016 at 12:32:36PM -0600, Stephen Warren wrote: > Related, consider the following from the Linux kernel's > Documentation/arm64/booting.txt: > > >- Caches, MMUs > > The MMU must be off. > > Instruction cache may be on or off. > > The address range corresponding to the loaded

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-28 Thread york sun
On 10/28/2016 11:32 AM, Stephen Warren wrote: > On 10/28/2016 12:17 PM, york sun wrote: >> On 10/28/2016 10:57 AM, Stephen Warren wrote: >>> On 10/28/2016 11:38 AM, york sun wrote: On 10/26/2016 02:02 PM, york@nxp.com wrote: > > I came back from my testing and I have more

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-28 Thread york sun
On 10/26/2016 02:02 PM, york@nxp.com wrote: > > I came back from my testing and I have more questions than answers. > > For _this_ patch, I proposed to flush cache before disabling them, > noting once the dcache is disabled, the staled data in dirty cache is > not visible to the core. My

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-28 Thread york sun
On 10/28/2016 10:57 AM, Stephen Warren wrote: > On 10/28/2016 11:38 AM, york sun wrote: >> On 10/26/2016 02:02 PM, york@nxp.com wrote: >>> >>> I came back from my testing and I have more questions than answers. >>> >>> For _this_ patch, I proposed to flush cache before disabling them, >>>

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-28 Thread Stephen Warren
On 10/28/2016 12:17 PM, york sun wrote: On 10/28/2016 10:57 AM, Stephen Warren wrote: On 10/28/2016 11:38 AM, york sun wrote: On 10/26/2016 02:02 PM, york@nxp.com wrote: I came back from my testing and I have more questions than answers. For _this_ patch, I proposed to flush cache

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-28 Thread Stephen Warren
On 10/28/2016 11:38 AM, york sun wrote: On 10/26/2016 02:02 PM, york@nxp.com wrote: I came back from my testing and I have more questions than answers. For _this_ patch, I proposed to flush cache before disabling them, noting once the dcache is disabled, the staled data in dirty cache is

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-26 Thread york sun
On 10/26/2016 02:00 PM, Stephen Warren wrote: > On 10/26/2016 02:29 PM, york sun wrote: >> On 10/26/2016 01:12 PM, Stephen Warren wrote: >>> On 10/26/2016 01:54 PM, york sun wrote: On 10/26/2016 12:47 PM, Stephen Warren wrote: > > There are two data structures in ARM U-Boot that

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-26 Thread york sun
On 10/26/2016 12:54 PM, york@nxp.com wrote: > On 10/26/2016 12:47 PM, Stephen Warren wrote: >> >> There are two data structures in ARM U-Boot that describe memory layout: >> >> 1) A list of RAM memory regions. U-Boot uses these to know where to >> relocate itself to (it relocates itself to the

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-26 Thread Stephen Warren
On 10/26/2016 02:29 PM, york sun wrote: On 10/26/2016 01:12 PM, Stephen Warren wrote: On 10/26/2016 01:54 PM, york sun wrote: On 10/26/2016 12:47 PM, Stephen Warren wrote: There are two data structures in ARM U-Boot that describe memory layout: 1) A list of RAM memory regions. U-Boot uses

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-26 Thread york sun
On 10/26/2016 01:12 PM, Stephen Warren wrote: > On 10/26/2016 01:54 PM, york sun wrote: >> On 10/26/2016 12:47 PM, Stephen Warren wrote: >>> >>> There are two data structures in ARM U-Boot that describe memory layout: >>> >>> 1) A list of RAM memory regions. U-Boot uses these to know where to >>>

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-26 Thread Stephen Warren
On 10/26/2016 01:54 PM, york sun wrote: On 10/26/2016 12:47 PM, Stephen Warren wrote: There are two data structures in ARM U-Boot that describe memory layout: 1) A list of RAM memory regions. U-Boot uses these to know where to relocate itself to (it relocates itself to the top of RAM at

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-26 Thread york sun
On 10/26/2016 12:47 PM, Stephen Warren wrote: > > There are two data structures in ARM U-Boot that describe memory layout: > > 1) A list of RAM memory regions. U-Boot uses these to know where to > relocate itself to (it relocates itself to the top of RAM at boot), and > to fill in the /memory node

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-26 Thread Stephen Warren
On 10/24/2016 04:59 AM, Mark Rutland wrote: On Fri, Oct 21, 2016 at 07:31:52PM +, york sun wrote: On 10/20/2016 01:34 PM, Stephen Warren wrote: On 10/19/2016 11:06 PM, york sun wrote: I understand the data in dirty cache is not lost when the dcache is disabled. It is just not accessible.

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-26 Thread Stephen Warren
On 10/24/2016 04:44 AM, Mark Rutland wrote: Hi, Sorry for joining this a bit late; apologies if the below re-treads ground already covered. On Wed, Oct 19, 2016 at 09:25:02AM -0600, Stephen Warren wrote: On 10/14/2016 02:17 PM, York Sun wrote: Current code turns off d-cache first, then flush

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-24 Thread Mark Rutland
On Fri, Oct 21, 2016 at 07:31:52PM +, york sun wrote: > On 10/20/2016 01:34 PM, Stephen Warren wrote: > > On 10/19/2016 11:06 PM, york sun wrote: > >> I understand the data in dirty cache is not lost when the dcache is > >> disabled. It is just not accessible. In my case, after flushing L1/L2

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-24 Thread Mark Rutland
Hi, Sorry for joining this a bit late; apologies if the below re-treads ground already covered. On Wed, Oct 19, 2016 at 09:25:02AM -0600, Stephen Warren wrote: > On 10/14/2016 02:17 PM, York Sun wrote: > >Current code turns off d-cache first, then flush all levels of cache. > >This results data

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-21 Thread york sun
On 10/20/2016 01:34 PM, Stephen Warren wrote: > On 10/19/2016 11:06 PM, york sun wrote: >> On 10/19/2016 06:01 PM, Stephen Warren wrote: >>> On 10/19/2016 04:32 PM, york sun wrote: On 10/19/2016 12:18 PM, Stephen Warren wrote: > On 10/19/2016 09:25 AM, Stephen Warren wrote: >> On

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-20 Thread Stephen Warren
On 10/19/2016 11:06 PM, york sun wrote: On 10/19/2016 06:01 PM, Stephen Warren wrote: On 10/19/2016 04:32 PM, york sun wrote: On 10/19/2016 12:18 PM, Stephen Warren wrote: On 10/19/2016 09:25 AM, Stephen Warren wrote: On 10/14/2016 02:17 PM, York Sun wrote: Current code turns off d-cache

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-19 Thread york sun
On 10/19/2016 06:01 PM, Stephen Warren wrote: > On 10/19/2016 04:32 PM, york sun wrote: >> On 10/19/2016 12:18 PM, Stephen Warren wrote: >>> On 10/19/2016 09:25 AM, Stephen Warren wrote: On 10/14/2016 02:17 PM, York Sun wrote: > Current code turns off d-cache first, then flush all levels

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-19 Thread Stephen Warren
On 10/19/2016 04:32 PM, york sun wrote: On 10/19/2016 12:18 PM, Stephen Warren wrote: On 10/19/2016 09:25 AM, Stephen Warren wrote: On 10/14/2016 02:17 PM, York Sun wrote: Current code turns off d-cache first, then flush all levels of cache. This results data loss. As soon as d-cache is off,

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-19 Thread york sun
On 10/19/2016 12:18 PM, Stephen Warren wrote: > On 10/19/2016 09:25 AM, Stephen Warren wrote: >> On 10/14/2016 02:17 PM, York Sun wrote: >>> Current code turns off d-cache first, then flush all levels of cache. >>> This results data loss. As soon as d-cache is off, the dirty cache >>> is discarded

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-19 Thread Stephen Warren
On 10/19/2016 09:25 AM, Stephen Warren wrote: On 10/14/2016 02:17 PM, York Sun wrote: Current code turns off d-cache first, then flush all levels of cache. This results data loss. As soon as d-cache is off, the dirty cache is discarded according to the test on LS2080A. This issue was not seen

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-19 Thread Stephen Warren
On 10/14/2016 02:17 PM, York Sun wrote: Current code turns off d-cache first, then flush all levels of cache. This results data loss. As soon as d-cache is off, the dirty cache is discarded according to the test on LS2080A. This issue was not seen as long as external L3 cache was flushed to push

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-17 Thread Stephen Warren
On 10/14/2016 02:17 PM, York Sun wrote: Current code turns off d-cache first, then flush all levels of cache. This results data loss. As soon as d-cache is off, the dirty cache is discarded according to the test on LS2080A. This issue was not seen as long as external L3 cache was flushed to push

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-14 Thread Stephen Warren
On 10/14/2016 02:17 PM, York Sun wrote: Current code turns off d-cache first, then flush all levels of cache. This results data loss. As soon as d-cache is off, the dirty cache is discarded according to the test on LS2080A. This issue was not seen as long as external L3 cache was flushed to push

[U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-14 Thread York Sun
Current code turns off d-cache first, then flush all levels of cache. This results data loss. As soon as d-cache is off, the dirty cache is discarded according to the test on LS2080A. This issue was not seen as long as external L3 cache was flushed to push the data to main memory. However,