28 Apr, 2017

1 commit

  • Many PCI host controller drivers aren't prepared to have their devices
    unbound from them forcefully (e.g., through /sys/...//unbind), as
    they don't provide any driver .remove callback, where they'd detach the
    root bus, release resources, etc. Keeping the driver built in (i.e., not a
    loadable module) is not enough; and providing no .remove callback just
    means we don't do any teardown.

    To rule out the possibility of unbinding a device via sysfs, we need to set
    the ".suppress_bind_attrs" field.

    I found the suspect drivers via the following search:

    git grep -l platform_driver $(git grep -L -e '\.remove' -e suppress_bind_attrs drivers/pci/)

    Then I inspected them to ensure that
    (a) they set up a PCI bus in their probe() and
    (b) they don't have a remove() callback for undoing the setup

    Suggested-by: Bjorn Helgaas
    Signed-off-by: Brian Norris
    Signed-off-by: Bjorn Helgaas

    Brian Norris
     

25 Apr, 2017

1 commit

  • PCI configuration space should be mapped with a memory region type that
    generates on the CPU host bus non-posted write transations. Update the
    driver to use the devm_pci_remap_cfg* interface to make sure the correct
    memory mappings for PCI configuration space are used.

    Signed-off-by: Lorenzo Pieralisi
    Signed-off-by: Bjorn Helgaas
    Cc: Tanmay Inamdar

    Lorenzo Pieralisi
     

11 Feb, 2017

1 commit


31 Jan, 2017

1 commit

  • The "port" variable was allocated with devm_kzalloc() so if we free it with
    kfree() it will be freed twice. Also I changed it to propogate the error
    from devm_ioremap_resource() instead of returning -ENOMEM.

    Fixes: c5d460396100 ("PCI: Add MCFG quirks for X-Gene host controller")
    Also-posted-by: Shawn Lin
    Signed-off-by: Dan Carpenter
    Signed-off-by: Bjorn Helgaas
    Acked-by: Tanmay Inamdar

    Dan Carpenter
     

07 Dec, 2016

1 commit

  • PCIe controllers in X-Gene SoCs are not ECAM compliant: software needs to
    configure additional controller's register to address device at
    bus:dev:function.

    Add a quirk to discover controller MMIO register space and configure
    controller registers to select and address the target secondary device.

    The quirk will only be applied for X-Gene PCIe MCFG table with
    OEM revison 1, 2, 3 or 4 (PCIe controller v1 and v2 on X-Gene SoCs).

    Tested-by: Jon Masters
    Signed-off-by: Duc Dang
    Signed-off-by: Bjorn Helgaas

    Duc Dang
     

12 Oct, 2016

3 commits


11 Oct, 2016

1 commit


02 Aug, 2016

2 commits

  • * pci/demodularize-hosts:
    PCI: xgene: Make explicitly non-modular
    PCI: thunder-pem: Make explicitly non-modular
    PCI: thunder-ecam: Make explicitly non-modular
    PCI: tegra: Make explicitly non-modular
    PCI: rcar-gen2: Make explicitly non-modular
    PCI: rcar: Make explicitly non-modular
    PCI: mvebu: Make explicitly non-modular
    PCI: layerscape: Make explicitly non-modular
    PCI: keystone: Make explicitly non-modular
    PCI: hisi: Make explicitly non-modular
    PCI: generic: Make explicitly non-modular
    PCI: designware-plat: Make it explicitly non-modular
    PCI: artpec6: Make explicitly non-modular
    PCI: armada8k: Make explicitly non-modular
    PCI: artpec: Add PCI_MSI_IRQ_DOMAIN dependency
    PCI: artpec: Add Axis ARTPEC-6 PCIe controller driver
    PCI: Add DT binding for Axis ARTPEC-6 PCIe controller
    PCI: generic: Select IRQ_DOMAIN

    * pci/host-request-windows:
    PCI: versatile: Simplify host bridge window iteration
    PCI: versatile: Request host bridge window resources with core function
    PCI: tegra: Request host bridge window resources with core function
    PCI: tegra: Remove top-level resource from hierarchy
    PCI: rcar: Simplify host bridge window iteration
    PCI: rcar: Request host bridge window resources with core function
    PCI: rcar Gen2: Request host bridge window resources
    PCI: rcar: Drop gen2 dummy I/O port region
    ARM: Make PCI I/O space optional
    PCI: mvebu: Request host bridge window resources with core function
    PCI: generic: Simplify host bridge window iteration
    PCI: generic: Request host bridge window resources with core function
    PCI: altera: Simplify host bridge window iteration
    PCI: altera: Request host bridge window resources with core function
    PCI: xilinx-nwl: Use dev_printk() when possible
    PCI: xilinx-nwl: Request host bridge window resources
    PCI: xilinx-nwl: Free bridge resource list on failure
    PCI: xilinx: Request host bridge window resources
    PCI: xilinx: Free bridge resource list on failure
    PCI: xgene: Request host bridge window resources
    PCI: xgene: Free bridge resource list on failure
    PCI: iproc: Request host bridge window resources
    PCI: designware: Simplify host bridge window iteration
    PCI: designware: Request host bridge window resources
    PCI: designware: Free bridge resource list on failure
    PCI: Add devm_request_pci_bus_resources()

    Bjorn Helgaas
     
  • This code is not being built as a module by anyone:

    drivers/pci/host/Kconfig:config PCI_XGENE
    drivers/pci/host/Kconfig: bool "X-Gene PCIe controller"

    Remove uses of MODULE_DESCRIPTION(), MODULE_AUTHOR(), MODULE_LICENSE(),
    etc., so that when reading the driver there is no doubt it is builtin-only.
    The information is preserved in comments at the top of the file.

    Replace module_platform_driver() with builtin_platform_driver(), which uses
    the same init level priority, so init ordering is unchanged.

    [bhelgaas: changelog]
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Bjorn Helgaas
    CC: Tanmay Inamdar

    Paul Gortmaker
     

21 Jun, 2016

2 commits

  • Request host bridge window resources so they appear in ioport_resource and
    iomem_resource and are reflected in /proc/ioports and /proc/iomem.

    For example, the following entries did not previously appear in /proc/iomem:

    e180000000-e1ffffffff : /soc/pcie@1f2b0000
    e180000000-e182ffffff : PCI Bus 0000:01
    e180000000-e181ffffff : 0000:01:00.0
    e182000000-e1820fffff : 0000:01:00.0
    e182100000-e1821fffff : 0000:01:00.0
    f000000000-ffffffffff : /soc/pcie@1f2b0000

    Signed-off-by: Bjorn Helgaas

    Bjorn Helgaas
     
  • of_pci_get_host_bridge_resources() allocates a list of resources for host
    bridge windows. If we fail after allocating that list, free it before we
    return error.

    Signed-off-by: Bjorn Helgaas

    Bjorn Helgaas
     

26 Sep, 2015

1 commit

  • After 8d63bc7beaee ("PCI/MSI: pci-xgene-msi: Get rid of struct
    msi_controller"), it is no longer required to assign msi_controller for
    X-Gene PCIe host bridge to support MSI.

    Remove this unnecessary code. This also avoids a warning message ("failed
    to enable MSI") during boot.

    [bhelgaas: changelog]
    Signed-off-by: Duc Dang
    Signed-off-by: Bjorn Helgaas
    Acked-by: Marc Zyngier
    Cc: Tanmay Inamdar

    Duc Dang
     

29 Aug, 2015

1 commit

  • * pci/enumeration:
    PCI: Set MPS to match upstream bridge
    PCI: Move MPS configuration check to pci_configure_device()
    PCI: Drop references acquired by of_parse_phandle()
    PCI/MSI: Remove unused pcibios_msi_controller() hook
    ARM/PCI: Remove msi_controller from struct pci_sys_data
    ARM/PCI, designware, xilinx: Use pci_scan_root_bus_msi()
    PCI: Add pci_scan_root_bus_msi()
    ARM/PCI: Replace panic with WARN messages on failures
    PCI: generic: Add arm64 support
    PCI: Build setup-irq.o for arm64
    PCI: generic: Remove dependency on ARM-specific struct hw_pci
    ARM/PCI: Set MPS before pci_bus_add_devices()

    * pci/misc:
    PCI: Disable async suspend/resume for JMicron multi-function SATA/AHCI

    Bjorn Helgaas
     

21 Aug, 2015

1 commit


22 Jul, 2015

1 commit


19 Jun, 2015

2 commits

  • Previously, when a Root Port's link was down, we didn't allow config access
    to the Root Port, which meant that if the Root Port led to an empty slot,
    "lspci" didn't even show the Root Port.

    Allow config access to Root Port even when link is down.

    [bhelgaas: changelog, fold in unused var fix]
    Suggested-by: Bjorn Helgaas
    Signed-off-by: Duc Dang
    Signed-off-by: Tanmay Inamdar
    Signed-off-by: Bjorn Helgaas

    Duc Dang
     
  • When a CPU reads the Vendor and Device ID of a non-existent device, the
    controller should fabricate return data of 0xFFFFFFFF. Configuration
    Request Retry Status (CRS) is not applicable in this case because the
    device doesn't exist at all.

    The X-Gene v1 PCIe controller has a bug in the CRS logic such that when CRS
    is enabled, it fabricates return data of 0xFFFF0001 for this case, which
    means "the device exists but is not ready." That causes the PCI core to
    retry the read until it times out after 60 seconds.

    Disable CRS capability advertisement by clearing the CRS Software
    Visibility bit in the Root Capabilities Register.

    [bhelgaas: changelog and comment]
    Tested-by: Ian Campbell
    Tested-by: Marcin Juszkiewicz
    Signed-off-by: Duc Dang
    Signed-off-by: Bjorn Helgaas
    Acked-by: Tanmay Inamdar

    Duc Dang
     

06 Jun, 2015

1 commit

  • APM X-Gene v1 SoC supports its own implementation of MSI, which is not
    compliant to GIC V2M specification for MSI Termination.

    There is a single MSI block in X-Gene v1 SOC which serves all 5 PCIe ports.
    This MSI block supports 2048 MSI termination ports coalesced into 16
    physical HW IRQ lines and shared across all 5 PCIe ports.

    As there are only 16 HW IRQs to serve 2048 MSI vectors, to support
    set_affinity correctly for each MSI vectors, the 16 HW IRQs are statically
    allocated to 8 X-Gene v1 cores (2 HW IRQs for each cores). To steer MSI
    interrupt to target CPU, MSI vector is moved around these HW IRQs lines.
    With this approach, the total MSI vectors this driver supports is reduced
    to 256.

    [bhelgaas: squash doc, driver, maintainer update]
    Signed-off-by: Duc Dang
    Signed-off-by: Tanmay Inamdar
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Marc Zyngier

    Duc Dang
     

06 Mar, 2015

1 commit

  • In xgene_pcie_map_bus(), we neglected to add in the register offset when
    calculating the config space address. This means all config accesses
    operated on the first four bytes of config space.

    Add the register offset to the config space base address.

    Also correct the xgene_pcie_map_bus() prototype to fix a compiler warning.

    [bhelgaas: changelog]
    Fixes: 350f8be5bb40 ("PCI: xgene: Convert to use generic config accessors")
    Posting: http://lkml.kernel.org/r/1424214840-26498-1-git-send-email-fkan@apm.com
    Signed-off-by: Feng Kan
    Signed-off-by: Bjorn Helgaas
    Acked-by: Tanmay Inamdar
    Acked-by: Rob Herring

    Feng Kan
     

11 Feb, 2015

1 commit

  • Pull ACPI and power management updates from Rafael Wysocki:
    "We have a few new features this time, including a new SFI-based
    cpufreq driver, a new devfreq driver for Tegra Activity Monitor, a new
    devfreq class for providing its governors with raw utilization data
    and a new ACPI driver for AMD SoCs.

    Still, the majority of changes here are reworks of existing code to
    make it more straightforward or to prepare it for implementing new
    features on top of it. The primary example is the rework of ACPI
    resources handling from Jiang Liu, Thomas Gleixner and Lv Zheng with
    support for IOAPIC hotplug implemented on top of it, but there is
    quite a number of changes of this kind in the cpufreq core, ACPICA,
    ACPI EC driver, ACPI processor driver and the generic power domains
    core code too.

    The most active developer is Viresh Kumar with his cpufreq changes.

    Specifics:

    - Rework of the core ACPI resources parsing code to fix issues in it
    and make using resource offsets more convenient and consolidation
    of some resource-handing code in a couple of places that have grown
    analagous data structures and code to cover the the same gap in the
    core (Jiang Liu, Thomas Gleixner, Lv Zheng).

    - ACPI-based IOAPIC hotplug support on top of the resources handling
    rework (Jiang Liu, Yinghai Lu).

    - ACPICA update to upstream release 20150204 including an interrupt
    handling rework that allows drivers to install raw handlers for
    ACPI GPEs which then become entirely responsible for the given GPE
    and the ACPICA core code won't touch it (Lv Zheng, David E Box,
    Octavian Purdila).

    - ACPI EC driver rework to fix several concurrency issues and other
    problems related to events handling on top of the ACPICA's new
    support for raw GPE handlers (Lv Zheng).

    - New ACPI driver for AMD SoCs analogous to the LPSS (Low-Power
    Subsystem) driver for Intel chips (Ken Xue).

    - Two minor fixes of the ACPI LPSS driver (Heikki Krogerus, Jarkko
    Nikula).

    - Two new blacklist entries for machines (Samsung 730U3E/740U3E and
    510R) where the native backlight interface doesn't work correctly
    while the ACPI one does (Hans de Goede).

    - Rework of the ACPI processor driver's handling of idle states to
    make the code more straightforward and less bloated overall (Rafael
    J Wysocki).

    - Assorted minor fixes related to ACPI and SFI (Andreas Ruprecht,
    Andy Shevchenko, Hanjun Guo, Jan Beulich, Rafael J Wysocki, Yaowei
    Bai).

    - PCI core power management modification to avoid resuming (some)
    runtime-suspended devices during system suspend if they are in the
    right states already (Rafael J Wysocki).

    - New SFI-based cpufreq driver for Intel platforms using SFI
    (Srinidhi Kasagar).

    - cpufreq core fixes, cleanups and simplifications (Viresh Kumar,
    Doug Anderson, Wolfram Sang).

    - SkyLake CPU support and other updates for the intel_pstate driver
    (Kristen Carlson Accardi, Srinivas Pandruvada).

    - cpufreq-dt driver cleanup (Markus Elfring).

    - Init fix for the ARM big.LITTLE cpuidle driver (Sudeep Holla).

    - Generic power domains core code fixes and cleanups (Ulf Hansson).

    - Operating Performance Points (OPP) core code cleanups and kernel
    documentation update (Nishanth Menon).

    - New dabugfs interface to make the list of PM QoS constraints
    available to user space (Nishanth Menon).

    - New devfreq driver for Tegra Activity Monitor (Tomeu Vizoso).

    - New devfreq class (devfreq_event) to provide raw utilization data
    to devfreq governors (Chanwoo Choi).

    - Assorted minor fixes and cleanups related to power management
    (Andreas Ruprecht, Krzysztof Kozlowski, Rickard Strandqvist, Pavel
    Machek, Todd E Brandt, Wonhong Kwon).

    - turbostat updates (Len Brown) and cpupower Makefile improvement
    (Sriram Raghunathan)"

    * tag 'pm+acpi-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (151 commits)
    tools/power turbostat: relax dependency on APERF_MSR
    tools/power turbostat: relax dependency on invariant TSC
    Merge branch 'pci/host-generic' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci into acpi-resources
    tools/power turbostat: decode MSR_*_PERF_LIMIT_REASONS
    tools/power turbostat: relax dependency on root permission
    ACPI / video: Add disable_native_backlight quirk for Samsung 510R
    ACPI / PM: Remove unneeded nested #ifdef
    USB / PM: Remove unneeded #ifdef and associated dead code
    intel_pstate: provide option to only use intel_pstate with HWP
    ACPI / EC: Add GPE reference counting debugging messages
    ACPI / EC: Add query flushing support
    ACPI / EC: Refine command storm prevention support
    ACPI / EC: Add command flushing support.
    ACPI / EC: Introduce STARTED/STOPPED flags to replace BLOCKED flag
    ACPI: add AMD ACPI2Platform device support for x86 system
    ACPI / table: remove duplicate NULL check for the handler of acpi_table_parse()
    ACPI / EC: Update revision due to raw handler mode.
    ACPI / EC: Reduce ec_poll() by referencing the last register access timestamp.
    ACPI / EC: Fix several GPE handling issues by deploying ACPI_GPE_DISPATCH_RAW_HANDLER mode.
    ACPICA: Events: Enable APIs to allow interrupt/polling adaptive request based GPE handling model
    ...

    Linus Torvalds
     

05 Feb, 2015

1 commit


03 Feb, 2015

1 commit

  • * pci/config:
    PCI: xilinx: Convert to use generic config accessors
    PCI: xgene: Convert to use generic config accessors
    PCI: tegra: Convert to use generic config accessors
    PCI: rcar: Convert to use generic config accessors
    PCI: generic: Convert to use generic config accessors
    powerpc/powermac: Convert PCI to use generic config accessors
    powerpc/fsl_pci: Convert PCI to use generic config accessors
    ARM: ks8695: Convert PCI to use generic config accessors
    ARM: sa1100: Convert PCI to use generic config accessors
    ARM: integrator: Convert PCI to use generic config accessors
    ARM: cns3xxx: Convert PCI to use generic config accessors
    PCI: Add generic config accessors
    powerpc/PCI: Add struct pci_ops member names to initialization
    mn10300/PCI: Add struct pci_ops member names to initialization
    MIPS: PCI: Add struct pci_ops member names to initialization
    frv/PCI: Add struct pci_ops member names to initialization

    Bjorn Helgaas
     

31 Jan, 2015

1 commit


24 Jan, 2015

1 commit


15 Dec, 2014

1 commit

  • Pull driver core update from Greg KH:
    "Here's the set of driver core patches for 3.19-rc1.

    They are dominated by the removal of the .owner field in platform
    drivers. They touch a lot of files, but they are "simple" changes,
    just removing a line in a structure.

    Other than that, a few minor driver core and debugfs changes. There
    are some ath9k patches coming in through this tree that have been
    acked by the wireless maintainers as they relied on the debugfs
    changes.

    Everything has been in linux-next for a while"

    * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
    Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
    fs: debugfs: add forward declaration for struct device type
    firmware class: Deletion of an unnecessary check before the function call "vunmap"
    firmware loader: fix hung task warning dump
    devcoredump: provide a one-way disable function
    device: Add dev__once variants
    ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
    ath: use seq_file api for ath9k debugfs files
    debugfs: add helper function to create device related seq_file
    drivers/base: cacheinfo: remove noisy error boot message
    Revert "core: platform: add warning if driver has no owner"
    drivers: base: support cpu cache information interface to userspace via sysfs
    drivers: base: add cpu_device_create to support per-cpu devices
    topology: replace custom attribute macros with standard DEVICE_ATTR*
    cpumask: factor out show_cpumap into separate helper function
    driver core: Fix unbalanced device reference in drivers_probe
    driver core: fix race with userland in device_add()
    sysfs/kernfs: make read requests on pre-alloc files use the buffer.
    sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
    fs: sysfs: return EGBIG on write if offset is larger than file size
    ...

    Linus Torvalds
     

14 Nov, 2014

1 commit

  • The X-Gene PCIe driver assumes pci_scan_root_bus() assigns resources as
    proposed in [1]. But we dropped patch [1] because it would break some
    architectures, which means the X-Gene PCIe driver is currently broken.

    Add calls to scan the bus, assign resources, and add devices in the X-Gene
    driver to fix this.

    [bhelgaas: changelog]
    [1] http://lkml.kernel.org/r/1412000971-9242-11-git-send-email-Liviu.Dudau@arm.com
    Signed-off-by: Duc Dang
    Signed-off-by: Tanmay Inamdar
    Signed-off-by: Bjorn Helgaas

    Duc Dang
     

20 Oct, 2014

1 commit


02 Oct, 2014

1 commit

  • Add the AppliedMicro X-Gene SOC PCIe host controller driver. The X-Gene
    PCIe controller supports up to 8 lanes and GEN3 speed. The X-Gene SOC
    supports up to 5 PCIe ports.

    [bhelgaas: folded in MAINTAINERS and bindings updates]
    Tested-by: Ming Lei
    Tested-by: Dann Frazier
    Signed-off-by: Tanmay Inamdar
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Liviu Dudau (driver)

    Tanmay Inamdar