22 Mar, 2016

1 commit

  • Revert 5c3b99d05752 ("PCI: dra7xx: Mark driver as broken").

    1c96bee4df19 ("ARM: DRA7: hwmod: Add custom reset handler for PCIeSS")
    added support to de-assert PCIe reset, so DRA7x PCIe is not broken anymore.

    Signed-off-by: Sekhar Nori
    Signed-off-by: Kishon Vijay Abraham I
    Signed-off-by: Bjorn Helgaas

    Sekhar Nori
     

21 Mar, 2016

1 commit

  • Commit e7e127e3c767 ("PCI: Include pci/hotplug Kconfig directly from
    pci/Kconfig") added one line to pci/Kconfig. However, for some mysterious
    reason it isn't there now, even though there are no traces of removing it
    in the git log.

    I detected this issue when 'make oldconfig' removed all the options that
    depended on HOTPLUG_PCI.

    [bhelgaas: I botched the cfeb8139a1fb ("Merge branch 'pci/host-hv' into
    next") merge. "git diff cfeb8139a1fb^ cfeb8139a1fb" shows a conflict in
    drivers/pci/Kconfig, and I mistakenly dropped the hotplug/Kconfig piece.]
    Signed-off-by: Tero Roponen
    Signed-off-by: Bjorn Helgaas

    Tero Roponen
     

20 Mar, 2016

1 commit

  • Pull powerpc updates from Michael Ellerman:
    "This was delayed a day or two by some build-breakage on old toolchains
    which we've now fixed.

    There's two PCI commits both acked by Bjorn.

    There's one commit to mm/hugepage.c which is (co)authored by Kirill.

    Highlights:
    - Restructure Linux PTE on Book3S/64 to Radix format from Paul
    Mackerras
    - Book3s 64 MMU cleanup in preparation for Radix MMU from Aneesh
    Kumar K.V
    - Add POWER9 cputable entry from Michael Neuling
    - FPU/Altivec/VSX save/restore optimisations from Cyril Bur
    - Add support for new ftrace ABI on ppc64le from Torsten Duwe

    Various cleanups & minor fixes from:
    - Adam Buchbinder, Andrew Donnellan, Balbir Singh, Christophe Leroy,
    Cyril Bur, Luis Henriques, Madhavan Srinivasan, Pan Xinhui, Russell
    Currey, Sukadev Bhattiprolu, Suraj Jitindar Singh.

    General:
    - atomics: Allow architectures to define their own __atomic_op_*
    helpers from Boqun Feng
    - Implement atomic{, 64}_*_return_* variants and acquire/release/
    relaxed variants for (cmp)xchg from Boqun Feng
    - Add powernv_defconfig from Jeremy Kerr
    - Fix BUG_ON() reporting in real mode from Balbir Singh
    - Add xmon command to dump OPAL msglog from Andrew Donnellan
    - Add xmon command to dump process/task similar to ps(1) from Douglas
    Miller
    - Clean up memory hotplug failure paths from David Gibson

    pci/eeh:
    - Redesign SR-IOV on PowerNV to give absolute isolation between VFs
    from Wei Yang.
    - EEH Support for SRIOV VFs from Wei Yang and Gavin Shan.
    - PCI/IOV: Rename and export virtfn_{add, remove} from Wei Yang
    - PCI: Add pcibios_bus_add_device() weak function from Wei Yang
    - MAINTAINERS: Update EEH details and maintainership from Russell
    Currey

    cxl:
    - Support added to the CXL driver for running on both bare-metal and
    hypervisor systems, from Christophe Lombard and Frederic Barrat.
    - Ignore probes for virtual afu pci devices from Vaibhav Jain

    perf:
    - Export Power8 generic and cache events to sysfs from Sukadev
    Bhattiprolu
    - hv-24x7: Fix usage with chip events, display change in counter
    values, display domain indices in sysfs, eliminate domain suffix in
    event names, from Sukadev Bhattiprolu

    Freescale:
    - Updates from Scott: "Highlights include 8xx optimizations, 32-bit
    checksum optimizations, 86xx consolidation, e5500/e6500 cpu
    hotplug, more fman and other dt bits, and minor fixes/cleanup"

    * tag 'powerpc-4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (179 commits)
    powerpc: Fix unrecoverable SLB miss during restore_math()
    powerpc/8xx: Fix do_mtspr_cpu6() build on older compilers
    powerpc/rcpm: Fix build break when SMP=n
    powerpc/book3e-64: Use hardcoded mttmr opcode
    powerpc/fsl/dts: Add "jedec,spi-nor" flash compatible
    powerpc/T104xRDB: add tdm riser card node to device tree
    powerpc32: PAGE_EXEC required for inittext
    powerpc/mpc85xx: Add pcsphy nodes to FManV3 device tree
    powerpc/mpc85xx: Add MDIO bus muxing support to the board device tree(s)
    powerpc/86xx: Introduce and use common dtsi
    powerpc/86xx: Update device tree
    powerpc/86xx: Move dts files to fsl directory
    powerpc/86xx: Switch to kconfig fragments approach
    powerpc/86xx: Update defconfigs
    powerpc/86xx: Consolidate common platform code
    powerpc32: Remove one insn in mulhdu
    powerpc32: small optimisation in flush_icache_range()
    powerpc: Simplify test in __dma_sync()
    powerpc32: move xxxxx_dcache_range() functions inline
    powerpc32: Remove clear_pages() and define clear_page() inline
    ...

    Linus Torvalds
     

17 Mar, 2016

2 commits

  • Pull PCI updates from Bjorn Helgaas:
    "PCI changes for v4.6:

    Enumeration:
    - Disable IO/MEM decoding for devices with non-compliant BARs (Bjorn Helgaas)
    - Mark Broadwell-EP Home Agent & PCU as having non-compliant BARs (Bjorn Helgaas

    Resource management:
    - Mark shadow copy of VGA ROM as IORESOURCE_PCI_FIXED (Bjorn Helgaas)
    - Don't assign or reassign immutable resources (Bjorn Helgaas)
    - Don't enable/disable ROM BAR if we're using a RAM shadow copy (Bjorn Helgaas)
    - Set ROM shadow location in arch code, not in PCI core (Bjorn Helgaas)
    - Remove arch-specific IORESOURCE_ROM_SHADOW size from sysfs (Bjorn Helgaas)
    - ia64: Use ioremap() instead of open-coded equivalent (Bjorn Helgaas)
    - ia64: Keep CPU physical (not virtual) addresses in shadow ROM resource (Bjorn Helgaas)
    - MIPS: Keep CPU physical (not virtual) addresses in shadow ROM resource (Bjorn Helgaas)
    - Remove unused IORESOURCE_ROM_COPY and IORESOURCE_ROM_BIOS_COPY (Bjorn Helgaas)
    - Don't leak memory if sysfs_create_bin_file() fails (Bjorn Helgaas)
    - rcar: Remove PCI_PROBE_ONLY handling (Lorenzo Pieralisi)
    - designware: Remove PCI_PROBE_ONLY handling (Lorenzo Pieralisi)

    Virtualization:
    - Wait for up to 1000ms after FLR reset (Alex Williamson)
    - Support SR-IOV on any function type (Kelly Zytaruk)
    - Add ACS quirk for all Cavium devices (Manish Jaggi)

    AER:
    - Rename pci_ops_aer to aer_inj_pci_ops (Bjorn Helgaas)
    - Restore pci_ops pointer while calling original pci_ops (David Daney)
    - Fix aer_inject error codes (Jean Delvare)
    - Use dev_warn() in aer_inject (Jean Delvare)
    - Log actual error causes in aer_inject (Jean Delvare)
    - Log aer_inject error injections (Jean Delvare)

    VPD:
    - Prevent VPD access for buggy devices (Babu Moger)
    - Move pci_read_vpd() and pci_write_vpd() close to other VPD code (Bjorn Helgaas)
    - Move pci_vpd_release() from header file to pci/access.c (Bjorn Helgaas)
    - Remove struct pci_vpd_ops.release function pointer (Bjorn Helgaas)
    - Rename VPD symbols to remove unnecessary "pci22" (Bjorn Helgaas)
    - Fold struct pci_vpd_pci22 into struct pci_vpd (Bjorn Helgaas)
    - Sleep rather than busy-wait for VPD access completion (Bjorn Helgaas)
    - Update VPD definitions (Hannes Reinecke)
    - Allow access to VPD attributes with size 0 (Hannes Reinecke)
    - Determine actual VPD size on first access (Hannes Reinecke)

    Generic host bridge driver:
    - Move structure definitions to separate header file (David Daney)
    - Add pci_host_common_probe(), based on gen_pci_probe() (David Daney)
    - Expose pci_host_common_probe() for use by other drivers (David Daney)

    Altera host bridge driver:
    - Fix altera_pcie_link_is_up() (Ley Foon Tan)

    Cavium ThunderX host bridge driver:
    - Add PCIe host driver for ThunderX processors (David Daney)
    - Add driver for ThunderX-pass{1,2} on-chip devices (David Daney)

    Freescale i.MX6 host bridge driver:
    - Add DT bindings to configure PHY Tx driver settings (Justin Waters)
    - Move imx6_pcie_reset_phy() near other PHY handling functions (Lucas Stach)
    - Move PHY reset into imx6_pcie_establish_link() (Lucas Stach)
    - Remove broken Gen2 workaround (Lucas Stach)
    - Move link up check into imx6_pcie_wait_for_link() (Lucas Stach)

    Freescale Layerscape host bridge driver:
    - Add "fsl,ls2085a-pcie" compatible ID (Yang Shi)

    Intel VMD host bridge driver:
    - Attach VMD resources to parent domain's resource tree (Jon Derrick)
    - Set bus resource start to 0 (Keith Busch)

    Microsoft Hyper-V host bridge driver:
    - Add fwnode_handle to x86 pci_sysdata (Jake Oshins)
    - Look up IRQ domain by fwnode_handle (Jake Oshins)
    - Add paravirtual PCI front-end for Microsoft Hyper-V VMs (Jake Oshins)

    NVIDIA Tegra host bridge driver:
    - Add pci_ops.{add,remove}_bus() callbacks (Thierry Reding)
    - Implement ->{add,remove}_bus() callbacks (Thierry Reding)
    - Remove unused struct tegra_pcie.num_ports field (Thierry Reding)
    - Track bus -> CPU mapping (Thierry Reding)
    - Remove misleading PHYS_OFFSET (Thierry Reding)

    Renesas R-Car host bridge driver:
    - Depend on ARCH_RENESAS, not ARCH_SHMOBILE (Simon Horman)

    Synopsys DesignWare host bridge driver:
    - ARC: Add PCI support (Joao Pinto)
    - Add generic dw_pcie_wait_for_link() (Joao Pinto)
    - Add default link up check if sub-driver doesn't override (Joao Pinto)
    - Add driver for prototyping kits based on ARC SDP (Joao Pinto)

    TI Keystone host bridge driver:
    - Defer probing if devm_phy_get() returns -EPROBE_DEFER (Shawn Lin)

    Xilinx AXI host bridge driver:
    - Use of_pci_get_host_bridge_resources() to parse DT (Bharat Kumar Gogada)
    - Remove dependency on ARM-specific struct hw_pci (Bharat Kumar Gogada)
    - Don't call pci_fixup_irqs() on Microblaze (Bharat Kumar Gogada)
    - Update Zynq binding with Microblaze node (Bharat Kumar Gogada)
    - microblaze: Support generic Xilinx AXI PCIe Host Bridge IP driver (Bharat Kumar Gogada)

    Xilinx NWL host bridge driver:
    - Add support for Xilinx NWL PCIe Host Controller (Bharat Kumar Gogada)

    Miscellaneous:
    - Check device_attach() return value always (Bjorn Helgaas)
    - Move pci_set_flags() from asm-generic/pci-bridge.h to linux/pci.h (Bjorn Helgaas)
    - Remove includes of empty asm-generic/pci-bridge.h (Bjorn Helgaas)
    - ARM64: Remove generated include of asm-generic/pci-bridge.h (Bjorn Helgaas)
    - Remove empty asm-generic/pci-bridge.h (Bjorn Helgaas)
    - Remove includes of asm/pci-bridge.h (Bjorn Helgaas)
    - Consolidate PCI DMA constants and interfaces in linux/pci-dma-compat.h (Bjorn Helgaas)
    - unicore32: Remove unused HAVE_ARCH_PCI_SET_DMA_MASK definition (Bjorn Helgaas)
    - Cleanup pci/pcie/Kconfig whitespace (Andreas Ziegler)
    - Include pci/hotplug Kconfig directly from pci/Kconfig (Bjorn Helgaas)
    - Include pci/pcie/Kconfig directly from pci/Kconfig (Bogicevic Sasa)
    - frv: Remove stray pci_{alloc,free}_consistent() declaration (Christoph Hellwig)
    - Move pci_dma_* helpers to common code (Christoph Hellwig)
    - Add PCI_CLASS_SERIAL_USB_DEVICE definition (Heikki Krogerus)
    - Add QEMU top-level IDs for (sub)vendor & device (Robin H. Johnson)
    - Fix broken URL for Dell biosdevname (Naga Venkata Sai Indubhaskar Jupudi)"

    * tag 'pci-v4.6-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (94 commits)
    PCI: Add PCI_CLASS_SERIAL_USB_DEVICE definition
    PCI: designware: Add driver for prototyping kits based on ARC SDP
    PCI: designware: Add default link up check if sub-driver doesn't override
    PCI: designware: Add generic dw_pcie_wait_for_link()
    PCI: Cleanup pci/pcie/Kconfig whitespace
    PCI: Simplify pci_create_attr() control flow
    PCI: Don't leak memory if sysfs_create_bin_file() fails
    PCI: Simplify sysfs ROM cleanup
    PCI: Remove unused IORESOURCE_ROM_COPY and IORESOURCE_ROM_BIOS_COPY
    MIPS: Loongson 3: Keep CPU physical (not virtual) addresses in shadow ROM resource
    MIPS: Loongson 3: Use temporary struct resource * to avoid repetition
    ia64/PCI: Keep CPU physical (not virtual) addresses in shadow ROM resource
    ia64/PCI: Use ioremap() instead of open-coded equivalent
    ia64/PCI: Use temporary struct resource * to avoid repetition
    PCI: Clean up pci_map_rom() whitespace
    PCI: Remove arch-specific IORESOURCE_ROM_SHADOW size from sysfs
    PCI: thunder: Add driver for ThunderX-pass{1,2} on-chip devices
    PCI: thunder: Add PCIe host driver for ThunderX processors
    PCI: generic: Expose pci_host_common_probe() for use by other drivers
    PCI: generic: Add pci_host_common_probe(), based on gen_pci_probe()
    ...

    Linus Torvalds
     
  • Pull s390 updates from Martin Schwidefsky:

    - Add the CPU id for the new z13s machine

    - Add a s390 specific XOR template for RAID-5 checksumming based on the
    XC instruction. Remove all other alternatives, XC is always faster

    - The merge of our four different stack tracers into a single one

    - Tidy up the code related to page tables, several large inline
    functions are now out-of-line. Bloat-o-meter reports ~11K text size
    reduction

    - A binary interface for the priviledged CLP instruction to retrieve
    the hardware view of the installed PCI functions

    - Improvements for the dasd format code

    - Bug fixes and cleanups

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (31 commits)
    s390/pci: enforce fmb page boundary rule
    s390: fix floating pointer register corruption (again)
    s390/cpumf: add missing lpp magic initialization
    s390: Fix misspellings in comments
    s390/mm: split arch/s390/mm/pgtable.c
    s390/mm: uninline pmdp_xxx functions from pgtable.h
    s390/mm: uninline ptep_xxx functions from pgtable.h
    s390/pci: add ioctl interface for CLP
    s390: Use pr_warn instead of pr_warning
    s390/dasd: remove casts to dasd_*_private
    s390/dasd: Refactor dasd format functions
    s390/dasd: Simplify code in format logic
    s390/dasd: Improve dasd format code
    s390/percpu: remove this_cpu_cmpxchg_double_4
    s390/cpumf: Improve guest detection heuristics
    s390/fault: merge report_user_fault implementations
    s390/dis: use correct escape sequence for '%' character
    s390/kvm: simplify set_guest_storage_key
    s390/oprofile: add z13/z13s model numbers
    s390: add z13s model number to z13 elf platform
    ...

    Linus Torvalds
     

15 Mar, 2016

10 commits

  • * pci/resource:
    PCI: Simplify pci_create_attr() control flow
    PCI: Don't leak memory if sysfs_create_bin_file() fails
    PCI: Simplify sysfs ROM cleanup
    PCI: Remove unused IORESOURCE_ROM_COPY and IORESOURCE_ROM_BIOS_COPY
    MIPS: Loongson 3: Keep CPU physical (not virtual) addresses in shadow ROM resource
    MIPS: Loongson 3: Use temporary struct resource * to avoid repetition
    ia64/PCI: Keep CPU physical (not virtual) addresses in shadow ROM resource
    ia64/PCI: Use ioremap() instead of open-coded equivalent
    ia64/PCI: Use temporary struct resource * to avoid repetition
    PCI: Clean up pci_map_rom() whitespace
    PCI: Remove arch-specific IORESOURCE_ROM_SHADOW size from sysfs
    PCI: Set ROM shadow location in arch code, not in PCI core
    PCI: Don't enable/disable ROM BAR if we're using a RAM shadow copy
    PCI: Don't assign or reassign immutable resources
    PCI: Mark shadow copy of VGA ROM as IORESOURCE_PCI_FIXED
    x86/PCI: Mark Broadwell-EP Home Agent & PCU as having non-compliant BARs
    PCI: Disable IO/MEM decoding for devices with non-compliant BARs

    Bjorn Helgaas
     
  • * pci/host-hv:
    PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs
    PCI: Look up IRQ domain by fwnode_handle
    PCI: Add fwnode_handle to x86 pci_sysdata

    Bjorn Helgaas
     
  • * pci/host-designware:
    PCI: designware: Add driver for prototyping kits based on ARC SDP
    PCI: designware: Add default link up check if sub-driver doesn't override
    PCI: designware: Add generic dw_pcie_wait_for_link()
    ARC: Add PCI support

    Bjorn Helgaas
     
  • …t-rcar', 'pci/host-tegra', 'pci/host-thunder', 'pci/host-vmd', 'pci/host-xilinx' and 'pci/host-xilinx-nwl' into next

    * pci/host-altera:
    PCI: altera: Fix altera_pcie_link_is_up()

    * pci/host-imx6:
    PCI: imx6: Add DT bindings to configure PHY Tx driver settings

    * pci/host-keystone:
    PCI: keystone: Defer probing if devm_phy_get() returns -EPROBE_DEFER

    * pci/host-rcar:
    PCI: rcar: Depend on ARCH_RENESAS, not ARCH_SHMOBILE

    * pci/host-tegra:
    PCI: tegra: Remove misleading PHYS_OFFSET
    PCI: tegra: Track bus -> CPU mapping
    PCI: tegra: Remove unused struct tegra_pcie.num_ports field
    PCI: tegra: Implement ->{add,remove}_bus() callbacks
    PCI: Add pci_ops.{add,remove}_bus() callbacks

    * pci/host-thunder:
    PCI: thunder: Add driver for ThunderX-pass{1,2} on-chip devices
    PCI: thunder: Add PCIe host driver for ThunderX processors
    PCI: generic: Expose pci_host_common_probe() for use by other drivers
    PCI: generic: Add pci_host_common_probe(), based on gen_pci_probe()
    PCI: generic: Move structure definitions to separate header file

    * pci/host-vmd:
    x86/PCI: VMD: Attach VMD resources to parent domain's resource tree
    x86/PCI: VMD: Set bus resource start to 0
    x86/PCI: VMD: Document code for maintainability

    * pci/host-xilinx:
    microblaze/PCI: Support generic Xilinx AXI PCIe Host Bridge IP driver
    PCI: xilinx: Update Zynq binding with Microblaze node
    PCI: xilinx: Don't call pci_fixup_irqs() on Microblaze
    PCI: xilinx: Remove dependency on ARM-specific struct hw_pci
    PCI: xilinx: Use of_pci_get_host_bridge_resources() to parse DT

    * pci/host-xilinx-nwl:
    PCI: xilinx-nwl: Add support for Xilinx NWL PCIe Host Controller

    Bjorn Helgaas
     
  • …tualization' and 'pci/vpd' into next

    * pci/aer:
    PCI/AER: Log aer_inject error injections
    PCI/AER: Log actual error causes in aer_inject
    PCI/AER: Use dev_warn() in aer_inject
    PCI/AER: Fix aer_inject error codes

    * pci/enumeration:
    PCI: Fix broken URL for Dell biosdevname

    * pci/kconfig:
    PCI: Cleanup pci/pcie/Kconfig whitespace
    PCI: Include pci/hotplug Kconfig directly from pci/Kconfig
    PCI: Include pci/pcie/Kconfig directly from pci/Kconfig

    * pci/misc:
    PCI: Add PCI_CLASS_SERIAL_USB_DEVICE definition
    PCI: Add QEMU top-level IDs for (sub)vendor & device
    unicore32: Remove unused HAVE_ARCH_PCI_SET_DMA_MASK definition
    PCI: Consolidate PCI DMA constants and interfaces in linux/pci-dma-compat.h
    PCI: Move pci_dma_* helpers to common code
    frv/PCI: Remove stray pci_{alloc,free}_consistent() declaration

    * pci/virtualization:
    PCI: Wait for up to 1000ms after FLR reset
    PCI: Support SR-IOV on any function type

    * pci/vpd:
    PCI: Prevent VPD access for buggy devices
    PCI: Sleep rather than busy-wait for VPD access completion
    PCI: Fold struct pci_vpd_pci22 into struct pci_vpd
    PCI: Rename VPD symbols to remove unnecessary "pci22"
    PCI: Remove struct pci_vpd_ops.release function pointer
    PCI: Move pci_vpd_release() from header file to pci/access.c
    PCI: Move pci_read_vpd() and pci_write_vpd() close to other VPD code
    PCI: Determine actual VPD size on first access
    PCI: Use bitfield instead of bool for struct pci_vpd_pci22.busy
    PCI: Allow access to VPD attributes with size 0
    PCI: Update VPD definitions

    Bjorn Helgaas
     
  • PCI-SIG has defined Interface FEh for Base Class 0Ch, Sub-Class 03h as "USB
    Device (not host controller)". It is already being used in various USB
    device controller drivers for matching, so add PCI_CLASS_SERIAL_USB_DEVICE
    and use it.

    Signed-off-by: Heikki Krogerus
    Signed-off-by: Bjorn Helgaas

    Heikki Krogerus
     
  • Add a reference platform driver for PCI RC IP Protoyping Kits based on the
    ARC SDP.

    [bhelgaas: changelog, split patch up, MAINTAINERS update]
    Signed-off-by: Joao Pinto
    Signed-off-by: Bjorn Helgaas
    Acked-by: Pratyush Anand

    Joao Pinto
     
  • Add a default DesignWare "link_up" test for use when a sub-driver doesn't
    supply its own pcie_host_ops.link_up() method.

    [bhelgaas: changelog, split into its own patch]
    Signed-off-by: Joao Pinto
    Signed-off-by: Bjorn Helgaas
    Acked-by: Pratyush Anand

    Joao Pinto
     
  • Several DesignWare-based drivers (dra7xx, exynos, imx6, keystone, qcom, and
    spear13xx) had similar loops waiting for the link to come up.

    Add a generic dw_pcie_wait_for_link() for use by all these drivers so the
    waiting is done consistently, e.g., always using usleep_range() rather than
    mdelay() and using similar timeouts and retry counts.

    Note that this changes the Keystone link training/wait for link strategy,
    so we initiate link training, then wait longer for the link to come up
    before re-initiating link training.

    [bhelgaas: changelog, split into its own patch, update pci-keystone.c, pcie-qcom.c]
    Signed-off-by: Joao Pinto
    Signed-off-by: Bjorn Helgaas
    Acked-by: Pratyush Anand

    Joao Pinto
     
  • Clean up style issues in drivers/pci/pcie/Kconfig, in particular all
    indentation is now done using tabs, not spaces, and the definition of
    PCIEASPM_DEBUG is now separated from the definition of PCIEASPM with a
    newline.

    Signed-off-by: Andreas Ziegler
    Signed-off-by: Bjorn Helgaas

    Andreas Ziegler
     

12 Mar, 2016

15 commits

  • Return error immediately to simplify the control flow in pci_create_attr().
    No functional change intended.

    Signed-off-by: Bjorn Helgaas

    Bjorn Helgaas
     
  • If sysfs_create_bin_file() fails, pci_create_attr() leaks the struct
    bin_attribute it allocated previously.

    Free the struct bin_attribute if pci_create_attr() fails.

    Signed-off-by: Bjorn Helgaas

    Bjorn Helgaas
     
  • The value of pdev->rom_attr is the definitive indicator of the fact that
    we're created a sysfs attribute. Check that rather than rom_size, which is
    only used incidentally when deciding whether to create a sysfs attribute.

    Signed-off-by: Bjorn Helgaas

    Bjorn Helgaas
     
  • The IORESOURCE_ROM_COPY and IORESOURCE_ROM_BIOS_COPY bits are unused.
    Remove them and code that depends on them.

    Signed-off-by: Bjorn Helgaas

    Bjorn Helgaas
     
  • Remove unnecessary indentation in pci_map_rom(). This is logically part of
    the previous patch; I split it out to make the critical changes in that
    patch more obvious. No functional change intended.

    Signed-off-by: Bjorn Helgaas

    Bjorn Helgaas
     
  • When pci_create_sysfs_dev_files() created the "rom" sysfs file, it set the
    sysfs file size to the actual size of a ROM BAR, or if there was no ROM BAR
    but the platform provided a shadow copy in RAM, to 0x20000. 0x20000 is an
    arch-specific length that should not be baked into the PCI core.

    Every place that sets IORESOURCE_ROM_SHADOW also sets the size of the
    PCI_ROM_RESOURCE, so use the resource length always.

    Signed-off-by: Bjorn Helgaas

    Bjorn Helgaas
     
  • The cavium,pci-thunder-ecam devices are exactly ECAM-based PCI root
    complexes. These root complexes (loosely referred to as ECAM units in the
    hardware manuals) are used to access the Thunder on-chip devices. They
    are special in that all the BARs on devices behind these root complexes are
    at fixed addresses.

    Add a driver for these devices that synthesizes Enhanced Allocation (EA)
    capability entries for each BAR.

    Since this EA synthesis is needed for exactly two chip models, we can hard-
    code some assumptions about the device topology and the layout of the
    config space of specific DEVFNs in the driver.

    [bhelgaas: changelog, whitespace]
    Signed-off-by: David Daney
    Signed-off-by: Bjorn Helgaas
    Acked-by: Rob Herring

    David Daney
     
  • The root complexes used to access off-chip PCIe devices (called PEM units
    in the hardware manuals) on some Cavium ThunderX processors require quirky
    access methods for the config space of the PCIe bridge.

    Add a driver to provide these config space accessor functions. Use the
    pci-host-common code to configure the PCI machinery.

    Signed-off-by: David Daney
    Signed-off-by: Bjorn Helgaas
    Acked-by: Rob Herring
    Acked-by: Arnd Bergmann

    David Daney
     
  • Move pci_host_common_probe() and associated functions to pci-host-common.c,
    where it can be shared with other drivers. Make it public (not static)
    and update Kconfig and Makefile to build it. No functional change
    intended.

    [bhelgaas: split into separate patch, changelog]
    Signed-off-by: David Daney
    Signed-off-by: Bjorn Helgaas
    Acked-by: Arnd Bergmann
    Acked-by: Will Deacon

    David Daney
     
  • Factor gen_pci_probe(), moving most of it into pci_host_common_probe()
    where it can be shared with other drivers that have slightly different
    config accessors. No functional change intended.

    [bhelgaas: split into separate patch, changelog]
    Signed-off-by: David Daney
    Signed-off-by: Bjorn Helgaas
    Acked-by: Arnd Bergmann
    Acked-by: Will Deacon

    David Daney
     
  • Move definitions for generic PCI host controller driver structures to a
    separate header file so we can share them with other drivers. No
    functional change intended.

    [bhelgaas: split into separate patch, changelog]
    Signed-off-by: David Daney
    Signed-off-by: Bjorn Helgaas
    Acked-by: Arnd Bergmann
    Acked-by: Will Deacon

    David Daney
     
  • Add PCIe Root Port driver for Xilinx PCIe NWL bridge IP.

    [bhelgaas: wait for link like dw_pcie_wait_for_link(), simplify bitmap
    error path, typos, whitespace, fold in Dan Carpenter's PTR_ERR() fix]
    Signed-off-by: Bharat Kumar Gogada
    Signed-off-by: Ravi Kiran Gummaluri
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Marc Zyngier
    Acked-by: Rob Herring

    Bharat Kumar Gogada
     
  • A SerDes PHY is optional, so if devm_phy_get() doesn't find one at all,
    that's fine. But if devm_phy_get() finds a PHY that doesn't have a driver
    yet, it returns -EPROBE_DEFER. In that case, defer probing the Keystone
    driver. We may be able to load it later after a PHY driver is loaded.

    [bhelgaas: changelog, check for -EPROBE_DEFER first]
    Signed-off-by: Shawn Lin
    Signed-off-by: Bjorn Helgaas

    Shawn Lin
     
  • Originally altera_pcie_link_is_up() decided the link was up if any of the
    low four bits of the LTSSM register were set. But the link is only up if
    the LTSSM state is L0, so check for that exact value.

    [bhelgaas: changelog]
    Signed-off-by: Ley Foon Tan
    Signed-off-by: Bjorn Helgaas

    Ley Foon Tan
     
  • Make the R-Car drivers depend on ARCH_RENESAS instead of ARCH_SHMOBILE.

    This is part of an ongoing process to migrate from ARCH_SHMOBILE to
    ARCH_RENESAS. The motivation is that RENESAS seems to be a more
    appropriate name than SHMOBILE for the majority of Renesas ARM-based SoCs.

    Signed-off-by: Simon Horman
    Signed-off-by: Bjorn Helgaas
    Acked-by: Geert Uytterhoeven

    Simon Horman
     

11 Mar, 2016

4 commits

  • Some devices take longer than the spec indicates to return from FLR reset,
    a notable case of this is Intel integrated graphics (IGD), which can often
    take an additional 300ms powering down an attached LCD panel as part of the
    FLR. Allow devices up to 1000ms, testing every 100ms whether the second
    dword of config space is read as -1.

    Signed-off-by: Alex Williamson
    Signed-off-by: Bjorn Helgaas

    Alex Williamson
     
  • Add PCI support to ARC and update drivers/pci Makefile enabling the ARC
    arch to use the generic PCI setup functions.

    [bhelgaas: fold in Joao's pci-dma-compat.h & pci-bridge.h build fix (I
    should have caught this myself, sorry]
    Signed-off-by: Joao Pinto
    Signed-off-by: Bjorn Helgaas
    Acked-by: Vineet Gupta

    Joao Pinto
     
  • On some devices, reading or writing VPD causes a system panic.
    This can be easily reproduced by running "lspci -vvv" or
    "cat /sys/bus/devices/XX../vpd".

    Blacklist these devices so we don't access VPD data at all.

    [bhelgaas: changelog, comment, drop pci/access.c changes]
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=110681
    Tested-by: Shane Seymour
    Tested-by: Babu Moger
    Signed-off-by: Babu Moger
    Signed-off-by: Hannes Reinecke
    Signed-off-by: Bjorn Helgaas
    Cc: Alexander Duyck

    Babu Moger
     
  • Use usleep_range() instead of udelay() while waiting for a VPD access to
    complete. This is not a performance path, so no need to hog the CPU.

    Rationale for usleep_range() parameters:

    We clear PCI_VPD_ADDR_F for a read (or set it for a write), then wait for
    the device to change it. For a device that updates PCI_VPD_ADDR between
    our config write and subsequent config read, we won't sleep at all and
    can get the device's maximum rate.

    Sleeping a minimum of 10 usec per 4-byte access limits throughput to
    about 400Kbytes/second. VPD is small (32K bytes at most), and most
    devices use only a fraction of that.

    We back off exponentially up to 1024 usec per iteration. If we reach
    1024, we've already waited up to 1008 usec (16 + 32 + ... + 512), so if
    we miss an update and wait an extra 1024 usec, we can still get about
    1/2 of the device's maximum rate.

    Tested-by: Shane Seymour
    Tested-by: Babu Moger
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Hannes Reinecke

    Bjorn Helgaas
     

10 Mar, 2016

1 commit

  • Pull PCI fix from Bjorn Helgaas:
    "Here's another fix for v4.5. It fixes an ARM regression in v4.0 that
    causes many boxes to crash on boot, including cns3xxx, dove,
    footbridge, iopl13xx, ip32x, iop33x, ixp4xx, ks8695, mv78xx0, orion5x,
    pxa, sa1100, etc.

    The change is in code that's only built for ARM and ARM64.

    Summary:

    Enumeration:
    Allow generic PCI domains without bridge "parent" pointer (Krzysztof Hałasa)"

    * tag 'pci-v4.5-fixes-5' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
    PCI: Allow a NULL "parent" pointer in pci_bus_assign_domain_nr()

    Linus Torvalds
     

09 Mar, 2016

5 commits

  • This adds weak function pcibios_bus_add_device() for arch dependent
    code could do proper setup. For example, powerpc could setup EEH
    related resources for SRIOV VFs.

    Signed-off-by: Wei Yang
    Reviewed-by: Gavin Shan
    Acked-by: Bjorn Helgaas
    Signed-off-by: Michael Ellerman

    Wei Yang
     
  • During EEH recovery, hotplug is applied to the devices which don't
    have drivers or their drivers don't support EEH. However, the hotplug,
    which was implemented based on PCI bus, can't be applied to VF directly.
    Instead, we unplug and plug individual PCI devices (VFs).

    This renames virtn_{add,remove}() and exports them so they can be used
    in PCI hotplug during EEH recovery.

    Signed-off-by: Wei Yang
    Reviewed-by: Gavin Shan
    Acked-by: Bjorn Helgaas
    Signed-off-by: Michael Ellerman

    Wei Yang
     
  • Log successful error injections so that injected errors can be
    differentiated from real errors.

    Suggested-by: Bjorn Helgaas
    Signed-off-by: Jean Delvare
    Signed-off-by: Bjorn Helgaas
    CC: Borislav Petkov

    Jean Delvare
     
  • The aer_inject driver is very quiet. In most cases, it merely returns an
    error code to user-space, leaving the user with little clue about the
    actual reason for the failure.

    So, log error messages for 4 of the most frequent causes of failure:
    * Can't find the root port of the specified device.
    * Device doesn't support AER.
    * Root port doesn't support AER.
    * AER device not found.

    This gives the user a chance to understand why aer-inject failed.

    Based on a preliminary patch by Thomas Renninger.

    Signed-off-by: Jean Delvare
    Signed-off-by: Bjorn Helgaas
    CC: Borislav Petkov
    CC: Thomas Renninger

    Jean Delvare
     
  • dev_warn() is better than printk(LOG_WARNING...) as it records which device
    the message relates to. Also add a prefix "aer_inject:" to help
    differentiate real errors from injected errors.

    Signed-off-by: Jean Delvare
    Signed-off-by: Bjorn Helgaas
    CC: Borislav Petkov

    Jean Delvare