]> asedeno.scripts.mit.edu Git - linux.git/log
linux.git
6 years agopowerpc/pci: Fix broken INTx configuration via OF
Alexey Kardashevskiy [Fri, 9 Feb 2018 06:23:58 +0000 (17:23 +1100)]
powerpc/pci: Fix broken INTx configuration via OF

59f47eff03a0 ("powerpc/pci: Use of_irq_parse_and_map_pci() helper")
replaced of_irq_parse_pci() + irq_create_of_mapping() with
of_irq_parse_and_map_pci(), but neglected to capture the virq
returned by irq_create_of_mapping(), so virq remained zero, which
caused INTx configuration to fail.

Save the virq value returned by of_irq_parse_and_map_pci() and correct
the virq declaration to match the of_irq_parse_and_map_pci() signature.

Fixes: 59f47eff03a0 "powerpc/pci: Use of_irq_parse_and_map_pci() helper"
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
[bhelgaas: changelog]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
6 years agoMerge branch 'pci/spdx' into next
Bjorn Helgaas [Thu, 1 Feb 2018 17:40:07 +0000 (11:40 -0600)]
Merge branch 'pci/spdx' into next

* pci/spdx:
  PCI: Add SPDX GPL-2.0+ to replace implicit GPL v2 or later statement
  PCI: Add SPDX GPL-2.0+ to replace GPL v2 or later boilerplate
  PCI: Add SPDX GPL-2.0 to replace COPYING boilerplate
  PCI: Add SPDX GPL-2.0 to replace GPL v2 boilerplate
  PCI: Add SPDX GPL-2.0 when no license was specified

6 years agoMerge remote-tracking branch 'lorenzo/pci/xgene' into next
Bjorn Helgaas [Thu, 1 Feb 2018 17:40:06 +0000 (11:40 -0600)]
Merge remote-tracking branch 'lorenzo/pci/xgene' into next

* lorenzo/pci/xgene:
  PCI: xgene: Remove leftover pci_scan_child_bus() call

6 years agoMerge remote-tracking branch 'lorenzo/pci/tegra' into next
Bjorn Helgaas [Thu, 1 Feb 2018 17:40:05 +0000 (11:40 -0600)]
Merge remote-tracking branch 'lorenzo/pci/tegra' into next

* lorenzo/pci/tegra:
  PCI: tegra: Use bus->sysdata to store and get host private data
  of: Export of_pci_range_to_resource()
  PCI: tegra: Refactor configuration space mapping code

6 years agoMerge remote-tracking branch 'lorenzo/pci/rcar' into next
Bjorn Helgaas [Thu, 1 Feb 2018 17:40:04 +0000 (11:40 -0600)]
Merge remote-tracking branch 'lorenzo/pci/rcar' into next

* lorenzo/pci/rcar:
  PCI: rcar: Handle rcar_pcie_parse_request_of_pci_ranges() failures

6 years agoMerge remote-tracking branch 'lorenzo/pci/keystone' into next
Bjorn Helgaas [Thu, 1 Feb 2018 17:40:02 +0000 (11:40 -0600)]
Merge remote-tracking branch 'lorenzo/pci/keystone' into next

* lorenzo/pci/keystone:
  PCI: keystone: Fix interrupt-controller-node lookup

6 years agoMerge remote-tracking branch 'lorenzo/pci/endpoint' into next
Bjorn Helgaas [Thu, 1 Feb 2018 17:40:01 +0000 (11:40 -0600)]
Merge remote-tracking branch 'lorenzo/pci/endpoint' into next

* lorenzo/pci/endpoint:
  PCI: endpoint: Use EPC's device in dma_alloc_coherent()/dma_free_coherent()
  PCI: designware-ep: Fix ->get_msi() to check MSI_EN bit
  PCI: endpoint: Fix find_first_zero_bit() usage
  PCI: endpoint: Populate func_no before calling pci_epc_add_epf()
  PCI: designware-ep: Fix find_first_zero_bit() usage

6 years agoMerge remote-tracking branch 'lorenzo/pci/dwc' into next
Bjorn Helgaas [Thu, 1 Feb 2018 17:36:07 +0000 (11:36 -0600)]
Merge remote-tracking branch 'lorenzo/pci/dwc' into next

* lorenzo/pci/dwc:
  PCI: exynos: Fix a potential init_clk_resources NULL pointer dereference
  PCI: iproc: Fix NULL pointer dereference for BCMA
  PCI: dra7xx: Iterate over INTx status bits
  PCI: dra7xx: Fix legacy INTD IRQ handling
  PCI: qcom: Account for const type of of_device_id.data
  PCI: dwc: artpec6: Fix return value check in artpec6_add_pcie_ep()
  PCI: exynos: Remove deprecated PHY initialization code
  PCI: dwc: artpec6: Add support for the ARTPEC-7 SoC
  bindings: PCI: artpec: Add support for the ARTPEC-7 SoC
  PCI: dwc: artpec6: Deassert the core before waiting for PHY
  PCI: dwc: Make cpu_addr_fixup take struct dw_pcie as argument
  PCI: dwc: artpec6: Add support for endpoint mode
  bindings: PCI: artpec: Add support for endpoint mode
  PCI: dwc: artpec6: Split artpec6_pcie_establish_link() into smaller functions
  PCI: dwc: artpec6: Use BIT and GENMASK macros
  PCI: dwc: artpec6: Remove unused defines
  PCI: dwc: dra7xx: Help compiler to remove unused code
  PCI: dwc: dra7xx: Assign pp->ops in dra7xx_add_pcie_port() rather than in probe
  PCI: dwc: dra7xx: Refactor Kconfig and Makefile handling for host/ep mode
  PCI: designware-ep: Add generic function for raising MSI irq
  PCI: designware-ep: Remove static keyword from dw_pcie_ep_reset_bar()
  PCI: designware-ep: Pre-allocate memory for MSI in dw_pcie_ep_init
  PCI: designware-ep: Read-only registers need DBI_RO_WR_EN to be writable
  PCI: designware-ep: dw_pcie_ep_set_msi() should only set MMC bits
  PCI: dwc: Use the DMA-API to get the MSI address
  pci: dwc: pci-dra7xx: Make shutdown handler static

Includes resolution to conflict between:

  4494738de0d9 ("PCI: endpoint: Add the function number as argument to EPC ops")
  6f6d7873711c ("PCI: designware-ep: Add generic function for raising MSI irq")

The resolution is due to Niklas Cassel <niklas.cassel@axis.com>:
https://lkml.kernel.org/r/20180201085608.GA22568@axis.com

6 years agoMerge remote-tracking branch 'lorenzo/pci/cadence' into next
Bjorn Helgaas [Wed, 31 Jan 2018 16:21:33 +0000 (10:21 -0600)]
Merge remote-tracking branch 'lorenzo/pci/cadence' into next

