linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Physical address access / Temporary MMU disable
@ 2010-05-17  9:04 Hans Hübner
  2010-05-17  9:15 ` Russell King - ARM Linux
  0 siblings, 1 reply; 2+ messages in thread
From: Hans Hübner @ 2010-05-17  9:04 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

I'm working with Linux 2.6.22 on an AT91SAM9260 based system.

I am implementing a device driver that has very strict timing and
jitter requirements.  It uses a FIQ handler, written in assembly, that
transfers data from the on-chip SRAM to GPIO ports.  In the default
configuration, it appears that the FIQ handler is invoked with the MMU
enabled, so the SRAM (and I/O) accesses are undergoing virtual address
translation.  If there is a TLB miss, this means that the MMU tables
in SDRAM are consulted, which violates the timing requirements of my
driver.

In order to reduce FIQ response time jitter, I would like to not use
virtual addresses in the FIQ handler.  Is disabling the MMU for the
duration of the FIQ handler through the CP15 coprocessor register the
right way to do this, or is there another way to make some section of
code use physical addresses?

Thanks,
Hans

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

* Physical address access / Temporary MMU disable
  2010-05-17  9:04 Physical address access / Temporary MMU disable Hans Hübner
@ 2010-05-17  9:15 ` Russell King - ARM Linux
  0 siblings, 0 replies; 2+ messages in thread
From: Russell King - ARM Linux @ 2010-05-17  9:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 17, 2010 at 11:04:09AM +0200, Hans H?bner wrote:
> I am implementing a device driver that has very strict timing and
> jitter requirements.  It uses a FIQ handler, written in assembly, that
> transfers data from the on-chip SRAM to GPIO ports.  In the default
> configuration, it appears that the FIQ handler is invoked with the MMU
> enabled, so the SRAM (and I/O) accesses are undergoing virtual address
> translation.  If there is a TLB miss, this means that the MMU tables
> in SDRAM are consulted, which violates the timing requirements of my
> driver.
> 
> In order to reduce FIQ response time jitter, I would like to not use
> virtual addresses in the FIQ handler.  Is disabling the MMU for the
> duration of the FIQ handler through the CP15 coprocessor register the
> right way to do this, or is there another way to make some section of
> code use physical addresses?

If you can't tolerate the delay it takes for a TLB miss, you certainly
can't tolerate the delay it would take to disable and flush caches, and
re-enable the MMU.  (You can't just disable the MMU - you must disable
the data cache as well.)

It sounds like you instead need to think about TLB lockdown.

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

end of thread, other threads:[~2010-05-17  9:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-17  9:04 Physical address access / Temporary MMU disable Hans Hübner
2010-05-17  9:15 ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).