Kernel Newbies archive mirror
 help / color / mirror / Atom feed
From: 김찬 <ckim@etri.re.kr>
To: kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Translation fault while using mmu-600 (only when dma alloc is done during application on the fly)
Date: Fri, 22 Mar 2024 18:17:09 +0900 (KST)	[thread overview]
Message-ID: <slpdh2s70909.slpdh2s2icp8.g1@dooray.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1458 bytes --]


Hello all,&nbsp;These several days we are having a difficulty in our linux device driver development.&nbsp;

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).
&nbsp;
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).
&nbsp;
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?

Thank you,
Best regards,Chan Kim


[-- Attachment #1.2: Type: text/html, Size: 6410 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

                 reply	other threads:[~2024-03-22  9:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=slpdh2s70909.slpdh2s2icp8.g1@dooray.com \
    --to=ckim@etri.re.kr \
    --cc=kernelnewbies@kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).