Arm Community
Site
Search
User
Site
Search
User
Support forums
Arm Development Studio forum
The difference between DSB and DMB instructions of ARM1176JZF-S
Jump...
Cancel
Locked
Locked
Replies
5 replies
Subscribers
119 subscribers
Views
8674 views
Users
0 members are here
Options
Share
More actions
Cancel
Related
How was your experience today?
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
The difference between DSB and DMB instructions of ARM1176JZF-S
Vincent Wu
over 12 years ago
Note: This was originally posted on 30th September 2011 at
http://forums.arm.com
Dear Sirs,
I am currently testing a comstomized SOC with ARM1176JZF-S core, 32KB-cache on Linux-2.6.31.2, and I encountered a cache-DMA data coherence problem in SD host driver. The phenonmenon is random data error while file copying. The error occurs once or twice during 100 iterations of 1GB-file copying test.
The implementation of the DMA operation has followed the suggestion of the kernel document "DMA-API.txt", that is, the DMA_TO_DEVICE synchronisation is done after the last modification of the memory region that will be read by the DMA device, and the DMA_FROM_DEVICE synchronisation is done before the driver accesses data that was changed by the DMA device. However, the data coherence still cannot be guaranteed.
I referred to an ARM technical support knowledge article at
http://infocenter.ar...qs/ka14041.html
. For the ARMv6\v7 speculative execution, the DSB and DMB instructions are necessary to ensure data access correctness. The Linux ARMv6 cache operation has utlized DSB instruction, "mcr p15, 0, r0, c7, c10, 4" in the kernel source file, "linux-2.6.31.2/arch/arm/mm/cache-v6.S" to handle the speculative execution issue, but that cannot fix the stale data problem in my case.
Finally, I added a DMB instruction, "mcr p15, 0, r0, c7, c10, 5" after each cache invalidation and clean operation, and then the data error problem does not occur anymore. But I am still not sure if my modification is reasonable. I have some questions about the DSB and DMB instructions as listed below:
1. The Linux kernel utilizes DSB instruction only. Is the DSB instruction sufficient for ensuring the cache coherence?
2. If the DSB instruction is sufficient, why is the stale data still written into the SD card until I added a DMB instruction after the cache invalidation and clean operation?
3. Although the ARM technical article has described the functions of DSB and DMB instructions, I still cannot tell the critical difference between the two instructions. Could anyone explain?
Thanks for helping me!!
Parents
Peter Harris
over 12 years ago
Note: This was originally posted on 6th October 2011 at
http://forums.arm.com
No problem; glad of be of some help.
Thanks for posting the link to the patch; I wasn't aware of that one =)
Iso
Cancel
Vote up
0
Vote down
Cancel
Reply
Peter Harris
over 12 years ago
Note: This was originally posted on 6th October 2011 at
http://forums.arm.com
No problem; glad of be of some help.
Thanks for posting the link to the patch; I wasn't aware of that one =)
Iso
Cancel
Vote up
0
Vote down
Cancel
Children
No data