* lorenzo/pci/cadence:
  PCI: cadence: Add EndPoint Controller driver for Cadence PCIe controller
  dt-bindings: PCI: cadence: Add DT bindings for Cadence PCIe endpoint controller
  PCI: endpoint: Fix EPF device name to support multi-function devices
  PCI: endpoint: Add the function number as argument to EPC ops
  PCI: cadence: Add host driver for Cadence PCIe controller
  dt-bindings: PCI: cadence: Add DT bindings for Cadence PCIe host controller
  PCI: Add vendor ID for Cadence
  PCI: Add generic function to probe PCI host controllers
  PCI: generic: fix missing call of pci_free_resource_list()
  PCI: OF: Add generic function to parse and allocate PCI resources
  PCI: Regroup all PCI related entries into drivers/pci/Makefile

Conflicts:
drivers/pci/of.c
include/linux/pci.h

6 years agoMerge branch 'pci/virtualization' into next
Bjorn Helgaas [Wed, 31 Jan 2018 16:13:09 +0000 (10:13 -0600)]
Merge branch 'pci/virtualization' into next

* pci/virtualization:
  PCI: Expose ari_enabled in sysfs
  PCI: Add function 1 DMA alias quirk for Marvell 9128
  PCI: Mark Ceton InfiniTV4 INTx masking as broken
  xen/pci: Use acpi_noirq_set() helper to avoid #ifdef

6 years agoMerge branch 'pci/trivial' into next
Bjorn Helgaas [Wed, 31 Jan 2018 16:13:07 +0000 (10:13 -0600)]
Merge branch 'pci/trivial' into next

* pci/trivial:
  PCI: Clean up whitespace in linux/pci.h, pci/pci.h
  PCI: Tidy up pci/probe.c comments

6 years agoMerge branch 'pci/switchtec' into next
Bjorn Helgaas [Wed, 31 Jan 2018 16:13:07 +0000 (10:13 -0600)]
Merge branch 'pci/switchtec' into next

* pci/switchtec:
  switchtec: Add device IDs for PSX 24xG3 and PSX 48xG3
  switchtec: Add Global Fabric Manager Server (GFMS) event

6 years agoMerge branch 'pci/resource' into next
Bjorn Helgaas [Wed, 31 Jan 2018 16:12:56 +0000 (10:12 -0600)]
Merge branch 'pci/resource' into next

* pci/resource:
  PCI: tegra: Remove PCI_REASSIGN_ALL_BUS use on Tegra
  resource: Set type when reserving new regions
  resource: Set type of "reserve=" user-specified resources
  irqchip/i8259: Set I/O port resource types correctly
  powerpc: Set I/O port resource types correctly
  MIPS: Set I/O port resource types correctly
  vgacon: Set VGA struct resource types
  PCI: Use dev_info() rather than dev_err() for ROM validation
  PCI: Remove PCI_REASSIGN_ALL_RSRC use on arm and arm64
  PCI: Remove sysfs resource mmap warning

Conflicts:
drivers/pci/rom.c

6 years agoMerge branch 'pci/msi' into next
Bjorn Helgaas [Wed, 31 Jan 2018 16:10:32 +0000 (10:10 -0600)]
Merge branch 'pci/msi' into next

* pci/msi:
  PCI: Disable MSI for HiSilicon Hip06/Hip07 only in Root Port mode

6 years agoMerge branch 'pci/misc' into next
Bjorn Helgaas [Wed, 31 Jan 2018 16:10:32 +0000 (10:10 -0600)]
Merge branch 'pci/misc' into next

* pci/misc:
  PCI: Add dummy pci_irqd_intx_xlate() for CONFIG_PCI=n build
  PCI: Add wrappers for dev_printk()
  PCI: Remove unnecessary messages for memory allocation failures
  PCI: Add #defines for Completion Timeout Disable feature
  hinic: Replace PCI pool old API
  net: e100: Replace PCI pool old API
  block: DAC960: Replace PCI pool old API
  MAINTAINERS: Include more PCI files
  PCI: Remove unneeded kallsyms include
  powerpc/pci: Unroll two pass loop when scanning bridges
  powerpc/pci: Use for_each_pci_bridge() helper

6 years agoMerge branch 'pci/hotplug' into next
Bjorn Helgaas [Wed, 31 Jan 2018 16:10:31 +0000 (10:10 -0600)]
Merge branch 'pci/hotplug' into next

* pci/hotplug:
  PCI: pciehp: Assume NoCompl+ for Thunderbolt ports
  PCI: hotplug: Drop checking of PCI_BRIDGE_CONTROL in *_unconfigure_device()

6 years agoMerge branch 'pci/enumeration' into next
Bjorn Helgaas [Wed, 31 Jan 2018 16:10:30 +0000 (10:10 -0600)]
Merge branch 'pci/enumeration' into next

* pci/enumeration:
  RDMA/qedr: Use pci_enable_atomic_ops_to_root()
  PCI: Add pci_enable_atomic_ops_to_root()
  PCI: Make PCI_SCAN_ALL_PCIE_DEVS work for Root as well as Downstream Ports

6 years agoMerge branch 'pci/dt-resources' into next
Bjorn Helgaas [Wed, 31 Jan 2018 16:10:29 +0000 (10:10 -0600)]
Merge branch 'pci/dt-resources' into next

* pci/dt-resources:
  PCI: Make of_irq_parse_pci() static
  powerpc/pci: Use of_irq_parse_and_map_pci() helper
  PCI: Move OF-related PCI functions into PCI core

6 years agoMerge branch 'pci/dpc' into next
Bjorn Helgaas [Wed, 31 Jan 2018 16:10:28 +0000 (10:10 -0600)]
Merge branch 'pci/dpc' into next

* pci/dpc:
  PCI/DPC: Reformat DPC register definitions
  PCI/DPC: Add and use DPC Status register field definitions
  PCI/DPC: Squash dpc_rp_pio_get_info() into dpc_process_rp_pio_error()
  PCI/DPC: Remove unnecessary RP PIO register structs
  PCI/DPC: Push dpc->rp_pio_status assignment into dpc_rp_pio_get_info()
  PCI/DPC: Squash dpc_rp_pio_print_error() into dpc_rp_pio_get_info()
  PCI/DPC: Make RP PIO log size check more generic
  PCI/DPC: Rename local "status" to "dpc_status"
  PCI/DPC: Squash dpc_rp_pio_print_tlp_header() into dpc_rp_pio_print_error()
  PCI/DPC: Process RP PIO details only if RP PIO extensions supported
  PCI/DPC: Read RP PIO Log Size once at probe
  PCI/DPC: Rename struct dpc_dev.rp to rp_extensions
  PCI/DPC: Add local variable for DPC capability offset
  PCI/DPC: Rename interrupt_event_handler() to dpc_work()
  PCI/DPC: Fix interrupt message number print
  PCI/DPC: Enable DPC only if AER is available
  PCI/DPC: Fix shared interrupt handling

6 years agoMerge branch 'pci/dma' into next
Bjorn Helgaas [Wed, 31 Jan 2018 16:10:28 +0000 (10:10 -0600)]
Merge branch 'pci/dma' into next

* pci/dma:
  PCI: Remove NULL device handling from PCI DMA API
  net: tsi108: Use DMA API properly
  media: ttusb-dec: Remove pci_zalloc_coherent() abuse
  media: ttusb-budget: Remove pci_zalloc_coherent() abuse

