linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* DMA mappings cannot be used by the device in a resume handler
@ 2019-08-29 20:43 Paul Pawlowski
  0 siblings, 0 replies; only message in thread
From: Paul Pawlowski @ 2019-08-29 20:43 UTC (permalink / raw)
  To: linux-mm

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-29 20:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-29 20:43 DMA mappings cannot be used by the device in a resume handler Paul Pawlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox