<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/pci/pcie, branch linux-4.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-04-28T15:33:55Z</updated>
<entry>
<title>Merge branch 'pci/enumeration' into next</title>
<updated>2017-04-28T15:33:55Z</updated>
<author>
<name>Bjorn Helgaas</name>
</author>
<published>2017-04-28T15:33:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f503ee4cbef9c5459d9e176542e4d0e0ed3915f6'/>
<id>urn:sha1:f503ee4cbef9c5459d9e176542e4d0e0ed3915f6</id>
<content type='text'>
* pci/enumeration:
  PCI: Include PCI-to-PCIe bridges as "Downstream Ports"
  PCI: Improve __pci_read_base() robustness
  PCI: Short-circuit pci_device_is_present() for disconnected devices
  PCI/MSI: Skip disabling disconnected devices
  PCI: Don't attempt config access to disconnected devices
  PCI: Add device disconnected state
  PCI: Export PCI device config accessors
</content>
</entry>
<entry>
<title>PCI: Add device disconnected state</title>
<updated>2017-03-30T03:54:46Z</updated>
<author>
<name>Keith Busch</name>
</author>
<published>2017-03-30T03:48:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=89ee9f7680031d7df91a1a27abac69e034c2e892'/>
<id>urn:sha1:89ee9f7680031d7df91a1a27abac69e034c2e892</id>
<content type='text'>
Add a new state to pci_dev to be set when it is unexpectedly disconnected.
The PCI driver tear down functions can observe this new device state so
they may skip operations that will fail.

The pciehp and pcie-dpc drivers are aware when the link is down, so these
set the flag when their handlers detect the device is disconnected.

Tested-by: Krishna Dhulipala &lt;krishnad@fb.com&gt;
Signed-off-by: Keith Busch &lt;keith.busch@intel.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Wei Zhang &lt;wzhang@fb.com&gt;</content>
</entry>
<entry>
<title>PCI/ASPM: Always set link-&gt;downstream to avoid NULL dereference on remove</title>
<updated>2017-03-07T20:23:30Z</updated>
<author>
<name>Yinghai Lu</name>
</author>
<published>2017-03-01T08:25:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3bd7db63a841e8c5297bb18ad801df67d5e38ad2'/>
<id>urn:sha1:3bd7db63a841e8c5297bb18ad801df67d5e38ad2</id>
<content type='text'>
We call pcie_aspm_exit_link_state() when we remove a device.  If the device
is the last PCIe function to be removed below a bridge and the bridge has
an ASPM link_state struct, we disable ASPM on the link.  Disabling ASPM
requires link-&gt;downstream (used in pcie_config_aspm_link()).

We previously set link-&gt;downstream in pcie_aspm_cap_init(), but only if the
device was not blacklisted.  Removing the blacklisted device caused a NULL
pointer dereference in the pcie_aspm_exit_link_state() -&gt;
pcie_config_aspm_link() path:

  # echo 1 &gt; /sys/bus/pci/devices/0000\:0b\:00.0/remove
  ...
   BUG: unable to handle kernel NULL pointer dereference at 0000000000000080
   IP: pcie_config_aspm_link+0x5d/0x2b0
   Call Trace:
    pcie_aspm_exit_link_state+0x75/0x130
    pci_stop_bus_device+0xa4/0xb0
    pci_stop_and_remove_bus_device_locked+0x1a/0x30
    remove_store+0x50/0x70
    dev_attr_store+0x18/0x30
    sysfs_kf_write+0x44/0x60
    kernfs_fop_write+0x10e/0x190
    __vfs_write+0x28/0x110
    ? rcu_read_lock_sched_held+0x5d/0x80
    ? rcu_sync_lockdep_assert+0x2c/0x60
    ? __sb_start_write+0x173/0x1a0
    ? vfs_write+0xb3/0x180
    vfs_write+0xc4/0x180
    SyS_write+0x49/0xa0
    do_syscall_64+0xa6/0x1c0
    entry_SYSCALL64_slow_path+0x25/0x25
   ---[ end trace bd187ee0267df5d9 ]---

To avoid this, set link-&gt;downstream in alloc_pcie_link_state(), so every
pcie_link_state structure has a valid link-&gt;downstream pointer.

[bhelgaas: changelog]
Signed-off-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Acked-by: Rajat Jain &lt;rajatja@google.com&gt;
CC: stable@vger.kernel.org</content>
</entry>
<entry>
<title>Merge tag 'pci-v4.11-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci</title>
<updated>2017-02-23T19:53:22Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2017-02-23T19:53:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=60e8d3e11645a1b9c4197d9786df3894332c1685'/>
<id>urn:sha1:60e8d3e11645a1b9c4197d9786df3894332c1685</id>
<content type='text'>
Pull PCI updates from Bjorn Helgaas:

 - add ASPM L1 substate support

 - enable PCIe Extended Tags when supported

 - configure PCIe MPS settings on iProc, Versatile, X-Gene, and Xilinx

 - increase VPD access timeout

 - add ACS quirks for Intel Union Point, Qualcomm QDF2400 and QDF2432

 - use new pci_irq_alloc_vectors() in more drivers

 - fix MSI affinity memory leak

 - remove unused MSI interfaces and update documentation

 - remove unused AER .link_reset() callback

 - avoid pci_lock / p-&gt;pi_lock deadlock seen with perf

 - serialize sysfs enable/disable num_vfs operations

 - move DesignWare IP from drivers/pci/host/ to drivers/pci/dwc/ and
   refactor so we can support both hosts and endpoints

 - add DT ECAM-like support for HiSilicon Hip06/Hip07 controllers

 - add Rockchip system power management support

 - add Thunder-X cn81xx and cn83xx support

 - add Exynos 5440 PCIe PHY support

* tag 'pci-v4.11-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (93 commits)
  PCI: dwc: Remove dependency of designware on CONFIG_PCI
  PCI: dwc: Add CONFIG_PCIE_DW_HOST to enable PCI dwc host
  PCI: dwc: Split pcie-designware.c into host and core files
  PCI: dwc: designware: Fix style errors in pcie-designware.c
  PCI: dwc: designware: Parse "num-lanes" property in dw_pcie_setup_rc()
  PCI: dwc: all: Split struct pcie_port into host-only and core structures
  PCI: dwc: designware: Get device pointer at the start of dw_pcie_host_init()
  PCI: dwc: all: Rename cfg_read/cfg_write to read/write
  PCI: dwc: all: Use platform_set_drvdata() to save private data
  PCI: dwc: designware: Move register defines to designware header file
  PCI: dwc: Use PTR_ERR_OR_ZERO to simplify code
  PCI: dra7xx: Group PHY API invocations
  PCI: dra7xx: Enable MSI and legacy interrupts simultaneously
  PCI: dra7xx: Add support to force RC to work in GEN1 mode
  PCI: dra7xx: Simplify probe code with devm_gpiod_get_optional()
  PCI: Move DesignWare IP support to new drivers/pci/dwc/ directory
  PCI: exynos: Support the PHY generic framework
  Documentation: binding: Modify the exynos5440 PCIe binding
  phy: phy-exynos-pcie: Add support for Exynos PCIe PHY
  Documentation: samsung-phy: Add exynos-pcie-phy binding
  ...
</content>
</entry>
<entry>
<title>Merge branch 'pci/msi' into next</title>
<updated>2017-02-15T17:56:10Z</updated>
<author>
<name>Bjorn Helgaas</name>
</author>
<published>2017-02-15T17:56:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3ec2574e31b5aebeeed52ea784bb6d7960788202'/>
<id>urn:sha1:3ec2574e31b5aebeeed52ea784bb6d7960788202</id>
<content type='text'>
* pci/msi:
  PCI/MSI: Update MSI/MSI-X bits in PCIEBUS-HOWTO
  PCI/MSI: Document pci_alloc_irq_vectors(), deprecate pci_enable_msi()
  PCI/MSI: Return -ENOSPC if pci_enable_msi_range() can't get enough vectors
  PCI/portdrv: Use pci_irq_alloc_vectors()
  PCI/MSI: Check that we have a legacy interrupt line before using it
  PCI/MSI: Remove pci_msi_domain_{alloc,free}_irqs()
  PCI/MSI: Remove unused pci_msi_create_default_irq_domain()
  PCI/MSI: Return failure when msix_setup_entries() fails
  PCI/MSI: Remove pci_enable_msi_{exact,range}()
  amd-xgbe: Update PCI support to use new IRQ functions
  [media] cobalt: use pci_irq_allocate_vectors()
  PCI/MSI: Fix msi_capability_init() kernel-doc warnings
</content>
</entry>
<entry>
<title>Merge branch 'pci/dpc' into next</title>
<updated>2017-02-15T17:56:07Z</updated>
<author>
<name>Bjorn Helgaas</name>
</author>
<published>2017-02-15T17:56:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=af3a2ab5daa0b8bf188a039c122a670cdc8b9544'/>
<id>urn:sha1:af3a2ab5daa0b8bf188a039c122a670cdc8b9544</id>
<content type='text'>
* pci/dpc:
  PCI/DPC: Wait for Root Port busy to clear
  PCI/DPC: Decode extended reasons
</content>
</entry>
<entry>
<title>PCI/PME: Restore pcie_pme_driver.remove</title>
<updated>2017-02-15T15:39:32Z</updated>
<author>
<name>Yinghai Lu</name>
</author>
<published>2017-02-15T05:17:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=afe3e4d11bdf50a4c3965eb6465ba6bebbcf5dcf'/>
<id>urn:sha1:afe3e4d11bdf50a4c3965eb6465ba6bebbcf5dcf</id>
<content type='text'>
In addition to making PME non-modular, d7def2040077 ("PCI/PME: Make
explicitly non-modular") removed the pcie_pme_driver .remove() method,
pcie_pme_remove().

pcie_pme_remove() freed the PME IRQ that was requested in pci_pme_probe().
The fact that we don't free the IRQ after d7def2040077 causes the following
crash when removing a PCIe port device via /sys:

  ------------[ cut here ]------------
  kernel BUG at drivers/pci/msi.c:370!
  invalid opcode: 0000 [#1] SMP
  Modules linked in:
  CPU: 1 PID: 14509 Comm: sh Tainted: G    W  4.8.0-rc1-yh-00012-gd29438d
  RIP: 0010:[&lt;ffffffff9758bbf5&gt;]  free_msi_irqs+0x65/0x190
  ...
  Call Trace:
   [&lt;ffffffff9758cda4&gt;] pci_disable_msi+0x34/0x40
   [&lt;ffffffff97583817&gt;] cleanup_service_irqs+0x27/0x30
   [&lt;ffffffff97583e9a&gt;] pcie_port_device_remove+0x2a/0x40
   [&lt;ffffffff97584250&gt;] pcie_portdrv_remove+0x40/0x50
   [&lt;ffffffff97576d7b&gt;] pci_device_remove+0x4b/0xc0
   [&lt;ffffffff9785ebe6&gt;] __device_release_driver+0xb6/0x150
   [&lt;ffffffff9785eca5&gt;] device_release_driver+0x25/0x40
   [&lt;ffffffff975702e4&gt;] pci_stop_bus_device+0x74/0xa0
   [&lt;ffffffff975704ea&gt;] pci_stop_and_remove_bus_device_locked+0x1a/0x30
   [&lt;ffffffff97578810&gt;] remove_store+0x50/0x70
   [&lt;ffffffff9785a378&gt;] dev_attr_store+0x18/0x30
   [&lt;ffffffff97260b64&gt;] sysfs_kf_write+0x44/0x60
   [&lt;ffffffff9725feae&gt;] kernfs_fop_write+0x10e/0x190
   [&lt;ffffffff971e13f8&gt;] __vfs_write+0x28/0x110
   [&lt;ffffffff970b0fa4&gt;] ? percpu_down_read+0x44/0x80
   [&lt;ffffffff971e53a7&gt;] ? __sb_start_write+0xa7/0xe0
   [&lt;ffffffff971e53a7&gt;] ? __sb_start_write+0xa7/0xe0
   [&lt;ffffffff971e1f04&gt;] vfs_write+0xc4/0x180
   [&lt;ffffffff971e3089&gt;] SyS_write+0x49/0xa0
   [&lt;ffffffff97001a46&gt;] do_syscall_64+0xa6/0x1b0
   [&lt;ffffffff9819201e&gt;] entry_SYSCALL64_slow_path+0x25/0x25
  ...
   RIP  [&lt;ffffffff9758bbf5&gt;] free_msi_irqs+0x65/0x190
   RSP &lt;ffff89ad3085bc48&gt;
  ---[ end trace f4505e1dac5b95d3 ]---
  Segmentation fault

Restore pcie_pme_remove().

[bhelgaas: changelog]
Fixes: d7def2040077 ("PCI/PME: Make explicitly non-modular")
Signed-off-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Acked-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
CC: stable@vger.kernel.org	# v4.9+</content>
</entry>
<entry>
<title>PCI/ASPM: Add comment about L1 substate latency</title>
<updated>2017-02-14T23:44:47Z</updated>
<author>
<name>Rajat Jain</name>
</author>
<published>2017-01-03T06:34:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a142f4d3e5c54db5e942fa6ee5f3dc0e8c83207b'/>
<id>urn:sha1:a142f4d3e5c54db5e942fa6ee5f3dc0e8c83207b</id>
<content type='text'>
Since the exit latencies for L1 substates are not advertised by a device,
it is not clear in spec how to do a L1 substate exit latency check.  We
assume that the L1 exit latencies advertised by a device include L1
substate latencies (and hence do not do any check).  If that is not true,
we should do some sort of check here.

(I'm not clear about what that check should like currently. I'd be glad to
take up any suggestions).

Signed-off-by: Rajat Jain &lt;rajatja@google.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;</content>
</entry>
<entry>
<title>PCI/ASPM: Configure L1 substate settings</title>
<updated>2017-02-14T23:44:30Z</updated>
<author>
<name>Rajat Jain</name>
</author>
<published>2017-01-03T06:34:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=aeda9adebab8b5bdd90576e3065a1f3f948279ad'/>
<id>urn:sha1:aeda9adebab8b5bdd90576e3065a1f3f948279ad</id>
<content type='text'>
Configure the L1 substate settings on the upstream and downstream devices,
while taking care of the rules dictated by the PCIe spec.

[bhelgaas: drop "inline"]
Signed-off-by: Rajat Jain &lt;rajatja@google.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;</content>
</entry>
<entry>
<title>PCI/ASPM: Calculate and save the L1.2 timing parameters</title>
<updated>2017-02-14T23:44:25Z</updated>
<author>
<name>Rajat Jain</name>
</author>
<published>2017-01-03T06:34:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f1f0366dd6be9624f7d355b72cc909ab821eb4c0'/>
<id>urn:sha1:f1f0366dd6be9624f7d355b72cc909ab821eb4c0</id>
<content type='text'>
Calculate and save the timing parameters that need to be programmed if we
need to enable L1.2 substates later.

We use the same logic (and a constant value for 1 of the parameters) as
used by Intel's coreboot:

  https://www.coreboot.org/pipermail/coreboot-gerrit/2015-March/021134.html
  https://review.coreboot.org/#/c/8832/

Signed-off-by: Rajat Jain &lt;rajatja@google.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;</content>
</entry>
</feed>