6 years agoMerge branch 'pci/deprecate-get-bus-and-slot' into next
Bjorn Helgaas [Wed, 31 Jan 2018 16:10:27 +0000 (10:10 -0600)]
Merge branch 'pci/deprecate-get-bus-and-slot' into next

* pci/deprecate-get-bus-and-slot:
  video: fbdev: riva: deprecate pci_get_bus_and_slot()
  video: fbdev: nvidia: deprecate pci_get_bus_and_slot()
  video: fbdev: intelfb: deprecate pci_get_bus_and_slot()
  openprom: Deprecate pci_get_bus_and_slot()
  xen/pcifront: Deprecate pci_get_bus_and_slot()
  PCI: Deprecate pci_get_bus_and_slot()
  PCI: ibmphp: Deprecate pci_get_bus_and_slot()
  PCI: cpqhp: Deprecate pci_get_bus_and_slot()
  pch_gbe: Deprecate pci_get_bus_and_slot()
  bnx2x: Deprecate pci_get_bus_and_slot()
  powerpc/via-pmu: Deprecate pci_get_bus_and_slot()
  iommu/amd: Deprecate pci_get_bus_and_slot()
  sl82c105: deprecate pci_get_bus_and_slot()
  drm/nouveau: deprecate pci_get_bus_and_slot()
  drm/gma500: Deprecate pci_get_bus_and_slot()
  ibft: Deprecate pci_get_bus_and_slot()
  edd: Deprecate pci_get_bus_and_slot()
  agp: sworks: Deprecate pci_get_bus_and_slot()
  agp: nvidia: Deprecate pci_get_bus_and_slot()
  ata: Deprecate pci_get_bus_and_slot()
  x86/PCI: Deprecate pci_get_bus_and_slot()
  powerpc/PCI: Deprecate pci_get_bus_and_slot()
  alpha/PCI: Deprecate pci_get_bus_and_slot()

6 years agoMerge branch 'pci/aspm' into next
Bjorn Helgaas [Wed, 31 Jan 2018 16:10:26 +0000 (10:10 -0600)]
Merge branch 'pci/aspm' into next

* pci/aspm:
  PCI/ASPM: Unexport internal ASPM interfaces
  PCI/ASPM: Enable Latency Tolerance Reporting when supported
  PCI/ASPM: Calculate LTR_L1.2_THRESHOLD from device characteristics

6 years agoMerge branch 'pci/aer' into next
Bjorn Helgaas [Wed, 31 Jan 2018 16:10:25 +0000 (10:10 -0600)]
Merge branch 'pci/aer' into next

* pci/aer:
  PCI/AER: Return error if AER is not supported
  PCI/AER: Skip recovery callbacks for correctable errors from ACPI APEI

6 years agoPCI: cadence: Add EndPoint Controller driver for Cadence PCIe controller
Cyrille Pitchen [Tue, 30 Jan 2018 20:56:59 +0000 (21:56 +0100)]
PCI: cadence: Add EndPoint Controller driver for Cadence PCIe controller

This patch adds support to the Cadence PCIe controller in endpoint mode.

Since pieces of source code are shared with the host driver (Root
Complex mode), we create a new directory under drivers/pci dedicated to
the Cadence PCIe controller. The common code is placed into
drivers/pci/cadence/pcie-cadence.c and used by both the host and
endpoint controller drivers.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@free-electrons.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
6 years agodt-bindings: PCI: cadence: Add DT bindings for Cadence PCIe endpoint controller
Cyrille Pitchen [Tue, 30 Jan 2018 20:56:58 +0000 (21:56 +0100)]
dt-bindings: PCI: cadence: Add DT bindings for Cadence PCIe endpoint controller

This patch documents the DT bindings for the Cadence PCIe controller
when configured in endpoint mode.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@free-electrons.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Rob Herring <robh@kernel.org>
6 years agoPCI: endpoint: Fix EPF device name to support multi-function devices
Cyrille Pitchen [Tue, 30 Jan 2018 20:56:57 +0000 (21:56 +0100)]
PCI: endpoint: Fix EPF device name to support multi-function devices

Fix the pci_epf_make() function so it can now bind many EPF devices to the
same EPF driver.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@free-electrons.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
6 years agoPCI: endpoint: Add the function number as argument to EPC ops
Cyrille Pitchen [Tue, 30 Jan 2018 20:56:56 +0000 (21:56 +0100)]
PCI: endpoint: Add the function number as argument to EPC ops

This patch updates the prototype of most handlers from 'struct
pci_epc_ops' so the EPC library can now support multi-function devices.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@free-electrons.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
6 years agoPCI: cadence: Add host driver for Cadence PCIe controller
Cyrille Pitchen [Tue, 30 Jan 2018 20:56:55 +0000 (21:56 +0100)]
PCI: cadence: Add host driver for Cadence PCIe controller

This patch adds support to the Cadence PCIe controller in host mode.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@free-electrons.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
6 years agodt-bindings: PCI: cadence: Add DT bindings for Cadence PCIe host controller
Scott Telford [Tue, 30 Jan 2018 20:56:54 +0000 (21:56 +0100)]
dt-bindings: PCI: cadence: Add DT bindings for Cadence PCIe host controller

This patch adds documentation for the DT bindings of the Cadence PCIe
controller when configured in host (Root Complex) mode.

Signed-off-by: Scott Telford <stelford@cadence.com>
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@free-electrons.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Rob Herring <robh@kernel.org>
6 years agoPCI: Add vendor ID for Cadence
Cyrille Pitchen [Tue, 30 Jan 2018 20:56:53 +0000 (21:56 +0100)]
PCI: Add vendor ID for Cadence

This patch adds a new PCI vendor ID for Cadence.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@free-electrons.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
6 years agoPCI: Add generic function to probe PCI host controllers
Cyrille Pitchen [Tue, 30 Jan 2018 20:56:52 +0000 (21:56 +0100)]
PCI: Add generic function to probe PCI host controllers

This patchs moves generic source code from
drivers/pci/host/pci-host-common.c into drivers/pci/probe.c.

Indeed the extracted lines of code were duplicated by many host
controller drivers. Regrouping them into a generic function gives a
change to properly share this code without introducing a useless
dependency to PCI_HOST_COMMON, which selects PCI_ECAM when not needed by
most host controller drivers.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@free-electrons.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
6 years agoPCI: generic: fix missing call of pci_free_resource_list()
Cyrille Pitchen [Tue, 30 Jan 2018 20:56:51 +0000 (21:56 +0100)]
PCI: generic: fix missing call of pci_free_resource_list()

Call pci_free_resource_list() from pci_host_common_probe() when probing
fails, as done inside gen_pci_init() when this later function fails.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@free-electrons.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
6 years agoPCI: OF: Add generic function to parse and allocate PCI resources
Cyrille Pitchen [Tue, 30 Jan 2018 20:56:50 +0000 (21:56 +0100)]
PCI: OF: Add generic function to parse and allocate PCI resources

The patch moves the gen_pci_parse_request_of_pci_ranges() function from
drivers/pci/host/pci-host-common.c into drivers/pci/of.c to easily share
common source code between PCI host drivers.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@free-electrons.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
6 years agoPCI: Regroup all PCI related entries into drivers/pci/Makefile
Cyrille Pitchen [Tue, 30 Jan 2018 20:56:49 +0000 (21:56 +0100)]
PCI: Regroup all PCI related entries into drivers/pci/Makefile

Clean up drivers/Makefile by moving the pci/endpoint and pci/dwc entries
from drivers/Makefile into drivers/pci/Makefile.

Since we don't want to introduce any dependency between CONFIG_PCI and
CONFIG_PCI_ENDPOINT, we now always execute drivers/pci/Makefile.

Hence all Makefiles in drivers/pci/ were updated accordingly so no file is
compiled when CONFIG_PCI is not defined.

Also, we add a comment to reinforce that EPC and EPF libraries must be
initialized before their users. Hence built-in EPC drivers, such as
those of Designware, are linked after the endpoint core libraries.

Finally, we add another comment to explain why obj-y has been chosen
instead of obj-$(CONFIG_PCIE_DW) to parse the dwc/ sub-folder.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@free-electrons.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
6 years agoPCI/DPC: Reformat DPC register definitions
Bjorn Helgaas [Tue, 16 Jan 2018 23:34:12 +0000 (17:34 -0600)]
PCI/DPC: Reformat DPC register definitions

Reformat DPC register definitions to follow the convention that register
field masks indicate the register width, e.g., a field of a 16-bit register
uses a mask of 4 hex digits, with leading zeros included as needed.
No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sinan Kaya <okaya@codeaurora.org>
6 years agoPCI/DPC: Add and use DPC Status register field definitions
Bjorn Helgaas [Tue, 16 Jan 2018 23:37:50 +0000 (17:37 -0600)]
PCI/DPC: Add and use DPC Status register field definitions

Add definitions for DPC Status register fields and use them in the code.
No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sinan Kaya <okaya@codeaurora.org>
6 years agoPCI/DPC: Squash dpc_rp_pio_get_info() into dpc_process_rp_pio_error()
Bjorn Helgaas [Tue, 30 Jan 2018 18:12:53 +0000 (12:12 -0600)]
PCI/DPC: Squash dpc_rp_pio_get_info() into dpc_process_rp_pio_error()

dpc_process_rp_pio_error() only calls dpc_rp_pio_get_info(), so squash them
together.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sinan Kaya <okaya@codeaurora.org>
6 years agoPCI/DPC: Remove unnecessary RP PIO register structs
Bjorn Helgaas [Tue, 30 Jan 2018 18:12:48 +0000 (12:12 -0600)]
PCI/DPC: Remove unnecessary RP PIO register structs

We read and immediately print the RP PIO log registers.  We don't save
them, so there's no need to define structs for them.  Remove the structs
and read the registers into local variables instead.  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sinan Kaya <okaya@codeaurora.org>
6 years agoPCI/DPC: Push dpc->rp_pio_status assignment into dpc_rp_pio_get_info()
Bjorn Helgaas [Tue, 30 Jan 2018 18:12:43 +0000 (12:12 -0600)]
PCI/DPC: Push dpc->rp_pio_status assignment into dpc_rp_pio_get_info()

Move the dpc->rp_pio_status assignment into dpc_rp_pio_get_info() since
that's where we read rp_pio->status anway.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sinan Kaya <okaya@codeaurora.org>
6 years agoPCI/DPC: Squash dpc_rp_pio_print_error() into dpc_rp_pio_get_info()
Bjorn Helgaas [Tue, 30 Jan 2018 18:12:38 +0000 (12:12 -0600)]
PCI/DPC: Squash dpc_rp_pio_print_error() into dpc_rp_pio_get_info()

Separating dpc_rp_pio_print_error() doesn't really provide any useful
abstraction, so squash it into its caller, dpc_rp_pio_get_info().  No
functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sinan Kaya <okaya@codeaurora.org>
6 years agoPCI/DPC: Make RP PIO log size check more generic
Bjorn Helgaas [Tue, 30 Jan 2018 18:12:33 +0000 (12:12 -0600)]
PCI/DPC: Make RP PIO log size check more generic

In dpc_probe(), we set dpc->rp_log_size to zero if we think the hardware
reports an invalid size.  In this case, we could have dpc->rp_extensions
set but dpc->rp_log_size == 0, and we should print the basic RP PIO
registers but not the variable-size portion.  We already checked for
dpc->rp_log_size < 4 above, so this patch is just for consistency of style.
No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sinan Kaya <okaya@codeaurora.org>
6 years agoPCI/DPC: Rename local "status" to "dpc_status"
Bjorn Helgaas [Tue, 30 Jan 2018 18:12:27 +0000 (12:12 -0600)]
PCI/DPC: Rename local "status" to "dpc_status"

In dpc_rp_pio_get_info() rename the local "status" variable to
"dpc_status".  This is to make room for another variable named "status" in
a subsequent patch.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sinan Kaya <okaya@codeaurora.org>
6 years agoPCI/DPC: Squash dpc_rp_pio_print_tlp_header() into dpc_rp_pio_print_error()
Bjorn Helgaas [Tue, 30 Jan 2018 00:57:21 +0000 (18:57 -0600)]
PCI/DPC: Squash dpc_rp_pio_print_tlp_header() into dpc_rp_pio_print_error()

Separating dpc_rp_pio_print_tlp_header() doesn't really provide any useful
abstraction, so squash it into its caller, dpc_rp_pio_print_error().  No
functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sinan Kaya <okaya@codeaurora.org>
6 years agoPCI/DPC: Process RP PIO details only if RP PIO extensions supported
Bjorn Helgaas [Fri, 26 Jan 2018 13:45:18 +0000 (07:45 -0600)]
PCI/DPC: Process RP PIO details only if RP PIO extensions supported

The RP PIO registers (status, mask, severity, etc) are only implemented if
the "RP Extensions for DPC" bit is set in the DPC Capabilities register.

Previously we called dpc_process_rp_pio_error(), which reads and decodes
those RP PIO registers, whenever the DPC Status register indicated an "RP
PIO error" (Trigger Reason == 3 and Trigger Reason Extension == 0).

It does seem reasonable to assume that DPC Status would only indicate an RP
PIO error if the RP extensions are supported, but PCIe r4.0, sec 7.9.15.4,
is actually not explicit about that: it does not say "Trigger Reason
Extension == 0 is valid only for Root Ports that support RP Extensions for
DPC."

Check whether the RP Extensions for DPC are supported before trying to read
the RP PIO registers.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sinan Kaya <okaya@codeaurora.org>
6 years agoPCI/DPC: Read RP PIO Log Size once at probe
Bjorn Helgaas [Thu, 25 Jan 2018 18:49:27 +0000 (12:49 -0600)]
PCI/DPC: Read RP PIO Log Size once at probe

