Barry Grussling | 3 Aug 17:28 2015

Failure to HotPlug if devices not present at boot - no memory space

Hello,

I am having some issues with PCIe hotplug on Linux.  Bottom
line is if PCIe endpoints are present and enabled on boot,
things work fine.  I can disable/enable endpoints and rescan
the PCI chain great and everything is found and loaded.

If PCIe endpoints are not present on boot and instead
are added later, I get "no space" and "failed to assign"
when I try to rescan the PCIe bus.

Booting with pci=realloc=on seems to have no effect.

I have verified I have CONFIG_PCI_REALLOC_ENABLE_AUTO=y
and CONFIG_PCI_IOV=y in my config.

The root complex is an ARM Cortex A9 SoC.  There is
a PLX PEX 8619 16-lane PCIe switch chip hooked up to
the root complex of the SoC.

Here is the enumeration from a device when all the PCIe
endpoints are present and enabled when the SoC boots:
pci 0000:00:00.0: BAR 8: assigned [mem 0xc0000000-0xc7dfffff]
pci 0000:01:00.0: BAR 8: assigned [mem 0xc0000000-0xc7bfffff]
pci 0000:01:00.0: BAR 0: assigned [mem 0xc7c00000-0xc7c1ffff]
pci 0000:01:00.1: BAR 0: assigned [mem 0xc7c20000-0xc7c3ffff]
pci 0000:02:00.0: BAR 8: assigned [mem 0xc0000000-0xc27fffff]
pci 0000:02:02.0: BAR 8: assigned [mem 0xc2800000-0xc4ffffff]
pci 0000:02:0f.0: BAR 8: assigned [mem 0xc5000000-0xc77fffff]
pci 0000:02:03.0: BAR 8: assigned [mem 0xc7800000-0xc78fffff]
(Continue reading)

Adam Lee | 3 Aug 06:33 2015

[PATCH 1/2] pci_ids: Add Pericom vendor and device ids

This patch add Pericom's vendor id and Pericom PI7C9X795[1248] chips'
device ids.

Signed-off-by: Adam Lee <adam.lee <at> canonical.com>
---
 include/linux/pci_ids.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index fcff8f8..c4a93cf 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
 <at>  <at>  -2995,4 +2995,10  <at>  <at> 

 #define PCI_VENDOR_ID_OCZ		0x1b85

+#define PCI_VENDOR_ID_PERICOM			0x12D8
+#define PCI_DEVICE_ID_PERICOM_PI7C9X7951	0x7951
+#define PCI_DEVICE_ID_PERICOM_PI7C9X7952	0x7952
+#define PCI_DEVICE_ID_PERICOM_PI7C9X7954	0x7954
+#define PCI_DEVICE_ID_PERICOM_PI7C9X7958	0x7958
+
 #endif /* _LINUX_PCI_IDS_H */
--

-- 
2.5.0

Kishon Vijay Abraham I | 31 Jul 14:25 2015
Picon

[PATCH v5 0/3] dra7xx: Add PM support to PCIe

This series adds PM support to pci-dra7xx so that PCI clocks can be disabled
during suspend and enabled back during resume without affecting
PCI functionality.

Changes from v4:
*) Fixed a bug caused by sending incomplete patch.

Changes from v3:
*) Fix compilation errors when individual patches are applied

Changes from v2:
*) Used SET_SYSTEM_SLEEP_PM_OPS and SET_NOIRQ_SYSTEM_SLEEP_PM_OPS for
   populating PM ops.

Changes from v1:
*) Moved resetting and setting of MSE bit to pci-dra7xx.

The comment to reset and set ISE is not done now since I don't have a card
with IO space. Once I get to test that, I'll post a separate patch for
handling that.

Kishon Vijay Abraham I (3):
  PCI: host: pci-dra7xx: Disable pm_runtime on get_sync failure
  PCI: host: pci-dra7xx: add pm support to pci dra7xx
  PCI: host: pci-dra7xx: Idle the module by disabling MSE bit

 drivers/pci/host/pci-dra7xx.c |   95 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 94 insertions(+), 1 deletion(-)

