mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* range operation of outer cache when start >= end?
@ 2016-01-08  2:54 Masahiro Yamada
  2016-01-08 15:06 ` Russell King - ARM Linux
  0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2016-01-08  2:54 UTC (permalink / raw)
  To: linux-arm-kernel, Russell King - ARM Linux, Arnd Bergmann
  Cc: Linux Kernel Mailing List

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-08 16:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-08  2:54 range operation of outer cache when start >= end? Masahiro Yamada
2016-01-08 15:06 ` Russell King - ARM Linux
2016-01-08 16:06   ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome