lkml.org 
[lkml]   [2016]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
Subjectrange operation of outer cache when start >= end?
From
Hi.


I know I am nitpicking. Forgive me if I am asking a silly question.


How should the outer-cache handle such an insane case like start >= end?

Assumed answers are:

[1] Do not care about that. It should never happen. If it does, fix
the caller.

[2] Add "if (start < end)" checking to
outer_inv_range(), outer_clean_range(), outer_flush_range()
in arch/arm/include/asm/outercache.h

[3] It should be cared in each of callbacks as needed



For example, l2c210_inv_range()
flushes the both ends of the range even if start >= end.

In this case, there is nothing to do, so should it have something like this?
if (start >= end)
return;


static void l2c210_inv_range(unsigned long start, unsigned long end)
{
void __iomem *base = l2x0_base;

if (start & (CACHE_LINE_SIZE - 1)) {
start &= ~(CACHE_LINE_SIZE - 1);
writel_relaxed(start, base + L2X0_CLEAN_INV_LINE_PA);
start += CACHE_LINE_SIZE;
}

if (end & (CACHE_LINE_SIZE - 1)) {
end &= ~(CACHE_LINE_SIZE - 1);
writel_relaxed(end, base + L2X0_CLEAN_INV_LINE_PA);
}

__l2c210_op_pa_range(base + L2X0_INV_LINE_PA, start, end);
__l2c210_cache_sync(base);
}





--
Best Regards
Masahiro Yamada

\
 
 \ /
  Last update: 2016-01-08 04:01    [W:0.037 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site