--

-- 
(Continue reading)

Guenter Roeck | 31 Jul 04:15 2015
Picon

[PATCH v3] PCI: Only enable IO window if supported

The PCI subsystem always assumes that I/O is supported on PCIe bridges
and tries to assign an I/O window to each child bus even if that is not
the case.

This may result in messages such as:

  pcieport 0000:02:00.0: res[7]=[io  0x1000-0x0fff] get_res_add_size add_size 1000
  pcieport 0000:02:00.0: BAR 7: no space for [io  size 0x1000]
  pcieport 0000:02:00.0: BAR 7: failed to assign [io  size 0x1000]

for each bridge port, even if a bus or its parent does not support I/O in
the first place.

To avoid this message, check if a bus supports I/O before trying to enable
it.  Also check if the root bus has an IO window assigned; if not, it does
not make sense to try to assign one to any of its child busses.

Cc: Lorenzo Pieralisi <lorenzo.pieralisi <at> arm.com>
Cc: Yinghai Lu <yinghai <at> kernel.org>
Signed-off-by: Guenter Roeck <linux <at> roeck-us.net>
---
v3: Reverse order of new flag, and name it PCI_BUS_FLAGS_SUPPORTS_IO
    instead of PCI_BUS_FLAGS_NO_IO.
    Don't use bool in pci_bridge_supports_io.
    Drop pci_root_has_io_resource(). Instead, determine if the root bus
    has an io window in pci_create_root_bus(), and clear
    PCI_BUS_FLAGS_SUPPORTS_IO in its bus flags if it doesn't.

v2: Use a new bus flag to indicate if IO is supported on a bus or not.
    Using IORESOURCE_DISABLED in resource flags turned out to be futile,
(Continue reading)

Lorenzo Pieralisi | 30 Jul 15:13 2015

[PATCH] ARM64: PCI: do not enable resources on PROBE_ONLY systems

On ARM64 PROBE_ONLY PCI systems resources are not currently claimed,
therefore they can't be enabled since they do not have a valid
parent pointer; this in turn prevents enabling PCI devices on
ARM64 PROBE_ONLY systems, causing PCI devices initialization to
fail.

To solve this issue, resources must be claimed when devices are
added on PROBE_ONLY systems, which ensures that the resource hierarchy
is validated and the resource tree is sane, but this requires changes
in the ARM64 resource management that can affect adversely existing
PCI set-ups (claiming resources on !PROBE_ONLY systems might break
existing ARM64 PCI platform implementations).

As a temporary solution in preparation for a proper resources claiming
implementation in ARM64 core, to enable PCI PROBE_ONLY systems on ARM64,
this patch adds a pcibios_enable_device() arch implementation that
simply prevents enabling resources on PROBE_ONLY systems (mirroring ARM
behaviour).

This is always a safe thing to do because on PROBE_ONLY systems the
configuration space set-up can be considered immutable, and it is in
preparation of proper resource claiming that would finally validate
the PCI resources tree in the ARM64 arch implementation on PROBE_ONLY
systems.

For !PROBE_ONLY systems resources enablement in pcibios_enable_device()
on ARM64 is implemented as in current PCI core, leaving the behaviour
unchanged.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi <at> arm.com>
(Continue reading)

Keith Busch | 30 Jul 00:18 2015
Picon

[PATCH 0/3] PCI-e Max Payload Size configuration

This patch series removes arch, driver, and hot-plug specific calls to
configure a PCI-e device's MPS setting. The device is instead configured
in the generic pci-core layer when the device is initially added, and
before it is bound to a driver.

The default policy is also changed from "do nothing" to update the
down stream port to match the upstream port if it is capable.

Dave Jiang (2):
  QIB: Removing usage of pcie_set_mps()
  PCIE: Remove symbol export for pcie_set_mps()

Keith Busch (1):
  pci: Default MPS tuning to match upstream port

 arch/arm/kernel/bios32.c             |   12 ------------
 arch/powerpc/kernel/pci-common.c     |    7 -------
 arch/tile/kernel/pci_gx.c            |    4 ----
 arch/x86/pci/acpi.c                  |    9 ---------
 drivers/infiniband/hw/qib/qib_pcie.c |   27 +--------------------------
 drivers/pci/bus.c                    |    4 ++++
 drivers/pci/hotplug/acpiphp_glue.c   |    1 -
 drivers/pci/hotplug/pciehp_pci.c     |    1 -
 drivers/pci/hotplug/shpchp_pci.c     |    1 -
 drivers/pci/pci.c                    |    1 -
 drivers/pci/probe.c                  |   22 ++++++++++++++++------
 include/linux/pci.h                  |    2 --
 12 files changed, 21 insertions(+), 70 deletions(-)

--

-- 
(Continue reading)

Jayachandran C | 29 Jul 17:28 2015

[PATCH v3 1/2] PCI: generic: remove dependency on hw_pci

The current code in pci-host-generic.c uses pci_common_init_dev()
from ARM platform to do some of the PCI initializations, and this
prevents it from being used in ARM64.

The initialization done by pci_common_init_dev() that is needed
by pci-host-generic.c is really limited, and can be done easily
in the same file without using hw_pci API. The ARM platform
requires a pci_sys_data as sysdata for the PCI bus, this can be
handled by setting up gen_pci to have a pci_sys_data variable as
the first element.

Signed-off-by: Jayachandran C <jchandra <at> broadcom.com>
---
Here's v3 of the patchset.

v2-v3
 - rebase to 4.2-rc
 - fix PCI_PROBE_ONLY check before calling pcie configure
 - added a comment above sysdata
 - updated the commit message

v1->v2
 - Address comments from Arnd Bergmann and Lorenzo Pieralisi
    - move contents of gen_pci_init to gen_pci_probe
    - assign resources only when !probe_only
 - tested on ARM32 with qemu option -M virt

Notes:
 - passing a zeroed out pci_sys_data for ARM looks ok, but I haven't
   tested it on ARM.
(Continue reading)

Lorenzo Pieralisi | 29 Jul 13:33 2015

[PATCH v4 1/2] ARM: PCI: bios32: replace panic with WARN messages on failures

In the ARM PCI bios32 layer, failures to dynamically allocate pci_sys_data
for a PCI bus, or a PCI bus scan failure have to be considered serious
warnings but they should not trigger a system panic so that at least the
system is given a chance to be debugged.

