Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Keith Busch <kbusch@kernel.org>
Cc: Hariprasad Shenai <hariprasad@chelsio.com>,
	bhelgaas@google.com, linux-pci@vger.kernel.org,
	leedom@chelsio.com, nirranjan@chelsio.com
Subject: Re: [PATCH] pci: Add pci quirk to turnoff Nosnoop and Relaxed Ordering
Date: Wed, 1 Sep 2021 18:35:43 -0500	[thread overview]
Message-ID: <20210901233543.GA260178@bjorn-Precision-5520> (raw)
In-Reply-To: <20210901232212.GA7334@dhcp-10-100-145-180.wdc.com>

On Wed, Sep 01, 2021 at 04:22:12PM -0700, Keith Busch wrote:
> On Wed, Sep 01, 2021 at 05:23:53PM -0500, Bjorn Helgaas wrote:
> > On Sun, Oct 18, 2015 at 07:55:04PM +0530, Hariprasad Shenai wrote:
> > > Some devices violate the PCI Specification regarding echoing the Root
> > > Port Transaction Layer Packet Request (TLP) No Snoop and Relaxed
> > > Ordering Attributes into the TLP Response. The PCI Specification
> > > "encourages" compliant Root Port implementation to drop such
> > > malformed TLP Responses leading to device access timeouts. Many Root Port
> > > implementations accept such malformed TLP Responses and a few more
> > > strict implementations do drop them.
> > > 
> > > For devices which fail this part of the PCI Specification, we need to
> > > traverse up the PCI Chain to the Root Port and turn off the Enable No
> > > Snoop and Enable Relaxed Ordering bits in the Root Port's PCI-Express
> > > Device Control register. This does affect all other devices which
> > > are downstream of that Root Port.
> > 
> > While researching another thread about RO [1], I got concerned about
> > setting RO for root ports.
> > 
> > Setting RO for *endpoints* makes sense: that allows (but does not
> > require) the endpoint to issue writes that don't require strong
> > ordering.
> > 
> > Setting RO for *root ports* seems more problematic.  It allows the
> > root port to issue PCIe writes that don't require strong ordering.
> > These would be CPU MMIO writes to devices.  But Linux currently does
> > not have a way for drivers to indicate that some MMIO writes need to
> > be ordered while others do not, and I think drivers assume that all
> > MMIO writes are performed in order.
> 
> Is that not what writel_relaxed() is for? While it appears that most
> archs just have that call the generic writel(), it does let drivers
> indicate which writes are not strongly ordered.

Sheesh, I hate when I spend a whole afternoon making a fool of myself.

I was thinking just from the PCI core perspective, expecting a
separate window or something for relaxed ordering, but I'm sure
writel_relaxed() could be implemented using different CPU bus
transactions that the Root Complex knows how to interpret, and that
would be essentially invisible to the PCI core.

Sorry for the noise and thanks for the hint :)

      reply	other threads:[~2021-09-01 23:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-18 14:25 [PATCH] pci: Add pci quirk to turnoff Nosnoop and Relaxed Ordering Hariprasad Shenai
2015-10-22 22:13 ` Bjorn Helgaas
2015-10-23  0:07   ` Casey Leedom
2015-10-23  3:01     ` Bjorn Helgaas
2021-09-01 22:23 ` Bjorn Helgaas
2021-09-01 23:22   ` Keith Busch
2021-09-01 23:35     ` Bjorn Helgaas [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=20210901233543.GA260178@bjorn-Precision-5520 \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=hariprasad@chelsio.com \
    --cc=kbusch@kernel.org \
    --cc=leedom@chelsio.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=nirranjan@chelsio.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