Hello Eun Seok, Kim,
btw, what is the polite way to greet you? Is Kim you first name?
Thank you for elaborating in more detail your modifications of the 'sd_card_bench' program. Given those information, I was able to reproduce the problem. It turns out that it is actually unrelated to the SD-card driver code or DMA for that matter. I reduced the test case to a much smaller program that does not even touches any devices:
1d7eeb00f6a89fb25159280133cf0f439a3a9390
This program produces the same artifacts as you observed. Here are the things that I noted:
* The artifacts always appear at page boundaries, which suggests that the weird behavior may somehow be related to page-fault handling. This hypothesis is further supported by the little experiment of performing the memset + hexdump twice. The first time, the artifacts are visible but the second time, everything looks ok.
I also did another experiment. To prevent page faults to occur during the 'memset' operation, I added a bit of code that touches each page of the buffer and thereby pages-in the corresponding page. With this eager page-fault handling in place, the artifacts disappear. You may try this out by removing 'if (0)'.
* The artifacts occur only when setting the 'cached' attribute of the 'Attached_ram_dataspace' to false (as it should be for DMA buffers). When allocating a RAM dataspace with the cached attribute set, the artifacts disappear.
* The problem does occur on the Pandaboard but not on Qemu (pbxa9), which is typical for cache-related problems.
I am quite puzzled about the possible reason for the observed artifacts. It seems to be a weird interplay between cache attributes and page-fault handling on the ARMv7 platform.
I opened an new topic at our issue tracker:
https://github.com/genodelabs/genode/issues/452
Would to mind taking the further discussion of this issue to there?
Best regards Norman