This patch replaces the panic statements with WARN() messages to
improve error reporting in the ARM PCI bios32 layer.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi <at> arm.com>
Acked-by: Marc Zyngier <marc.zyngier <at> arm.com>
Cc: Bjorn Helgaas <bhelgaas <at> google.com>
Cc: Russell King <linux <at> arm.linux.org.uk>
Cc: Marc Zyngier <marc.zyngier <at> arm.com>
---
 arch/arm/kernel/bios32.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index fcbbbb1..a5c782c 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
 <at>  <at>  -459,8 +459,8  <at>  <at>  static void pcibios_init_hw(struct device *parent, struct hw_pci *hw,

 	for (nr = busnr = 0; nr < hw->nr_controllers; nr++) {
 		sys = kzalloc(sizeof(struct pci_sys_data), GFP_KERNEL);
-		if (!sys)
-			panic("PCI: unable to allocate sys data!");
+		if (WARN(!sys, "PCI: unable to allocate sys data!"))
+			break;

(Continue reading)

Andreas Hartmann | 28 Jul 19:40 2015
Picon

AMD-Vi IO_PAGE_FAULTs and ata3.00: failed command: READ FPDMA QUEUED errors since Linux 4.0

Hello!

After long and heavy bisecting, I found this commit
"dm crypt: don't allocate pages for a partial request" [1] being the
cause of the ata errors and AMD-Vi IO_PAGE_FAULTs.

That's the bisect I did with Linus' repository
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/

git bisect start
# good: [3466b547e37b988723dc93465b7cb06b4b1f731f] Merge branches 'pnp',
'pm-cpuidle' and 'pm-cpufreq'
git bisect good 3466b547e37b988723dc93465b7cb06b4b1f731f
# bad: [cd50b70ccd5c87794ec28bfb87b7fba9961eb0ae] Merge tag
'pm+acpi-3.20-rc1-3' of
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
git bisect bad cd50b70ccd5c87794ec28bfb87b7fba9961eb0ae
# good: [27a22ee4c7d5839fd7e3e441c9d675c8a5c4c22c] Merge branch 'kbuild'
of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
git bisect good 27a22ee4c7d5839fd7e3e441c9d675c8a5c4c22c
# good: [c189cb8ef62832f33b6cf757350a0270532a1ad8] Merge tag
'vfio-v3.20-rc1' of git://github.com/awilliam/linux-vfio
git bisect good c189cb8ef62832f33b6cf757350a0270532a1ad8
# good: [295324556c427d60b41668ab81a43f604533f456] Merge branch
'i2c/for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
git bisect good 295324556c427d60b41668ab81a43f604533f456
# good: [1acd2de5facd7fbea499aea64a3a3d0ec7bb9b51] Merge branch
'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
git bisect good 1acd2de5facd7fbea499aea64a3a3d0ec7bb9b51
# good: [fde9f50f80fe89a9115b4bfa773017272597d85d] target: Add sanity
(Continue reading)

Kishon Vijay Abraham I | 28 Jul 15:54 2015
Picon

[PATCH v4 0/3] dra7xx: Add PM support to PCIe

This series adds PM support to pci-dra7xx so that PCI clocks can be disabled
during suspend and enabled back during resume without affecting
PCI functionality.

Changes from v3:
*) Fix compilation errors when individual patches are applied

Changes from v2:
*) Used SET_SYSTEM_SLEEP_PM_OPS and SET_NOIRQ_SYSTEM_SLEEP_PM_OPS for
   populating PM ops.

Changes from v1:
*) Moved resetting and setting of MSE bit to pci-dra7xx.

The comment to reset and set ISE is not done now since I don't have a card
with IO space. Once I get to test that, I'll post a separate patch for
handling that.

Kishon Vijay Abraham I (3):
  PCI: host: pci-dra7xx: Disable pm_runtime on get_sync failure
  PCI: host: pci-dra7xx: add pm support to pci dra7xx
  PCI: host: pci-dra7xx: Idle the module by disabling MSE bit

 drivers/pci/host/pci-dra7xx.c |   94 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 93 insertions(+), 1 deletion(-)

--

-- 
1.7.9.5

(Continue reading)

Marc Zyngier | 28 Jul 15:46 2015

[PATCH v6 00/19] Per-device MSI domain & platform MSI

MSI-like interrupts are starting to creep out of the PCI world, and
can now be seen into a number of "platform"-type busses. The
introduction of the MSI domains feature in v3.19 recognised that fact,
and started providing a way to implement this.

Another step in this direction is Jiang Liu's msi_desc series:

https://github.com/jiangliu/linux.git msi_desc_v1

which moves the msi_list from being specific to PCI devices into the
generic device structure.

A problem we have to solve is to identify which MSI domain a device is
"connected" to. Currently, PCI gets away with a mixture of
arch-specific callbacks, and a msi_controller structure that can
optionally carry a pointer to an MSI domain. As we add new bus types
and start dealing with topologies that do not map to what PCI does,
this doesn't scale anymore.

This patch series tries to address some of it by providing a basic
link between 'struct device' and an MSI domain. It also adds :

- a way to "tag" domains according to the "type" of interrupt it
  provides (PCI/MSI, platform MSI...), allowing a driver for a piece
  of HW identified by its device_node to provide several IRQ domains

- (yet another) way for PCI to propagate the domain pointer through
  the PCI device hierarchy, providing a method for OF to kick-start
  the propagation process, and finally allowing the PCI/MSI layer to
  use that information
(Continue reading)


Gmane