Wednesday, October 27, 2010

dma and intr

1.dma needs specially reserved ram block(real physical pages)
2.dma needs virtual physical pages ie a block of physical addresses that is not mapped to ram
3.cpu write-->cache-->dma phy addr-->hardware
4.dma read-->dma phy addr-->cache-->cpu read
5.if cache line is shared by dma buffer and cpu buffer
copy dma part to phy buffer
cpu write new data to dma part
cpu invalidates cpu buffer
dma part data is over written in phy buffer
phy buffer is dma'ed

hw dma reads to phy buffer
cpu writes to cpu buffer
invalidation writes stale dma part to phy buffer,data overwritten
cpu reads the dma phy buffer ,finds old value


================

1.irq save , saves the current cpus all interrupt flags(or current drivers interrupt?) and
disables "this or all" interrupt on current cpu, also takes the spinlock raw variable
1.1 other cpu gets this interrupt, but spins on the spinlock hence, interrupt waits

2.if the same was done using semaphore, interrupts are not disabled , function takes the semaphore,
an interrupt comes on the same cpu,calls the same function,reaccquires the semaphore and deadlock,because previous invokation has to run on the same cpu

3.from timer irq save is not required since local cpu interrupt is disabled

4.

No comments:

Post a Comment