Skip to contentSkip to conversation

flush_icache_range in the sticore driver

DISCUSSION Christoph Hellwig 2 participants 2 messages Jul 5, 2022 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

Hi all,

flush_icache_range is supposed to flush the instruction cache, which is something no driver should be doing. It was added in commit 03b18f1b2afe ("[PARISC] Clean up sti_flush") but the explanation in there looks odd.

Can someone shed a light what flushes this tries to flush and why it can't be done behind a proper API?

#1 lore raw
Quoted 9 lines · Christoph Hellwig

Hi all,

flush_icache_range is supposed to flush the instruction cache, which is something no driver should be doing. It was added in commit 03b18f1b2afe ("[PARISC] Clean up sti_flush") but the explanation in there looks odd.

Can someone shed a light what flushes this tries to flush and why it can't be done behind a proper API?

What's wrong with the explanation:

"sti_flush is supposed to flush the caches so we can execute the STI rom we copied to memory."

Which is in that commit?

The STI driver is taking the executable STI ROM code, which is in a very slow to access part of the system and copying it to RAM so it can be executed. After the driver has done the copy it needs to flush the icache just in case there's anything stale in there before executing the newly copied code.

If you grep the drive for sti_call, you'll see all the points we call into the copied rom code.

James