Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751411AbdILMhS (ORCPT ); Tue, 12 Sep 2017 08:37:18 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:32828 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751289AbdILMhR (ORCPT ); Tue, 12 Sep 2017 08:37:17 -0400 Date: Tue, 12 Sep 2017 05:37:16 -0700 From: "gregkh@linuxfoundation.org" To: Joakim Tjernlund Cc: "linux-kernel@vger.kernel.org" Subject: Re: uio_dmem_genirq.c and DMA mapping to user space ? Message-ID: <20170912123716.GA19626@kroah.com> References: <1505218705.31322.108.camel@infinera.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1505218705.31322.108.camel@infinera.com> User-Agent: Mutt/1.9.0 (2017-09-02) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 672 Lines: 20 On Tue, Sep 12, 2017 at 12:18:27PM +0000, Joakim Tjernlund wrote: > Hi > > I am trying to use the uio_dmem_genirq.c driver for allocating DMA memory to a PCI device > using the uio_pci_generic.c driver. > > I got as far as defining an UIO dev containing only Dynamic DMA memory and > now I am stuck. > I can see how DMA memory is allocated when opening the /dev/uio device but I cannot > figure out how to mmap this memory to User space as well so I can share this > memory with the PCI device and my user space driver. > > What am I missing? Why can't you call mmap() on the fd you created when you opened /dev/uio? What happens when you do that? thanks, greg k-h