<div style="font-family: system-ui; font-size: 14px"><div><br></div><div><span style="color: rgb(51, 62, 72); font-family: Lato; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre-line; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">Hello all, </span><br><span style="color: rgb(51, 62, 72); font-family: Lato; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre-line; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">These several days we are having a difficulty in our linux device driver development. </span></div><div><span style="color: rgb(51, 62, 72); font-family: Lato; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre-line; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">
case A ) Here we allocate the dma buffer for our accelerator device during the device driver(a platform driver) initialization and we don't have problem. That is, we use kmalloc + dma_map_single during the driver initialization and after the boot is complete, we run the application which uses the driver. During the application, the driver just calls dma_sync_single_for_device function and our accelerator device actually access the dma buffer with no problem. (no translation fault).</span></div><div><span style="color: rgb(51, 62, 72); font-family: Lato; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre-line; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">
case B) Here we allocate the dma buffer for our accelerator device while the application runs after the boot (the buffer is not allocated during the drive initialization). While the application runs, the driver does the kmalloc + dma_map_single + dma_sync_single_for_device and then when then device accesses the dma buffer, we see translation fault. By printing the SMMU event data, we know it's for data read access, and the class is 'b10 which is 'Input address caused fault'. and it is from the first stage (S2=0).</span></div><div><span style="color: rgb(51, 62, 72); font-family: Lato; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre-line; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">
We know that the SMMU reads STE, CD and 3 entries of translation table. (we use 48bit address). Can we know in what stage of this 5 stages the fault arose? By the way the io virtual address starts with 0x7ffff~ (48bit) in both cases. Could anyone suggest us what information to look into now?</span>
</div><div><br><span style="color: rgb(51, 62, 72); font-family: Lato; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre-line; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">Thank you,</span></div><div><span style="color: rgb(51, 62, 72); font-family: Lato; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre-line; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">Best regards,</span><br><span style="color: rgb(51, 62, 72); font-family: Lato; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre-line; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">Chan Kim</span><br><br></div><!-- begin signature --><!-- end signature --></div><!--[if mso]>
<table style ="display:none"><tr><td><img src="https://gov-dooray.com/mail-receipts?img=774c574858424d62-255f27fe448b7697-343f20f4218ba2cc-343f225956971940.gif" border="0"></td></tr></table>
<![endif]-->
<!--[if !mso]><!-- -->
<table style ="visibility: hidden;"><tr><td><img src="https://gov-dooray.com/mail-receipts?img=774c574858424d62-255f27fe448b7697-343f20f4218ba2cc-343f225956971940.gif" border="0"></td></tr></table>
<!--[endif]-->