From: Paul Pawlowski <mrarmdev@gmail.com>
To: linux-mm@kvack.org
Subject: DMA mappings cannot be used by the device in a resume handler
Date: Thu, 29 Aug 2019 22:43:21 +0200 [thread overview]
Message-ID: <CAKSqxP8QYJx5k1FnN=v996eQNBvAZDNr-xXXPNmHj8KGuhtmyQ@mail.gmail.com> (raw)
Hello,
I have an issue where the device is unable to access the system DMA
memory mappings in a resume handler. This issue is mitigated by adding
a `msleep(20);` before sending a DMA address to the device.
The following is the call flow during my device's resume:
pci_enable_device -> pci_set_master -> msleep(20) which I want to get
rid of -> a write to the device's BAR region with a DMA address. The
DMA memory region is question is allocated using dma_alloc_coherent
(doesn't matter if the allocation took place before suspend or during
resume).
If I get rid of the `msleep(20)` the device fails to read the DMA'd
memory properly and crashes itself. The 20ms duration has been
selected empirically.
Are there any better possible solutions to this problem? As far as I
am aware the device lacks any sort of a 'ready' register.
The resume code in question if anyone wants to look at it:
https://github.com/MCMrARM/mbp2018-bridge-drv/blob/ba0df879c6b64a59ac12f8d6f763b3e39fab49a1/pci.c#L333
Thank you,
Paul Pawlowski
reply other threads:[~2019-08-29 20:43 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='CAKSqxP8QYJx5k1FnN=v996eQNBvAZDNr-xXXPNmHj8KGuhtmyQ@mail.gmail.com' \
--to=mrarmdev@gmail.com \
--cc=linux-mm@kvack.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