Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status? #1

Open
hgomersall opened this issue Nov 20, 2015 · 3 comments
Open

Status? #1

hgomersall opened this issue Nov 20, 2015 · 3 comments

Comments

@hgomersall
Copy link

At risk of abusing the issues system, I'm curious to know what the current status is of this driver.

I too would very much like to have such a device driver for pushing data from user-space over DMA. Have you made any more attempts to get it added to the mainline kernel tree?

Cheers,
Henry

@jeremytrimble
Copy link
Owner

Henry,

I started a preliminary discussion on the dmaengine kernel mailing list [1], but the dmaengine subsystem maintainer seemed unreceptive to the concept.

In other discussions, it was suggested that perhaps I could reimagine ezdma as an addition to the "uio" (userspace I/O) interface in the kernel, though I haven't had time to really pursue this.

That said, a few other folks have contacted me about using ezdma in their projects and may be doing so as we speak. I'd be interested in hearing how you might want to use it, and/or glad to take pull requests or answer questions if I'm able.

[1] http://www.spinics.net/lists/dmaengine/msg04599.html

@hgomersall
Copy link
Author

Hi Jeremy,

Yeah, it was that thread that prompted the question. Was the uio stuff discussed offline, or do you have a reference for that? I too am thinking along exactly these lines - how best to access DMAd hardware from userspace. Clearly with something like a Zynq there is any number of weird and wonderful hardware widgets that can be created for which no subsystem yet exists. I don't know what the correct method for handling this is, but uio seems to be a plausible route.

@jeremytrimble
Copy link
Owner

Henry,

Sorry for the delay -- this fell off my radar for a bit.

Pasting from my IRC logs in #kernelnewbies on OFTC:

2015-06-18 14:05:54 jtrimble    imMute: you might want to check out: https://github.com/jeremytrimble/ezdma
2015-06-18 14:06:07 jtrimble    (disclaimer, I wrote it) :-)
2015-06-18 14:07:06 jtrimble    the way I handle that is calling dmaengine_terminate_all() in my release()
2015-06-18 14:13:27 derRichard  jtrimble: why didn't you add dma support do uio?
2015-06-18 14:14:16 imMute      ah, I should also note that I'm not using any of the built-in DMA channel stuff (existing code, didn't know about them, $more_excuses)
2015-06-18 14:18:47 jtrimble    derRichard: i guess i didn't know i could
2015-06-18 14:19:46 jtrimble    i've started a conversation about adding ezdma to the mainline, but the dmaengine maintainer's taken some issue with it -- do you think that the functionality implemented in ezdma maybe belongs in uio instead?
2015-06-18 14:20:41 derRichard  yes. your driver is an ad hoc uio.
2015-06-18 14:21:13 derRichard  we have uio for exactly that reason. to stop these (often horrible) ad hoc character drivers which implement mmap()
2015-06-18 14:22:34 derRichard  jtrimble: also see vfio
2015-06-18 14:24:41 jtrimble    derRichard: ah ok.  ezdma doesn't implement mmap() though, it uses a blocking read()/write() (and dma_map()s the userspace pages directly during those calls)
2015-06-18 14:25:18 derRichard  jtrimble: yeah, i see. but it's just a minor implementation detail
2015-06-18 14:27:17 jtrimble    derRichard:  are you saying i basically re-implemented something that could have been done with uio, or do you think that it's something I should try to add to uio?
2015-06-18 14:29:30 derRichard  the latter
2015-06-18 14:29:37 derRichard  currently uio has no dma support
2015-06-18 14:29:47 derRichard  vfio would work, but it depends on iommu
2015-06-18 14:31:52 jtrimble    derRichard:  ok, cool.  i'll look into it
2015-06-18 14:41:10 derRichard  jtrimble: adding dma to uio isn't that hard
2015-06-18 14:41:32 derRichard  but there are many dma "modes". device->device, device->mem, mem->mem, etc...
2015-06-18 14:41:45 derRichard  you'd have to find a way which models all
2015-06-18 14:44:56 jtrimble    derRichard: hmm yes.  ezdma currently supports device->mem and mem->device.  i'll think about how to incorporate the others
2015-06-18 14:45:36 jtrimble    i've started a conversation on the dmaengine mailing list about adding ezdma as-is there, but the maintainer seems less than thrilled (though I haven't submitted the patch yet as I want to re-test)
2015-06-18 14:45:48 jtrimble    but i have gotten word from a few folks that they're using it in their projects
2015-06-18 14:45:58 jtrimble    maybe uio is where this functionality ultimately belongs
2015-06-18 14:46:04 derRichard  jtrimble: TBH, i'm also not thrilled. it is an ad hoc solution and nothing generic
2015-06-18 14:48:39 jtrimble    derRichard: that's fair.  i've been writing (out-of-tree, probably disgusting) drivers for a while but still have a lot to learn, especially about the mainline kernel design philosophies
2015-06-18 14:51:09 jtrimble    i'd like to find a way to contribute this to the mainline though, as this is the kind of thing that comes up quite often in my field and it would be great to "give back" to the open-source world that's given me so much
2015-06-18 14:51:36 jtrimble    so i'll definitely start thinking about how it could fit into uio

... so much optimism. And then my life took over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants