linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Luis R. Rodriguez" <mcgrof@suse.com>
Cc: "Casey Leedom" <leedom@chelsio.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Toshi Kani" <toshi.kani@hp.com>,
	"Andy Lutomirski" <luto@amacapital.net>,
	"Juergen Gross" <jgross@suse.com>,
	"Tomi Valkeinen" <tomi.valkeinen@ti.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	linux-fbdev <linux-fbdev@vger.kernel.org>,
	"Suresh Siddha" <sbsiddha@gmail.com>,
	"Ingo Molnar" <mingo@elte.hu>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	"Dave Airlie" <airlied@redhat.com>,
	"Antonino Daplas" <adaplas@gmail.com>,
	"Jean-Christophe Plagniol-Villard" <plagnioj@jcrosoft.com>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"venkatesh.pallipadi@intel.com" <venkatesh.pallipadi@intel.com>,
	"Stefan Bader" <stefan.bader@canonical.com>,
	"ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>,
	"David Vrabel" <david.vrabel@citrix.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants
Date: Fri, 03 Jul 2015 08:26:27 +1000	[thread overview]
Message-ID: <1435875987.1475.73.camel@kernel.crashing.org> (raw)
In-Reply-To: <20150702184904.GA7021@wotan.suse.de>

On Thu, 2015-07-02 at 20:49 +0200, Luis R. Rodriguez wrote:
> > The question then is what is "the right thing". In the powerpc case,
> > we'll have a non-garded mapping, which means we also get no ordering
> > between load and stores.
> 
> I don't follow, you *ordering* between load and stores for WC? We should
> not need that for WC, its why WC is used for only very specific things
> such as framebuffer and PIO (which BTw I still don't quite get all this
> use case for infiniband to be honest, and I will note I do see some
> proprietary hardware extensions like bursts but nothing covering all
> this in a general doc, I think I think it all just has to do that this
> is a hardware hack in reality, which we sell as a feature).

Well, that's the problem, the semantics that we provide to drivers
aren't well defined.

The words "write combine" themselves only specify that writes to subsequent
addresses can be combined into larger transactions. That's in itself is already
quite vague (are their boundaries, limits ? some can depend on bus type, etc...)
though in practice is probably sufficient.

However, overloading a _wc mapping with additional memory model differences
such as loss of ordering between load and stores, etc... is not an obvious
thing to do. I agree it would make *my* life easier if we did it since this
is precisely the semantics provided by a "G=0" mapping on ppc, but we need
to agree and *document* it, otherwise bad things will happen eventually.

We also need to document in that case which barriers can be used to explicitly
enforce the ordering on such a mapping and which barriers can be used to break
write combine (they don't necessarily have to be the same).

We also need to document which accessors will actually provide the write combine
"feature" of a _wc mapping. For example while writel() will do it on Intel, it
will not on ppc and I wouldn't be surprised if a bunch of other archs fall in
the same bucket as ppc (basically anything that has barriers in their writel
implementation to order vs. DMA etc...).

So we might need to explicitly document that writel_relaxed() needs to be used.

Finally what are the precise guaranteed semantics of writeX/readX,
writeX_relaxed/readX_relaxed and __raw_ (everything else) on a _wc mapping, what
do we mandate and document, what do we leave to be implementation dependent ?

Cheers,
Ben.



  reply	other threads:[~2015-07-02 22:28 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-19 22:08 [PATCH v7 0/9] pci: add pci_iomap_wc() and pci_ioremap_wc_bar() Luis R. Rodriguez
2015-06-19 22:08 ` [PATCH v7 1/9] pci: add pci_ioremap_wc_bar() Luis R. Rodriguez
2015-06-19 22:08 ` [PATCH v7 2/9] video: fbdev: i740fb: use arch_phys_wc_add() and pci_ioremap_wc_bar() Luis R. Rodriguez
2015-06-19 22:08 ` [PATCH v7 3/9] video: fbdev: kyrofb: " Luis R. Rodriguez
2015-06-19 22:08 ` [PATCH v7 4/9] video: fbdev: gxt4500: use pci_ioremap_wc_bar() for framebuffer Luis R. Rodriguez
2015-06-19 22:08 ` [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants Luis R. Rodriguez
2015-06-23 22:42   ` Benjamin Herrenschmidt
2015-06-24 16:38     ` Luis R. Rodriguez
2015-06-24 22:05       ` Benjamin Herrenschmidt
2015-06-24 22:29         ` Luis R. Rodriguez
2015-06-24 23:38           ` Benjamin Herrenschmidt
2015-06-25  0:08             ` Luis R. Rodriguez
2015-06-25  0:52               ` Benjamin Herrenschmidt
2015-06-25  0:58                 ` [Xen-devel] " Luis R. Rodriguez
2015-06-25  1:12                   ` Benjamin Herrenschmidt
2015-06-25 15:01             ` Casey Leedom
2015-06-25 20:44               ` Arnd Bergmann
2015-06-25 21:40                 ` Casey Leedom
2015-06-25 22:51                   ` Benjamin Herrenschmidt
2015-06-26 19:31                     ` Luis R. Rodriguez
2015-06-26 22:04                       ` Benjamin Herrenschmidt
     [not found]                         ` <CAB=NE6XwczF6FYXV=RHyK=7ikVk_tGp+h9ouWPyORNENq4+=Kw@mail.gmail.com>
2015-06-26 23:54                           ` [Xen-devel] " Benjamin Herrenschmidt
2015-06-27  1:16                             ` Luis R. Rodriguez
2015-06-26  2:02                   ` Benjamin Herrenschmidt
2015-06-26 16:24                     ` Casey Leedom
2015-06-26 22:00                       ` Benjamin Herrenschmidt
2015-07-02 18:49                         ` Luis R. Rodriguez
2015-07-02 22:26                           ` Benjamin Herrenschmidt [this message]
2015-07-03  0:14                           ` Casey Leedom
2015-06-19 22:08 ` [PATCH v7 6/9] lib: devres: add pcim_iomap_wc() variants Luis R. Rodriguez
2015-06-19 22:08 ` [PATCH v7 7/9] video: fbdev: arkfb: use arch_phys_wc_add() and pci_iomap_wc() Luis R. Rodriguez
2015-06-19 22:08 ` [PATCH v7 8/9] video: fbdev: s3fb: " Luis R. Rodriguez
2015-06-19 22:08 ` [PATCH v7 9/9] video: fbdev: vt8623fb: " Luis R. Rodriguez
2015-06-23 10:53 ` [PATCH v7 0/9] pci: add pci_iomap_wc() and pci_ioremap_wc_bar() Arnd Bergmann

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=1435875987.1475.73.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=adaplas@gmail.com \
    --cc=airlied@redhat.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dave.hansen@linux.intel.com \
    --cc=david.vrabel@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=leedom@chelsio.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mcgrof@suse.com \
    --cc=mingo@elte.hu \
    --cc=mst@redhat.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=roger.pau@citrix.com \
    --cc=sbsiddha@gmail.com \
    --cc=stefan.bader@canonical.com \
    --cc=tglx@linutronix.de \
    --cc=tomi.valkeinen@ti.com \
    --cc=toshi.kani@hp.com \
    --cc=venkatesh.pallipadi@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    --cc=xen-devel@lists.xensource.com \
    /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).