* flush_icache_range in the sticore driver
@ 2022-07-05 16:46 Christoph Hellwig
2022-07-05 21:02 ` James Bottomley
0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2022-07-05 16:46 UTC (permalink / raw)
Cc: linux-parisc, linux-fbdev, dri-devel
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?
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: flush_icache_range in the sticore driver
2022-07-05 16:46 flush_icache_range in the sticore driver Christoph Hellwig
@ 2022-07-05 21:02 ` James Bottomley
0 siblings, 0 replies; 2+ messages in thread
From: James Bottomley @ 2022-07-05 21:02 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-parisc, linux-fbdev, dri-devel
On Tue, 2022-07-05 at 18:46 +0200, Christoph Hellwig wrote:
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-05 21:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-05 16:46 flush_icache_range in the sticore driver Christoph Hellwig
2022-07-05 21:02 ` James Bottomley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox