From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: pci: add support for pci_mmap_page_range
Date: Tue, 28 Jul 2015 15:41:33 +0100 [thread overview]
Message-ID: <20150728144132.GN29209@arm.com> (raw)
In-Reply-To: <20150728140347.GA9934@localhost.localdomain>
On Tue, Jul 28, 2015 at 03:03:52PM +0100, Jerin Jacob wrote:
> On Tue, Jul 28, 2015 at 12:20:57PM +0100, Will Deacon wrote:
> > On Mon, Jul 27, 2015 at 06:10:29AM +0100, Jerin Jacob wrote:
> > > On Fri, Jul 24, 2015 at 03:41:03PM +0100, Will Deacon wrote:
> > > > So pci_iomap_range chooses the memory attributes based on the BAR flags
> > > > (and even then it looks weird -- CACHEABLE => ioremap, else ioremap_nocache,
> > > > which is just the same as ioremap on arm64).
> > > >
> > > > It would be good to understand (a) why this is different and (b) what
> > >
> > > AFAIU, pci_iomap_range is the generic implementation and chooses to
> > > use only minimal attributes that works on all the architectures.
> > > The primary consumer of pci_iomap_range is virtio_pci driver,Which
> > > doesn't care about HW PCI memory attributes like Prefetchable.
> >
> > pci_iomap calls pci_iomap_range.
>
> Yes, I missed that.
>
> >
> > > > the consistent set of attributes should be.
> > >
> > > PCI perspective, memory attributes are Prefetchable and non-Prefetchable
> > > for a given BAR.
> > >
> > > Former one does have read side-effects or supports write
> > > merging(typically used
> > > by graphics memory) and latter one has read side effects and does not
> > > support write merging(typically used by register files)
> > >
> > > IMO, In armv8 nomenclature, MT_NORMAL_NC and MT_DEVICE_nGnRnE map
> > > correctly to above PCI memory attribute definitions.
> >
> > I agree with your choice of memory types (well, almost. We probably don't
> > need the nE), I'm just after some consistency within the kernel, because
>
> I thought so, However, Since PCIe deals with off-chip peripherals,
> IMO it should be MT_DEVICE_nGnRnE(strongly ordered).
> Early write acknowledgment may have side effect based on the topology.
> (connected under Bridge etc).
> IMO, It make sense to mark as nGnRE for on-chip peripherals. But
> If you still think we need to mark as nGnRE then I can submit v2 with
> nGnRE else IMO, currect patch is fine for pci_mmap_page_range
It's the inconsistencies that I've pointed out previously that bother
me the most. I don't really care what attributes we use, as long as
there's a common way to translate a given BAR to a given MT_*.
Will
prev parent reply other threads:[~2015-07-28 14:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-24 5:54 [PATCH] arm64: pci: add support for pci_mmap_page_range Jerin Jacob
2015-07-24 14:41 ` Will Deacon
2015-07-27 5:10 ` Jerin Jacob
2015-07-28 11:20 ` Will Deacon
2015-07-28 14:03 ` Jerin Jacob
2015-07-28 14:41 ` Will Deacon [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150728144132.GN29209@arm.com \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).