Skip to contentSkip to conversation

Microblaze, DMA and cache: Lack of sync functions?

DISCUSSION Eli Billauer 2 participants 2 messages Aug 13, 2011 – Aug 15, 2011

lore
Share & tools
lore
#0 lore raw

Hello,

Before I make a needless hack, please correct me if I'm wrong: in arch/microblaze/kernel/dma.c, the sync_single_for_cpu, sync_single_for_device and friends are not set in the dma_direct_ops structure (and not implemented), so calls from drivers to the corresponding functions will do nothing. Since the Microblaze cache doesn't update automatically on DMA operations, this looks like a bug to me: The driver thinks the cache has been flushed or updated, but it actually hasn't.

Map and unmap methods are indeed implemented and registered, and they both call an internal function to sync the cache. So why are there no sync functions?

To hack or not to hack?

Eli

Signature · 1 line
Web: http://www.billauer.co.il
#1 lore raw
Quoted 8 lines · Eli Billauer

Hello,

Before I make a needless hack, please correct me if I'm wrong: in arch/microblaze/kernel/dma.c, the sync_single_for_cpu, sync_single_for_device and friends are not set in the dma_direct_ops structure (and not implemented), so calls from drivers to the corresponding functions will do nothing. Since the Microblaze cache doesn't update automatically on DMA operations, this looks like a bug to me: The driver thinks the cache has been flushed or updated, but it actually hasn't.

Map and unmap methods are indeed implemented and registered, and they both call an internal function to sync the cache. So why are there no sync functions?

It is not the bug just unimplemented feature and I haven't had any problem that these functions are not implemented.
Implementation should be pretty straight forward. Patches welcomed.

Thanks,
Michal

Signature · 3 lines
Michal Simek, Ing. (M.Eng)
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663