linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* DMA memory from block layer vs pci_alloc_consistent
@ 2018-12-27 21:31 Kieran Kunhya
  0 siblings, 0 replies; only message in thread
From: Kieran Kunhya @ 2018-12-27 21:31 UTC (permalink / raw)
  To: linux-block

Hello,

I’ve been reverse engineering Sony SxS memory cards, which are simple
PCIe based block devices. I am able to read successfully from the
device with DMA memory allocated using pci_alloc_consistent and
memcpying to the buffer the block device layer provides.

But if I use the dma_addr_t provided by the block device DMA layer, I
get a soft lockup. Is there something special about the dma_addr_t
that comes from the block layer? Is there anything I need to do to it
before passing it to the hardware.

The device’s block size is 2048, the block layer reads two blocks at a time.

Memcpy code is here:
https://github.com/kierank/sxs-linux/blob/master/sxs.c#L98

DMA code is here:
https://github.com/kierank/sxs-linux/blob/dma/sxs.c#L101

Apologies for the untidiness of the code, it’s entirely reverse engineered.
Any help would be appreciated.

Kieran

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

only message in thread, other threads:[~2018-12-27 21:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-27 21:31 DMA memory from block layer vs pci_alloc_consistent Kieran Kunhya

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 NNTP newsgroup(s).