The RP PIO Log Size is a read-only field in the DPC Capability, so it is
constant and known at probe-time, but previously we read it every time we
processed an RP PIO error.

Read it once in dpc_probe() (if the RP Extensions for DPC are supported)
and remember the size in struct dpc_dev.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sinan Kaya <okaya@codeaurora.org>
6 years agoPCI/DPC: Rename struct dpc_dev.rp to rp_extensions
Bjorn Helgaas [Fri, 26 Jan 2018 21:46:38 +0000 (15:46 -0600)]
PCI/DPC: Rename struct dpc_dev.rp to rp_extensions

"rp" is ambiguous: it might mean "this DPC device is a Root Port."  But in
fact, it means "this DPC device is a Root Port *and* it supports a set of
DPC Extensions."

Rename "rp" to "rp_extensions" to make this more clear.  No functional
change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sinan Kaya <okaya@codeaurora.org>
6 years agoPCI/DPC: Add local variable for DPC capability offset
Bjorn Helgaas [Fri, 26 Jan 2018 00:06:03 +0000 (18:06 -0600)]
PCI/DPC: Add local variable for DPC capability offset

Add a local variable for DPC capability offset and replace repeated use of
"dpc->cap_pos" with simply "cap".  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sinan Kaya <okaya@codeaurora.org>
6 years agoPCI: Add SPDX GPL-2.0+ to replace implicit GPL v2 or later statement
Bjorn Helgaas [Tue, 30 Jan 2018 00:23:07 +0000 (18:23 -0600)]
PCI: Add SPDX GPL-2.0+ to replace implicit GPL v2 or later statement

7441b0627e22 ("s390/pci: PCI hotplug support via SCLP") added
s390_pci_hpc.c, which included this license information:

  +MODULE_LICENSE("GPL");

Based on "git show 7441b0627e22:include/linux/module.h", that "GPL" string
means "GPL v2 or later":

   *      "GPL"                           [GNU Public License v2 or later]

0729dcf24832 ("s390: hotplug: make pci_hpc explicitly non-modular")
subsequently replaced the MODULE_LICENSE() with a "License: GPL" comment.

Add SPDX GPL-2.0+ and remove the "License: GPL" comment, relying on the
assertion in b24413180f56 ("License cleanup: add SPDX GPL-2.0 license
identifier to files with no license") that the SPDX identifier may be used
instead of the full boilerplate text.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
6 years agoPCI: Add SPDX GPL-2.0+ to replace GPL v2 or later boilerplate
Bjorn Helgaas [Fri, 26 Jan 2018 20:22:04 +0000 (14:22 -0600)]
PCI: Add SPDX GPL-2.0+ to replace GPL v2 or later boilerplate

Add SPDX GPL-2.0+ to all PCI files that specified the GPL and allowed
either GPL version 2 or any later version.

Remove the boilerplate GPL version 2 or later language, relying on the
assertion in b24413180f56 ("License cleanup: add SPDX GPL-2.0 license
identifier to files with no license") that the SPDX identifier may be used
instead of the full boilerplate text.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoPCI: Add SPDX GPL-2.0 to replace COPYING boilerplate
Bjorn Helgaas [Fri, 26 Jan 2018 20:12:23 +0000 (14:12 -0600)]
PCI: Add SPDX GPL-2.0 to replace COPYING boilerplate

Add SPDX GPL-2.0 to all PCI files that referred to the kernel default
"COPYING" file, which specifies GPL version 2.

Remove the boilerplate language referring to the GPL and "COPYING", relying
on the assertion in b24413180f56 ("License cleanup: add SPDX GPL-2.0
license identifier to files with no license") that the SPDX identifier may
be used instead of the full boilerplate text.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoPCI: Add SPDX GPL-2.0 to replace GPL v2 boilerplate
Bjorn Helgaas [Fri, 26 Jan 2018 18:50:27 +0000 (12:50 -0600)]
PCI: Add SPDX GPL-2.0 to replace GPL v2 boilerplate

Add SPDX GPL-2.0 to all PCI files that specified the GPL version 2 license.

Remove the boilerplate GPL version 2 language, relying on the assertion in
b24413180f56 ("License cleanup: add SPDX GPL-2.0 license identifier to
files with no license") that the SPDX identifier may be used instead of the
full boilerplate text.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoPCI/DPC: Rename interrupt_event_handler() to dpc_work()
Bjorn Helgaas [Fri, 26 Jan 2018 13:18:56 +0000 (07:18 -0600)]
PCI/DPC: Rename interrupt_event_handler() to dpc_work()

Rename interrupt_event_handler() to dpc_work() so there's more useful
information in stack traces and similar situations.  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sinan Kaya <okaya@codeaurora.org>
6 years agoPCI/DPC: Fix interrupt message number print
Keith Busch [Wed, 17 Jan 2018 05:22:05 +0000 (22:22 -0700)]
PCI/DPC: Fix interrupt message number print

The interrupt message number is the first 5 bits, but the driver was
masking only the first 4 bits.  Fix that by using the existing
define.

Signed-off-by: Keith Busch <keith.busch@intel.com>
[bhelgaas: remove reformatting (done by another patch)]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
6 years agoPCI/DPC: Enable DPC only if AER is available
Keith Busch [Wed, 24 Jan 2018 23:03:18 +0000 (17:03 -0600)]
PCI/DPC: Enable DPC only if AER is available

The "Determination of DPC Control" implementation note in PCIe r4.0, sec
6.1.10, recommends the operating system always link DPC control to the
control of AER, as the two functionalities are strongly connected.

To avoid conflicts over whether platform firmware or the OS controls DPC,
enable DPC only if AER is enabled in the OS, and the device's error
handling does not have firmware-first AER handling.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
6 years agoPCI: Add SPDX GPL-2.0 when no license was specified
Bjorn Helgaas [Fri, 26 Jan 2018 17:45:16 +0000 (11:45 -0600)]
PCI: Add SPDX GPL-2.0 when no license was specified

b24413180f56 ("License cleanup: add SPDX GPL-2.0 license identifier to
files with no license") added SPDX GPL-2.0 to several PCI files that
previously contained no license information.

Add SPDX GPL-2.0 to all other PCI files that did not contain any license
information and hence were under the default GPL version 2 license of the
kernel.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoPCI: Make of_irq_parse_pci() static
Rob Herring [Thu, 4 Jan 2018 21:12:15 +0000 (15:12 -0600)]
PCI: Make of_irq_parse_pci() static

Now that the DT PCI code is merged into drivers/pci, of_irq_parse_pci() can
be static.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Frank Rowand <frowand.list@gmail.com>
6 years agoRDMA/qedr: Use pci_enable_atomic_ops_to_root()
Felix Kuehling [Fri, 5 Jan 2018 00:45:00 +0000 (19:45 -0500)]
RDMA/qedr: Use pci_enable_atomic_ops_to_root()

Use PCI core interface pci_enable_atomic_ops_to_root() to enable atomic
capability.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Michal Kalderon <michal.kalderon@cavium.com>
CC: Ram Amrani <Ram.Amrani@cavium.com>
CC: Doug Ledford <dledford@redhat.com>
6 years agoPCI: Add pci_enable_atomic_ops_to_root()
Jay Cornwall [Fri, 5 Jan 2018 00:44:59 +0000 (19:44 -0500)]
PCI: Add pci_enable_atomic_ops_to_root()

The Atomic Operations feature (PCIe r4.0, sec 6.15) allows atomic
transctions to be requested by, routed through and completed by PCIe
components. Routing and completion do not require software support.
Component support for each is detectable via the DEVCAP2 register.

A Requester may use AtomicOps only if its PCI_EXP_DEVCTL2_ATOMIC_REQ is
set. This should be set only if the Completer and all intermediate routing
elements support AtomicOps.

A concrete example is the AMD Fiji-class GPU (which is capable of making
AtomicOp requests), below a PLX 8747 switch (advertising AtomicOp routing)
with a Haswell host bridge (advertising AtomicOp completion support).

Add pci_enable_atomic_ops_to_root() for per-device control over AtomicOp
requests. This checks to be sure the Root Port supports completion of the
desired AtomicOp sizes and the path to the Root Port supports routing the
AtomicOps.

Signed-off-by: Jay Cornwall <Jay.Cornwall@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
[bhelgaas: changelog, comments, whitespace]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
6 years agoPCI: Expose ari_enabled in sysfs
Stuart Hayes [Fri, 5 Jan 2018 18:51:55 +0000 (12:51 -0600)]
PCI: Expose ari_enabled in sysfs

Some multifunction PCI devices with more than 8 functions use "alternative
routing-ID interpretation" (ARI), which means the 8-bit device/function
number field will be interpreted as 8 bits specifying the function number
(the device number is 0 implicitly), rather than the upper 5 bits
specifying the device number and the lower 3 bits specifying the function
number. The kernel can enable and use this.

Expose in a sysfs attribute whether the kernel has enabled ARI, so that a
program in userspace won't have to parse PCI devices and PCI configuration
space to figure out if it is enabled. This will allow better predictable
network naming using PCI function numbers without using PCI bus or device
numbers, which is desirable because bus and device numbers can change with
system configuration but function numbers will not.

Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
6 years agoPCI: pciehp: Assume NoCompl+ for Thunderbolt ports
Lukas Wunner [Wed, 17 Jan 2018 15:48:39 +0000 (16:48 +0100)]
PCI: pciehp: Assume NoCompl+ for Thunderbolt ports

Certain Thunderbolt 1 controllers claim to support Command Completed events
(value of 0b in the No Command Completed Support field of the Slot
Capabilities register) but in reality they neither set the Command
Completed bit in the Slot Status register nor signal a Command Completed
interrupt:

  8086:1513  CV82524  [Light Ridge 4C  2010]
  8086:151a  DSL2310  [Eagle Ridge 2C  2011]
  8086:151b  CVL2510  [Light Peak 2C   2010]
  8086:1547  DSL3510  [Cactus Ridge 4C 2012]
  8086:1548  DSL3310  [Cactus Ridge 2C 2012]
  8086:1549  DSL2210  [Port Ridge 1C   2011]

All known newer chips (Redwood Ridge and onwards) set No Command Completed
Support, indicating that they do not support Command Completed events.

The user-visible impact is that after unplugging such a device, 2 seconds
elapse until pciehp is unbound.  That's because on ->remove,
pcie_write_cmd() is called via pcie_disable_notification() and every call
to pcie_write_cmd() takes 2 seconds (1 second for each invocation of
pcie_wait_cmd()):

  [  337.942727] pciehp 0000:0a:00.0:pcie204: Timeout on hotplug command 0x1038 (issued 21176 msec ago)
  [  340.014735] pciehp 0000:0a:00.0:pcie204: Timeout on hotplug command 0x0000 (issued 2072 msec ago)

That by itself has always been unpleasant, but the situation has become
worse with commit cc27b735ad3a ("PCI/portdrv: Turn off PCIe services during
shutdown"):  Now pciehp is unbound on ->shutdown.  Because Thunderbolt
controllers typically have 4 hotplug ports, every reboot and shutdown is
now delayed by 8 seconds, plus another 2 seconds for every attached
Thunderbolt 1 device.

Thunderbolt hotplug slots are not physical slots that one inserts cards
into, but rather logical hotplug slots implemented in silicon.  Devices
appear beyond those logical slots once a PCI tunnel is established on top
of the Thunderbolt Converged I/O switch.  One would expect commands written
to the Slot Control register to be executed immediately by the silicon, so
for simplicity we always assume NoCompl+ for Thunderbolt ports.

Fixes: cc27b735ad3a ("PCI/portdrv: Turn off PCIe services during shutdown")
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: stable@vger.kernel.org # v4.12+
Cc: Sinan Kaya <okaya@codeaurora.org>
Cc: Yehezkel Bernat <yehezkel.bernat@intel.com>
Cc: Michael Jamet <michael.jamet@intel.com>
Cc: Andreas Noever <andreas.noever@gmail.com>
6 years agoPCI: exynos: Fix a potential init_clk_resources NULL pointer dereference
Jaehoon Chung [Mon, 22 Jan 2018 02:28:54 +0000 (11:28 +0900)]
PCI: exynos: Fix a potential init_clk_resources NULL pointer dereference

In order to avoid triggering a NULL pointer dereference in
exynos_pcie_probe() a check must be put in place to detect if
the init_clk_resources hook is initialized before calling it.

Add the respective function pointer check in exynos_pcie_probe().

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
[lorenzo.pieralisi@arm.com: rewrote the commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
6 years agoPCI: Add dummy pci_irqd_intx_xlate() for CONFIG_PCI=n build
Niklas Cassel [Fri, 19 Jan 2018 09:39:06 +0000 (10:39 +0100)]
PCI: Add dummy pci_irqd_intx_xlate() for CONFIG_PCI=n build

Some hardware can operate in either "host" or "endpoint" mode, which means
there can be both a host bridge driver and an endpoint driver for the same
device.  Those drivers share a lot of code, so sometimes they live in the
same source file.

The host bridge driver requires CONFIG_PCI=y because it enumerates PCI
devices below the bridge using the PCI core.  The endpoint driver does not
require CONFIG_PCI=y because it runs in an embedded kernel on the other
side of the device, e.g., on an adapter card.

pci-dra7xx.c contains both host and endpoint drivers.  If we select only
the endpoint driver (CONFIG_PCI=n and CONFIG_PCI_DRA7XX_EP=y), the unneeded
host driver is still compiled.  It references pci_irqd_intx_xlate(), which
is not present when CONFIG_PCI=n, which causes this error:

  drivers/pci/dwc/pci-dra7xx.c:229:11: error: 'pci_irqd_intx_xlate' undeclared here (not in a function)

Add a dummy pci_irqd_intx_xlate() for the CONFIG_PCI=n case.

[bhelgaas: changelog]
Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
6 years agoPCI: Add wrappers for dev_printk()
Frederick Lawler [Thu, 18 Jan 2018 18:55:24 +0000 (12:55 -0600)]
PCI: Add wrappers for dev_printk()

Add PCI-specific dev_printk() wrappers and use them to simplify the code
slightly.  No functional change intended.

Signed-off-by: Frederick Lawler <fred@fredlawl.com>
[bhelgaas: squash into one patch]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
6 years agoPCI: Remove NULL device handling from PCI DMA API
Christoph Hellwig [Wed, 10 Jan 2018 18:03:22 +0000 (19:03 +0100)]
PCI: Remove NULL device handling from PCI DMA API

Historically some ISA drivers used the old PCI DMA API with a NULL pdev
argument, but these days this isn't used and not too useful due to the
per-device DMA ops, so remove it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
6 years agonet: tsi108: Use DMA API properly
Christoph Hellwig [Wed, 10 Jan 2018 18:03:21 +0000 (19:03 +0100)]
net: tsi108: Use DMA API properly

We need to pass a struct device to the DMA API, even if some architectures
still support that for legacy reasons, and should not mix it with the old
PCI DMA API.

Note that the driver also seems to never actually unmap its DMA mappings,
but to fix that we'll need someone more familar with the driver.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
6 years agomedia: ttusb-dec: Remove pci_zalloc_coherent() abuse
Christoph Hellwig [Wed, 10 Jan 2018 18:03:20 +0000 (19:03 +0100)]
media: ttusb-dec: Remove pci_zalloc_coherent() abuse

Switch to a plain kzalloc() instead of pci_zalloc_coherent() to allocate
memory for the USB DMA.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
6 years agomedia: ttusb-budget: Remove pci_zalloc_coherent() abuse
Christoph Hellwig [Wed, 10 Jan 2018 18:03:19 +0000 (19:03 +0100)]
media: ttusb-budget: Remove pci_zalloc_coherent() abuse

Switch to a plain kzalloc() instead of pci_zalloc_coherent() to allocate
memory for the USB DMA.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
6 years agopowerpc/pci: Use of_irq_parse_and_map_pci() helper
Rob Herring [Thu, 4 Jan 2018 21:12:14 +0000 (15:12 -0600)]
powerpc/pci: Use of_irq_parse_and_map_pci() helper

Instead of calling both of_irq_parse_pci() and irq_create_of_mapping(),
call of_irq_parse_and_map_pci(), which does the same thing. This will allow
making of_irq_parse_pci() a private, static function.

This changes the logic slightly in that the fallback path will also be
taken if irq_create_of_mapping() fails internally.

Signed-off-by: Rob Herring <robh@kernel.org>
[bhelgaas: fold in virq init from Stephen Rothwell <sfr@canb.auug.org.au>]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
6 years agoPCI: Move OF-related PCI functions into PCI core
Rob Herring [Wed, 17 Jan 2018 23:36:39 +0000 (17:36 -0600)]
PCI: Move OF-related PCI functions into PCI core

Following what has been done for other subsystems, move the remaining PCI
related code out of drivers/of/ and into drivers/pci/of.c

With this, we can kill a few kconfig symbols.

Signed-off-by: Rob Herring <robh@kernel.org>
[bhelgaas: minor whitespace, comment cleanups]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Frank Rowand <frowand.list@gmail.com>
6 years agoPCI: Remove unnecessary messages for memory allocation failures
Markus Elfring [Fri, 29 Dec 2017 11:15:16 +0000 (12:15 +0100)]
PCI: Remove unnecessary messages for memory allocation failures

Per ebfdc40969f2 ("checkpatch: attempt to find unnecessary 'out of memory'
messages"), when a memory allocation fails, the memory subsystem emits
generic "out of memory" messages (see slab_out_of_memory() for some of this
logging).  Therefore, additional error messages in the caller don't add
much value.

Remove messages that merely report "out of memory".

This preserves some messages that report additional information, e.g.,
allocation failures that mean we drop hotplug events.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
[bhelgaas: changelog, squash patches, make similar changes to acpiphp,
cpqphp, ibmphp, keep warning when dropping hotplug event]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
6 years agovideo: fbdev: riva: deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:38:00 +0000 (00:38 -0500)]
video: fbdev: riva: deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

struct riva_par has a pointer to struct pci_dev. Use the pci_dev member
to extract the domain information.

Change the function signature for CalcStateExt and RivaGetConfig to pass
in struct pci_dev in addition to RIVA_HW_INST so that code inside the
riva_hw.c can also calculate domain number and pass it to
pci_get_domain_bus_and_slot().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
6 years agovideo: fbdev: nvidia: deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:59 +0000 (00:37 -0500)]
video: fbdev: nvidia: deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

struct nvidia_par has a pointer to struct pci_dev. Use the pci_dev
member to extract the domain information and pass it to
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
6 years agovideo: fbdev: intelfb: deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:58 +0000 (00:37 -0500)]
video: fbdev: intelfb: deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Find the domain number from pdev.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
6 years agoopenprom: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:56 +0000 (00:37 -0500)]
openprom: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain as 0 since domain information is not available.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Acked-by: David S. Miller <davem@davemloft.net>
6 years agoxen/pcifront: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:55 +0000 (00:37 -0500)]
xen/pcifront: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Use pci_get_domain_bus_and_slot() with a domain number of 0 where we can't
extract the domain number. Other places, use the actual domain number from
the device.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
6 years agoPCI: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:53 +0000 (00:37 -0500)]
PCI: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

When we have a pci_dev, extract the domain number from it.

The config access syscalls don't allow the user to supply a domain number,
so they only work on devices in domain 0, so we can just hard-code that.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
[bhelgaas: squash quirk & syscall patches together]
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
6 years agoPCI: ibmphp: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:52 +0000 (00:37 -0500)]
PCI: ibmphp: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain parameter as 0 since the code doesn't seem to be
ready for multiple domains.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
6 years agoPCI: cpqhp: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:51 +0000 (00:37 -0500)]
PCI: cpqhp: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain number as 0. The code doesn't seem to be ready
for multiple domains.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
6 years agopch_gbe: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:50 +0000 (00:37 -0500)]
pch_gbe: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use the domain information from pdev while calling into
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Acked-by: David S. Miller <davem@davemloft.net>
6 years agobnx2x: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:49 +0000 (00:37 -0500)]
bnx2x: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Introduce bnx2x_vf_domain() function to extract the domain information
and save it to VF specific data structure.

Use the saved domain value while calling pci_get_domain_bus_and_slot().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Acked-by: David S. Miller <davem@davemloft.net>
6 years agopowerpc/via-pmu: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:48 +0000 (00:37 -0500)]
powerpc/via-pmu: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-code the domain number as 0 to match the previous behavior.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
6 years agoPCI: Add function 1 DMA alias quirk for Marvell 9128
Alex Williamson [Tue, 16 Jan 2018 17:05:26 +0000 (10:05 -0700)]
PCI: Add function 1 DMA alias quirk for Marvell 9128

The Marvell 9128 is the original device generating bug 42679, from which
many other Marvell DMA alias quirks have been sourced, but we didn't have
positive confirmation of the fix on 9128 until now.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=42679
Link: https://www.spinics.net/lists/kvm/msg161459.html
Reported-by: Binarus <lists@binarus.de>
Tested-by: Binarus <lists@binarus.de>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
6 years agoPCI: tegra: Use bus->sysdata to store and get host private data
Manikanta Maddireddy [Thu, 11 Jan 2018 06:08:03 +0000 (11:38 +0530)]
PCI: tegra: Use bus->sysdata to store and get host private data

Tegra host driver is using pci_find_host_bridge() to get private data;
this can be easily avoided by using bus->sysdata to store and get private
data removing the pci_find_host_bridge() dependency.

Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
[lorenzo.pieralisi@arm.com: rewrote commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Thierry Reding <treding@nvidia.com>
6 years agoof: Export of_pci_range_to_resource()
Manikanta Maddireddy [Thu, 11 Jan 2018 06:08:02 +0000 (11:38 +0530)]
of: Export of_pci_range_to_resource()

Some PCIe host drivers parse of_pci_range from device tree and convert
it to resources. Export of_pci_range_to_resource() to allow PCIe host
drivers to be compiled as loadable kernel module.

Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
[lorenzo.pieralisi@arm.com: rewrote commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Rob Herring <robh@kernel.org>
6 years agoPCI: Disable MSI for HiSilicon Hip06/Hip07 only in Root Port mode
Dongdong Liu [Thu, 28 Dec 2017 09:53:32 +0000 (17:53 +0800)]
PCI: Disable MSI for HiSilicon Hip06/Hip07 only in Root Port mode

HiSilicon Hip06/Hip07 can operate as either a Root Port or an Endpoint.  It
always advertises an MSI capability, but it can only generate MSIs when in
Endpoint mode.

The device has the same Vendor and Device IDs in both modes, so check the
Class Code and disable MSI only when operating as a Root Port.

[bhelgaas: changelog]
Fixes: 72f2ff0deb87 ("PCI: Disable MSI for HiSilicon Hip06/Hip07 Root Ports")
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Zhou Wang <wangzhou1@hisilicon.com>
Cc: stable@vger.kernel.org # v4.11+
6 years agoPCI: iproc: Fix NULL pointer dereference for BCMA
Ray Jui [Thu, 11 Jan 2018 20:36:16 +0000 (12:36 -0800)]
PCI: iproc: Fix NULL pointer dereference for BCMA

With the inbound DMA mapping supported added, the iProc PCIe driver
parses DT property "dma-ranges" through call to
"of_pci_dma_range_parser_init()". In the case of BCMA, this results in a
NULL pointer deference due to a missing of_node.

Fix this by adding a guard in pcie-iproc-platform.c to only enable the
inbound DMA mapping logic when DT property "dma-ranges" is present.

Fixes: dd9d4e7498de3 ("PCI: iproc: Add inbound DMA mapping support")
Reported-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Ray Jui <ray.jui@broadcom.com>
[lorenzo.pieralisi@arm.com: updated commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tested-by: Rafał Miłecki <rafal@milecki.pl>
cc: <stable@vger.kernel.org> # 4.10+

6 years agoPCI/AER: Return error if AER is not supported
Keith Busch [Tue, 19 Dec 2017 21:06:40 +0000 (14:06 -0700)]
PCI/AER: Return error if AER is not supported

get_device_error_info() reads error information from registers in the AER
capability.  If we call it for a device that has no AER capability, it
should return an error, but previously it returned success.

Return 0 (error) if the device doesn't have an AER capability.

Signed-off-by: Keith Busch <keith.busch@intel.com>
[bhelgaas: changelog]
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
6 years agoiommu/amd: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:47 +0000 (00:37 -0500)]
iommu/amd: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-code the domain number as 0 for the AMD IOMMU driver.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Reviewed-by: Gary R Hook <gary.hook@amd.com>
Acked-by: Joerg Roedel <jroedel@suse.de>
6 years agosl82c105: deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:46 +0000 (00:37 -0500)]
sl82c105: deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from struct pci_dev.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Acked-by: David S. Miller <davem@davemloft.net>
6 years agodrm/nouveau: deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:45 +0000 (00:37 -0500)]
drm/nouveau: deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from
1. struct pci_dev
2. struct pci_dev through drm_device->pdev
3. struct pci_dev through fb->subdev->drm_device->pdev

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
6 years agodrm/gma500: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:44 +0000 (00:37 -0500)]
drm/gma500: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Add domain parameter to CDV_MSG_READ32, CDV_MSG_WRITE32, MRST_MSG_READ32,
MRST_MSG_WRITE32, MDFLD_MSG_READ32, MDFLD_MSG_WRITE32.

Extract pci_dev from struct drm_device and use pdev to find the domain
number while calling pci_get_domain_bus_and_slot().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
6 years agoibft: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:43 +0000 (00:37 -0500)]
ibft: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

We don't search for the device in other domains than zero. This is because
on x86 platforms the BIOS executes only devices which are in domain 0.
Furthermore, the iBFT spec doesn't have a domain id field.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Acked-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
6 years agoedd: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:42 +0000 (00:37 -0500)]
edd: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Domain number is not available in struct edd_info. Hard-coding the domain
number as 0.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
6 years agoagp: sworks: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Thu, 11 Jan 2018 23:25:15 +0000 (17:25 -0600)]
agp: sworks: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from struct pci_dev.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
6 years agoagp: nvidia: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:41 +0000 (00:37 -0500)]
agp: nvidia: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from struct pci_dev.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
6 years agoata: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:40 +0000 (00:37 -0500)]
ata: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use pci_get_domain_bus_and_slot() and extract the actual domain number
from the pdev passed in.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Acked-by: Tejun Heo <tj@kernel.org>
6 years agox86/PCI: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:39 +0000 (00:37 -0500)]
x86/PCI: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use domain number of 0 as the domain number is not available in struct
irq_routing_table.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
6 years agopowerpc/PCI: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:38 +0000 (00:37 -0500)]
powerpc/PCI: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use pci_get_domain_bus_and_slot() with a domain number of 0 as the code
is not ready to consume multiple domains and existing code used domain
number 0.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
6 years agoalpha/PCI: Deprecate pci_get_bus_and_slot()
Sinan Kaya [Tue, 19 Dec 2017 05:37:37 +0000 (00:37 -0500)]
alpha/PCI: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Use pci_get_domain_bus_and_slot() with a domain number of 0 where we can't
extract the domain number. Other places, use the actual domain number from
the device.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
6 years agoPCI: tegra: Remove PCI_REASSIGN_ALL_BUS use on Tegra
Manikanta Maddireddy [Tue, 9 Jan 2018 09:19:33 +0000 (14:49 +0530)]
PCI: tegra: Remove PCI_REASSIGN_ALL_BUS use on Tegra

Bridge primary, secondary, and subordinate bus numbers power up as zero,
and Tegra firmware doesn't program them.

pci_scan_bridge_extend() automatically programs these bus numbers if they
are zero, so we don't need to set the PCI_REASSIGN_ALL_BUS flag for Tegra.

Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
[bhelgaas: changelog]
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Acked-by: Thierry Reding <treding@nvidia.com>