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


Groups > linux.kernel > #1716842

Re: [PATCH v11 2/4] PCI: Factor out pci_bus_wait_crs()

From Bjorn Helgaas <helgaas@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v11 2/4] PCI: Factor out pci_bus_wait_crs()
Date 2017-08-21 22:30 +0200
Message-ID <uh1uG-Ac-23@gated-at.bofh.it> (permalink)
References <ufX9L-Un-3@gated-at.bofh.it> <ufX9M-Un-17@gated-at.bofh.it> <ugVpg-54m-7@gated-at.bofh.it> <uh0oV-8mG-7@gated-at.bofh.it> <uh0Ih-8tH-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Aug 21, 2017 at 03:37:06PM -0400, Sinan Kaya wrote:
> On 8/21/2017 3:18 PM, Bjorn Helgaas wrote:
> ...
> if (pci_bus_crs_pending(id))
> 	return pci_bus_wait_crs(dev->bus, dev->devfn, &id, 60000);
> 
> > I think that makes sense.  We'd want to check for CRS SV being
> > enabled, e.g., maybe read PCI_EXP_RTCTL_CRSSVE back in
> > pci_enable_crs() and cache it somewhere.  Maybe a crs_sv_enabled bit
> > in the root port's pci_dev, and check it with something like what
> > pcie_root_rcb_set() does?
> > 
> 
> You can observe CRS under the following conditions
> 
> 1. root port <-> endpoint 
> 2. bridge <-> endpoint 
> 3. root port<->bridge
> 
> I was relying on the fact that we are reading 0x001 as an indication that
> this device detected CRS. Maybe, this is too indirect.
> 
> If we also want to capture the capability, I think the right thing is to
> check the parent capability.
> 
> bool pci_bus_crs_vis_supported(struct pci_dev *bridge)
> {
> 	if (device type(bridge) == root port)
> 		return read(root_crs_register_reg);
> 
> 	if (device type(bridge) == switch)
> 		return read(switch_crs_register);

I don't understand this part.  AFAIK, CRS SV is only a feature of root
ports.  The capability and enable bits are in the Root Capabilities
and Root Control registers.

It's certainly true that a device below a switch can respond with a
CRS completion, but the switch is not the requester, and my
understanding is that it would not take any action on the completion
other than passing it upstream.

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


Thread

[PATCH v11 2/4] PCI: Factor out pci_bus_wait_crs() Bjorn Helgaas <bhelgaas@google.com> - 2017-08-18 23:40 +0200
  Re: [PATCH v11 2/4] PCI: Factor out pci_bus_wait_crs() Sinan Kaya <okaya@codeaurora.org> - 2017-08-21 16:00 +0200
    Re: [PATCH v11 2/4] PCI: Factor out pci_bus_wait_crs() Bjorn Helgaas <helgaas@kernel.org> - 2017-08-21 21:20 +0200
      Re: [PATCH v11 2/4] PCI: Factor out pci_bus_wait_crs() Sinan Kaya <okaya@codeaurora.org> - 2017-08-21 21:40 +0200
        Re: [PATCH v11 2/4] PCI: Factor out pci_bus_wait_crs() Bjorn Helgaas <helgaas@kernel.org> - 2017-08-21 22:30 +0200
          Re: [PATCH v11 2/4] PCI: Factor out pci_bus_wait_crs() Sinan Kaya <okaya@codeaurora.org> - 2017-08-21 22:40 +0200
            Re: [PATCH v11 2/4] PCI: Factor out pci_bus_wait_crs() Bjorn Helgaas <helgaas@kernel.org> - 2017-08-21 23:10 +0200
        Re: [PATCH v11 2/4] PCI: Factor out pci_bus_wait_crs() Sinan Kaya <okaya@codeaurora.org> - 2017-08-23 06:50 +0200

csiph-web