Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1601600

Re: [PATCH 1/3] arm64: enable pci resource mapping using sysfs

From Mark Rutland <mark.rutland@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] arm64: enable pci resource mapping using sysfs
Date 2017-03-15 19:00 +0100
Message-ID <tllnj-2AP-3@gated-at.bofh.it> (permalink)
References <tlkUj-2lU-35@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

On Wed, Mar 15, 2017 at 05:17:46PM +0000, David Woodhouse wrote:
> From: Brijesh Singh <brijess@amazon.com>
> 
> To support pci resource mapping from userspace, pci_mmap_page_range
> implementation must be done for that platform. This support was
> broken for arm64.
> 
> This patch copies existing implementation from arm to
> enable sysfs mmap.

It's not so much "broken" as "not currently supported".

[...]

> +#define HAVE_PCI_MMAP
> +extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
> +			       enum pci_mmap_state mmap_state, int write_combine);
> +

Per the prior attempt at this [1], we only want to expose the sysfs
interface, and not the legacy procfs interface, and need the two
decoupled [2].

... or has something changed in the mean time, so that this only exposes
the sysfs interface?

[...]

> +int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
> +			enum pci_mmap_state mmap_state, int write_combine)
> +{
> +	if (mmap_state == pci_mmap_io)
> +		return -EINVAL;
> +
> +	if (write_combine)
> +		vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
> +	else
> +		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);

... as per Will's comment in [3], the latter of these should use
pgprot_device.

Thanks,
Mark.

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2016-April/421948.html
[2] http://lists.infradead.org/pipermail/linux-arm-kernel/2016-April/423083.html
[3] http://lists.infradead.org/pipermail/linux-arm-kernel/2016-April/422571.html

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] arm64: enable pci resource mapping using sysfs David Woodhouse <dwmw2@infradead.org> - 2017-03-15 18:30 +0100
  Re: [PATCH 1/3] arm64: enable pci resource mapping using sysfs Mark Rutland <mark.rutland@arm.com> - 2017-03-15 19:00 +0100
    Re: [PATCH 1/3] arm64: enable pci resource mapping using sysfs David Woodhouse <dwmw2@infradead.org> - 2017-03-15 20:20 +0100
      Re: [PATCH 1/3] arm64: enable pci resource mapping using sysfs David Woodhouse <dwmw2@infradead.org> - 2017-03-20 11:30 +0100
      Re: [PATCH 1/3] arm64: enable pci resource mapping using sysfs Will Deacon <will.deacon@arm.com> - 2017-03-20 11:30 +0100

csiph-web