]> git.kernelconcepts.de Git - karo-tx-linux.git/log
karo-tx-linux.git
8 years agoMerge branches 'pci/host-altera', 'pci/host-imx6', 'pci/host-keystone', 'pci/host...
Bjorn Helgaas [Tue, 15 Mar 2016 13:55:19 +0000 (08:55 -0500)]
Merge branches 'pci/host-altera', 'pci/host-imx6', 'pci/host-keystone', 'pci/host-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

8 years agoMerge branches 'pci/aer', 'pci/enumeration', 'pci/kconfig', 'pci/misc', 'pci/virtuali...
Bjorn Helgaas [Tue, 15 Mar 2016 13:55:02 +0000 (08:55 -0500)]
Merge branches 'pci/aer', 'pci/enumeration', 'pci/kconfig', 'pci/misc', 'pci/virtualization' 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

8 years agoPCI: Add PCI_CLASS_SERIAL_USB_DEVICE definition
Heikki Krogerus [Tue, 15 Mar 2016 12:06:00 +0000 (14:06 +0200)]
PCI: Add PCI_CLASS_SERIAL_USB_DEVICE definition

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 <heikki.krogerus@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: Cleanup pci/pcie/Kconfig whitespace
Andreas Ziegler [Tue, 15 Mar 2016 11:28:32 +0000 (12:28 +0100)]
PCI: Cleanup pci/pcie/Kconfig whitespace

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 <andreas.ziegler@fau.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: thunder: Add driver for ThunderX-pass{1,2} on-chip devices
David Daney [Fri, 4 Mar 2016 22:31:48 +0000 (14:31 -0800)]
PCI: thunder: Add driver for ThunderX-pass{1,2} on-chip devices

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 <david.daney@cavium.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rob Herring <robh@kernel.org>
8 years agoPCI: thunder: Add PCIe host driver for ThunderX processors
David Daney [Fri, 4 Mar 2016 22:31:47 +0000 (14:31 -0800)]
PCI: thunder: Add PCIe host driver for ThunderX processors

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 <david.daney@cavium.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
8 years agoPCI: generic: Expose pci_host_common_probe() for use by other drivers
David Daney [Fri, 11 Mar 2016 21:35:55 +0000 (15:35 -0600)]
PCI: generic: Expose pci_host_common_probe() for use by other drivers

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 <david.daney@cavium.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Will Deacon <will.deacon@arm.com>
8 years agoPCI: generic: Add pci_host_common_probe(), based on gen_pci_probe()
David Daney [Fri, 11 Mar 2016 21:25:13 +0000 (15:25 -0600)]
PCI: generic: Add pci_host_common_probe(), based on gen_pci_probe()

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 <david.daney@cavium.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Will Deacon <will.deacon@arm.com>
8 years agoPCI: generic: Move structure definitions to separate header file
David Daney [Fri, 11 Mar 2016 21:18:38 +0000 (15:18 -0600)]
PCI: generic: Move structure definitions to separate header file

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 <david.daney@cavium.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Will Deacon <will.deacon@arm.com>
8 years agoPCI: xilinx-nwl: Add support for Xilinx NWL PCIe Host Controller
Bharat Kumar Gogada [Sun, 6 Mar 2016 16:32:14 +0000 (22:02 +0530)]
PCI: xilinx-nwl: Add support for Xilinx NWL PCIe Host Controller

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 <bharatku@xilinx.com>
Signed-off-by: Ravi Kiran Gummaluri <rgummal@xilinx.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Rob Herring <robh@kernel.org>
8 years agoPCI: keystone: Defer probing if devm_phy_get() returns -EPROBE_DEFER
Shawn Lin [Mon, 7 Mar 2016 04:32:21 +0000 (12:32 +0800)]
PCI: keystone: Defer probing if devm_phy_get() returns -EPROBE_DEFER

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 <shawn.lin@rock-chips.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: altera: Fix altera_pcie_link_is_up()
Ley Foon Tan [Wed, 2 Mar 2016 09:43:07 +0000 (17:43 +0800)]
PCI: altera: Fix altera_pcie_link_is_up()

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 <lftan@altera.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: rcar: Depend on ARCH_RENESAS, not ARCH_SHMOBILE
Simon Horman [Thu, 25 Feb 2016 00:45:56 +0000 (09:45 +0900)]
PCI: rcar: Depend on ARCH_RENESAS, not ARCH_SHMOBILE

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 <horms+renesas@verge.net.au>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
8 years agox86/PCI: VMD: Attach VMD resources to parent domain's resource tree
Jon Derrick [Wed, 24 Feb 2016 17:06:37 +0000 (10:06 -0700)]
x86/PCI: VMD: Attach VMD resources to parent domain's resource tree

Attach the new VMD domain's resources to the VMD device's resources.  This
allows /proc/iomem to display a more complete picture.

Before:
  c0000000-c1ffffff : 0000:5d:05.5
  c2000000-c3ffffff : 0000:5d:05.5
    c2010000-c2013fff : nvme
  c4000000-c40fffff : 0000:5d:05.5

After:
  c0000000-c1ffffff : 0000:5d:05.5
  c2000000-c3ffffff : 0000:5d:05.5
    c2000000-c3ffffff : VMD MEMBAR1
      c2000000-c22fffff : PCI Bus 10000:01
        c2000000-c200ffff : 10000:01:00.0
        c2010000-c2013fff : 10000:01:00.0
          c2010000-c2013fff : nvme
      c2300000-c24fffff : PCI Bus 10000:01
  c4000000-c40fffff : 0000:5d:05.5
    c4002000-c40fffff : VMD MEMBAR2

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
8 years agox86/PCI: VMD: Set bus resource start to 0
Keith Busch [Wed, 2 Mar 2016 22:31:04 +0000 (15:31 -0700)]
x86/PCI: VMD: Set bus resource start to 0

The bus always starts at 0.  Due to alignment and down-casting, this
happened to work before, but looked alarmingly incorrect in kernel logs.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agox86/PCI: VMD: Document code for maintainability
Keith Busch [Wed, 2 Mar 2016 22:31:03 +0000 (15:31 -0700)]
x86/PCI: VMD: Document code for maintainability

Comment the less obvious portion of the code for setting up memory windows,
and the platform dependency for initializing the h/w with appropriate
resources.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: Wait for up to 1000ms after FLR reset
Alex Williamson [Mon, 22 Feb 2016 20:05:48 +0000 (13:05 -0700)]
PCI: Wait for up to 1000ms after FLR reset

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 <alex.williamson@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: Prevent VPD access for buggy devices
Babu Moger [Mon, 15 Feb 2016 08:42:02 +0000 (09:42 +0100)]
PCI: Prevent VPD access for buggy devices

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 <shane.seymour@hpe.com>
Tested-by: Babu Moger <babu.moger@oracle.com>
Signed-off-by: Babu Moger <babu.moger@oracle.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Alexander Duyck <alexander.duyck@gmail.com>
8 years agoPCI: Sleep rather than busy-wait for VPD access completion
Bjorn Helgaas [Mon, 22 Feb 2016 20:58:18 +0000 (14:58 -0600)]
PCI: Sleep rather than busy-wait for VPD access completion

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 <shane.seymour@hpe.com>
Tested-by: Babu Moger <babu.moger@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
8 years agoPCI: Add QEMU top-level IDs for (sub)vendor & device
Robin H. Johnson [Sun, 6 Mar 2016 22:02:30 +0000 (22:02 +0000)]
PCI: Add QEMU top-level IDs for (sub)vendor & device

Introduce PCI_VENDOR/PCI_SUBVENDOR/PCI_SUBDEVICE defines to replace the
constants scattered in the kernel already used to detect QEMU.

They are defined in the QEMU codebase per docs/specs/pci-ids.txt.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agoPCI/AER: Log aer_inject error injections
Jean Delvare [Thu, 18 Feb 2016 12:54:02 +0000 (13:54 +0100)]
PCI/AER: Log aer_inject error injections

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

Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Borislav Petkov <bp@suse.de>
8 years agoPCI/AER: Log actual error causes in aer_inject
Jean Delvare [Thu, 18 Feb 2016 12:52:46 +0000 (13:52 +0100)]
PCI/AER: Log actual error causes in aer_inject

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 <jdelvare@suse.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Borislav Petkov <bp@suse.de>
CC: Thomas Renninger <trenn@suse.de>
8 years agoPCI/AER: Use dev_warn() in aer_inject
Jean Delvare [Thu, 18 Feb 2016 12:52:01 +0000 (13:52 +0100)]
PCI/AER: Use dev_warn() in aer_inject

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 <jdelvare@suse.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Borislav Petkov <bp@suse.de>
8 years agoPCI/AER: Fix aer_inject error codes
Jean Delvare [Thu, 18 Feb 2016 12:50:45 +0000 (13:50 +0100)]
PCI/AER: Fix aer_inject error codes

EPERM means "Operation not permitted", which doesn't reflect the lack of
support for AER.  EPROTONOSUPPORT (Protocol not supported) is a better
choice of error code if the device or its root port lack support for AER.

Likewise, EINVAL means "Invalid argument", which is not suitable for cases
where the AER error device is missing or unusable.  ENODEV and
EPROTONOSUPPORT, respectively, fit better.

Suggested-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Borislav Petkov <bp@suse.de>
CC: Prarit Bhargava <prarit@redhat.com>
8 years agoPCI: tegra: Remove misleading PHYS_OFFSET
Thierry Reding [Tue, 9 Feb 2016 14:52:33 +0000 (15:52 +0100)]
PCI: tegra: Remove misleading PHYS_OFFSET

BARs are disabled when the size register is 0, so it's misleading to write
a base address into the start register.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: tegra: Track bus -> CPU mapping
Thierry Reding [Tue, 9 Feb 2016 14:52:32 +0000 (15:52 +0100)]
PCI: tegra: Track bus -> CPU mapping

Track the offsets of the bus -> CPU mapping for I/O and memory.  This is
cosmetic for current Tegra chips because the offset is always 0.  But to
properly support legacy use-cases, like VGA, this would be needed so that
PCI bus addresses can be relocated.

While at it, also request the I/O resource both in physical memory and I/O
space to make /proc/iomem consistent, as well as add the I/O region to the
list of host bridge resources.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: tegra: Remove unused struct tegra_pcie.num_ports field
Thierry Reding [Tue, 9 Feb 2016 14:52:31 +0000 (15:52 +0100)]
PCI: tegra: Remove unused struct tegra_pcie.num_ports field

The num_ports field of the tegra_pcie structure is never used so remove it.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: tegra: Implement ->{add,remove}_bus() callbacks
Thierry Reding [Tue, 9 Feb 2016 14:30:48 +0000 (15:30 +0100)]
PCI: tegra: Implement ->{add,remove}_bus() callbacks

The configuration space mapping on Tegra is somewhat special, and in order
to avoid wasting virtual address space the configuration space for each bus
needs to be stitched together from several blocks which form a single
continuous virtual address range for accessors.

Currently the configuration space is mapped upon the first access to one of
its registers.  However, the mapping operation may sleep under certain
circumstances, so doing it from the configuration space accessors (they are
protected by a spin lock) will trigger a warning.

To avoid the warning, use the ->add_bus() callback to perform the mapping
at enumeration time when the operation is allowed to sleep.  Also add an
implementation of ->remove_bus() that undoes the mapping established by the
->add_bus() callback.  While it isn't currently possible to unload the
module, there is work underway to remedy this, and this code will come in
handy when that happens.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: Add pci_ops.{add,remove}_bus() callbacks
Thierry Reding [Tue, 9 Feb 2016 14:30:47 +0000 (15:30 +0100)]
PCI: Add pci_ops.{add,remove}_bus() callbacks

Add pci_ops.{add,remove}_bus() callbacks, which will be called on every
newly created bus and when a bus is being removed, respectively.  This can
be used by drivers to implement driver-specific initialization and teardown
of the bus, in addition to the architecture-specifics implemented by the
pcibios_add_bus() and the pcibios_remove_bus() functions.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: Include pci/hotplug Kconfig directly from pci/Kconfig
Bjorn Helgaas [Tue, 8 Mar 2016 20:57:21 +0000 (14:57 -0600)]
PCI: Include pci/hotplug Kconfig directly from pci/Kconfig

Include pci/hotplug/Kconfig directly from pci/Kconfig, so arches don't
have to source both pci/Kconfig and pci/hotplug/Kconfig.

Note that this effectively adds pci/hotplug/Kconfig to the following
arches, because they already sourced drivers/pci/Kconfig but they
previously did not source drivers/pci/hotplug/Kconfig:

  alpha
  arm
  avr32
  frv
  m68k
  microblaze
  mn10300
  sparc
  unicore32

Inspired-by-patch-from: Bogicevic Sasa <brutallesale@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: Include pci/pcie/Kconfig directly from pci/Kconfig
Bogicevic Sasa [Wed, 3 Feb 2016 21:24:22 +0000 (13:24 -0800)]
PCI: Include pci/pcie/Kconfig directly from pci/Kconfig

Include pci/pcie/Kconfig directly from pci/Kconfig, so arches don't
have to source both pci/Kconfig and pci/pcie/Kconfig.

Note that this effectively adds pci/pcie/Kconfig to the following
arches, because they already sourced drivers/pci/Kconfig but they
previously did not source drivers/pci/pcie/Kconfig:

  alpha
  avr32
  blackfin
  frv
  m32r
  m68k
  microblaze
  mn10300
  parisc
  sparc
  unicore32
  xtensa

[bhelgaas: changelog, source pci/pcie/Kconfig at top of pci/Kconfig, whitespace]
Signed-off-by: Sasa Bogicevic <brutallesale@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agomicroblaze/PCI: Support generic Xilinx AXI PCIe Host Bridge IP driver
Bharat Kumar Gogada [Thu, 11 Feb 2016 16:28:11 +0000 (21:58 +0530)]
microblaze/PCI: Support generic Xilinx AXI PCIe Host Bridge IP driver

Modify the Microblaze PCI subsystem to work with the generic
drivers/pci/host/pcie-xilinx.c driver on Microblaze and Zynq.

[bhelgaas: changelog]
Signed-off-by: Bharat Kumar Gogada <bharatku@xilinx.com>
Signed-off-by: Ravi Kiran Gummaluri <rgummal@xilinx.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
8 years agoPCI: xilinx: Update Zynq binding with Microblaze node
Bharat Kumar Gogada [Thu, 11 Feb 2016 16:28:10 +0000 (21:58 +0530)]
PCI: xilinx: Update Zynq binding with Microblaze node

Update Zynq PCI binding documentation with Microblaze node.

[bhelgaas: fix "microbalze_0_intc" typo]
Signed-off-by: Bharat Kumar Gogada <bharatku@xilinx.com>
Signed-off-by: Ravi Kiran Gummaluri <rgummal@xilinx.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Michal Simek <michal.simek@xilinx.com>
8 years agoPCI: xilinx: Don't call pci_fixup_irqs() on Microblaze
Bharat Kumar Gogada [Thu, 11 Feb 2016 16:28:09 +0000 (21:58 +0530)]
PCI: xilinx: Don't call pci_fixup_irqs() on Microblaze

The Xilinx AXI PCIe Host Bridge Soft IP driver was previously only
supported on ARM (in particular, on ARCH_ZYNC), and pci_fixup_irqs() is
available there.  But Microblaze will do IRQ fixup in pcibios_add_device(),
so pci_fixup_irqs() is not available on Microblaze.

Don't call pci_fixup_irqs() on Microblaze, so the driver can work on both
Zynq and Microblaze Architectures.

[bhelgaas: revise changelog to show similarity to bdb8a1844f31 ("PCI: iproc: Call pci_fixup_irqs() for ARM64 as well as ARM")]
Signed-off-by: Bharat Kumar Gogada <bharatku@xilinx.com>
Signed-off-by: Ravi Kiran Gummaluri <rgummal@xilinx.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Michal Simek <michal.simek@xilinx.com>
8 years agoPCI: xilinx: Remove dependency on ARM-specific struct hw_pci
Bharat Kumar Gogada [Thu, 11 Feb 2016 16:28:08 +0000 (21:58 +0530)]
PCI: xilinx: Remove dependency on ARM-specific struct hw_pci

The Xilinx PCIe host controller driver uses pci_common_init_dev(), which
is ARM-specific and requires the ARM struct hw_pci.  The part of
pci_common_init_dev() that is needed is limited and can be done here
without using hw_pci.

Create and scan the root bus directly without using the ARM
pci_common_init_dev() interface.

[bhelgaas: revise changelog to show similarity to 79953dd22c1d ("PCI: rcar: Remove dependency on ARM-specific struct hw_pci")]
Signed-off-by: Bharat Kumar Gogada <bharatku@xilinx.com>
Signed-off-by: Ravi Kiran Gummaluri <rgummal@xilinx.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Michal Simek <michal.simek@xilinx.com>
8 years agoPCI: xilinx: Use of_pci_get_host_bridge_resources() to parse DT
Bharat Kumar Gogada [Thu, 11 Feb 2016 16:28:07 +0000 (21:58 +0530)]
PCI: xilinx: Use of_pci_get_host_bridge_resources() to parse DT

Use the new of_pci_get_host_bridge_resources() API in place of the PCI OF
DT parser.

[bhelgaas: revise changelog to show similarity to 0021d22b73d6 ("PCI: designware: Use of_pci_get_host_bridge_resources() to parse DT")]
Signed-off-by: Bharat Kumar Gogada <bharatku@xilinx.com>
Signed-off-by: Ravi Kiran Gummaluri <rgummal@xilinx.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Michal Simek <michal.simek@xilinx.com>
8 years agounicore32: Remove unused HAVE_ARCH_PCI_SET_DMA_MASK definition
Bjorn Helgaas [Mon, 7 Mar 2016 16:53:16 +0000 (10:53 -0600)]
unicore32: Remove unused HAVE_ARCH_PCI_SET_DMA_MASK definition

HAVE_ARCH_PCI_SET_DMA_MASK is unused, so remove the #define for it.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: GUAN Xuetao <gxt@mprc.pku.edu.cn>
8 years agoPCI: Consolidate PCI DMA constants and interfaces in linux/pci-dma-compat.h
Bjorn Helgaas [Mon, 7 Mar 2016 17:39:16 +0000 (11:39 -0600)]
PCI: Consolidate PCI DMA constants and interfaces in linux/pci-dma-compat.h

Christoph added a generic include/linux/pci-dma-compat.h, so now there's
one place with most of the PCI DMA interfaces.  Move more PCI DMA-related
things there:

  - The PCI_DMA_* direction constants from linux/pci.h
  - The pci_set_dma_max_seg_size() and pci_set_dma_seg_boundary()
    CONFIG_PCI implementations from drivers/pci/pci.c
  - The pci_set_dma_max_seg_size() and pci_set_dma_seg_boundary()
    !CONFIG_PCI stubs from linux/pci.h
  - The pci_set_dma_mask() and pci_set_consistent_dma_mask()
    !CONFIG_PCI stubs from linux/pci.h

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: Move pci_dma_* helpers to common code
Christoph Hellwig [Mon, 7 Mar 2016 16:40:02 +0000 (10:40 -0600)]
PCI: Move pci_dma_* helpers to common code

For a long time all architectures implement the pci_dma_* functions using
the generic DMA API, and they all use the same header to do so.

Move this header, pci-dma-compat.h, to include/linux and include it from
the generic pci.h instead of having each arch duplicate this include.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agofrv/PCI: Remove stray pci_{alloc,free}_consistent() declaration
Christoph Hellwig [Sun, 6 Mar 2016 15:17:53 +0000 (16:17 +0100)]
frv/PCI: Remove stray pci_{alloc,free}_consistent() declaration

FRV doesn't implement pci_{alloc,free}_consistent(), so remove the
declarations for them.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: David Howells <dhowells@redhat.com>
8 years agoPCI: Fold struct pci_vpd_pci22 into struct pci_vpd
Bjorn Helgaas [Mon, 22 Feb 2016 20:09:52 +0000 (14:09 -0600)]
PCI: Fold struct pci_vpd_pci22 into struct pci_vpd

We only support one flavor of VPD, so there's no need to complicate things
by having a "generic" struct pci_vpd and a more specific struct
pci_vpd_pci22.

Fold struct pci_vpd_pci22 directly into struct pci_vpd.

[bhelgaas: remove NULL check before kfree of dev->vpd (per kfreeaddr.cocci)]
Tested-by: Shane Seymour <shane.seymour@hpe.com>
Tested-by: Babu Moger <babu.moger@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
8 years agoPCI: Rename VPD symbols to remove unnecessary "pci22"
Bjorn Helgaas [Mon, 22 Feb 2016 19:58:37 +0000 (13:58 -0600)]
PCI: Rename VPD symbols to remove unnecessary "pci22"

There's only one kind of VPD, so we don't need to qualify it as "the
version described by PCI spec rev 2.2."

Rename the following symbols to remove unnecessary "pci22":

  PCI_VPD_PCI22_SIZE -> PCI_VPD_MAX_SIZE
  pci_vpd_pci22_size() -> pci_vpd_size()
  pci_vpd_pci22_wait() -> pci_vpd_wait()
  pci_vpd_pci22_read() -> pci_vpd_read()
  pci_vpd_pci22_write() -> pci_vpd_write()
  pci_vpd_pci22_ops -> pci_vpd_ops
  pci_vpd_pci22_init() -> pci_vpd_init()

Tested-by: Shane Seymour <shane.seymour@hpe.com>
Tested-by: Babu Moger <babu.moger@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
8 years agoPCI: Remove struct pci_vpd_ops.release function pointer
Bjorn Helgaas [Mon, 22 Feb 2016 19:58:20 +0000 (13:58 -0600)]
PCI: Remove struct pci_vpd_ops.release function pointer

The struct pci_vpd_ops.release function pointer is always
pci_vpd_pci22_release(), so there's no need for the flexibility of a
function pointer.

Inline the pci_vpd_pci22_release() body into pci_vpd_release() and remove
pci_vpd_pci22_release() and the struct pci_vpd_ops.release function
pointer.

Tested-by: Shane Seymour <shane.seymour@hpe.com>
Tested-by: Babu Moger <babu.moger@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
8 years agoPCI: Move pci_vpd_release() from header file to pci/access.c
Bjorn Helgaas [Mon, 22 Feb 2016 19:58:06 +0000 (13:58 -0600)]
PCI: Move pci_vpd_release() from header file to pci/access.c

Move pci_vpd_release() so it's next to the other VPD functions.  This puts
it next to pci_vpd_pci22_init(), which allocates the space freed by
pci_vpd_release().

Tested-by: Shane Seymour <shane.seymour@hpe.com>
Tested-by: Babu Moger <babu.moger@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
8 years agoPCI: Move pci_read_vpd() and pci_write_vpd() close to other VPD code
Bjorn Helgaas [Mon, 22 Feb 2016 19:57:50 +0000 (13:57 -0600)]
PCI: Move pci_read_vpd() and pci_write_vpd() close to other VPD code

pci_read_vpd() and pci_write_vpd() were stranded in the middle of config
accessor functions.  Move them close to the other VPD code in the file.
No functional change.

Tested-by: Shane Seymour <shane.seymour@hpe.com>
Tested-by: Babu Moger <babu.moger@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
8 years agoPCI: Determine actual VPD size on first access
Hannes Reinecke [Mon, 15 Feb 2016 08:42:01 +0000 (09:42 +0100)]
PCI: Determine actual VPD size on first access

PCI-2.2 VPD entries have a maximum size of 32k, but might actually be
smaller than that.  To figure out the actual size one has to read the VPD
area until the 'end marker' is reached.

Per spec, reading outside of the VPD space is "not allowed."  In practice,
it may cause simple read errors or even crash the card.  To make matters
worse not every PCI card implements this properly, leaving us with no 'end'
marker or even completely invalid data.

Try to determine the size of the VPD data when it's first accessed.  If no
valid data can be read an I/O error will be returned when reading or
writing the sysfs attribute.

As the amount of VPD data is unknown initially the size of the sysfs
attribute will always be set to '0'.

[bhelgaas: changelog, use 0/1 (not false/true) for bitfield, tweak
pci_vpd_pci22_read() error checking]
Tested-by: Shane Seymour <shane.seymour@hpe.com>
Tested-by: Babu Moger <babu.moger@oracle.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Alexander Duyck <alexander.duyck@gmail.com>
8 years agoPCI: Use bitfield instead of bool for struct pci_vpd_pci22.busy
Bjorn Helgaas [Mon, 22 Feb 2016 20:04:07 +0000 (14:04 -0600)]
PCI: Use bitfield instead of bool for struct pci_vpd_pci22.busy

Make struct pci_vpd_pci22.busy a 1-bit field instead of a bool.  We intend
to add another flag, and two bitfields are cheaper than two bools.

Tested-by: Shane Seymour <shane.seymour@hpe.com>
Tested-by: Babu Moger <babu.moger@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
8 years agoPCI: Allow access to VPD attributes with size 0
Hannes Reinecke [Mon, 15 Feb 2016 08:42:00 +0000 (09:42 +0100)]
PCI: Allow access to VPD attributes with size 0

It is not always possible to determine the actual size of the VPD
data, so allow access to them if the size is set to '0'.

Tested-by: Shane Seymour <shane.seymour@hpe.com>
Tested-by: Babu Moger <babu.moger@oracle.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Alexander Duyck <alexander.duyck@gmail.com>
8 years agoPCI: imx6: Add DT bindings to configure PHY Tx driver settings
Justin Waters [Fri, 15 Jan 2016 15:24:35 +0000 (10:24 -0500)]
PCI: imx6: Add DT bindings to configure PHY Tx driver settings

The settings in GPR8 are dependent upon the particular layout of the
hardware platform.  As such, they should be configurable via the device
tree.

Look up PHY Tx driver settings from the device tree.  Fall back to the
original hard-coded values if they are not specified in the device tree.

Signed-off-by: Justin Waters <justin.waters@timesys.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
8 years agoPCI: Fix broken URL for Dell biosdevname
Naga Venkata Sai Indubhaskar Jupudi [Tue, 9 Feb 2016 22:10:16 +0000 (14:10 -0800)]
PCI: Fix broken URL for Dell biosdevname

Dell developed a way to consistently name devices, and their last proposal
was accepted under the name biosdevname.  Fix a broken URL to biosdevname
documentation.

Signed-off-by: Naga Venkata Sai Indubhaskar Jupudi <njupudi@ucsc.edu>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: Support SR-IOV on any function type
Kelly Zytaruk [Tue, 9 Feb 2016 18:08:58 +0000 (13:08 -0500)]
PCI: Support SR-IOV on any function type

Previously, we only supported SR-IOV on PCI Express Endpoints and Root
Complex Integrated Endpoints.  This restriction has been present since
d1b054da8f59 ("PCI: initialize and release SR-IOV capability") added SR-IOV
support, but the spec does not require it.  In fact, the SR-IOV spec r1.1,
sec 3.3, says the SR-IOV extended capability may be present for any Type 0
function.

Remove the function type test, so we can support SR-IOV on any function.

Some AMD GPUs have display outputs, use the VGA class code, are Legacy
Endpoints, and support SR-IOV.  This change allows Linux to enable SR-IOV
on these devices.

[bhelgaas: changelog]
Link: https://bugzilla.kernel.org/show_bug.cgi?id=112221
Signed-off-by: Kelly Zytaruk <kelly.zytaruk@amd.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: Update VPD definitions
Hannes Reinecke [Mon, 15 Feb 2016 08:41:59 +0000 (09:41 +0100)]
PCI: Update VPD definitions

The 'end' tag is actually 0x0f; it's the representation as a small resource
data type tag that's 0x78 (i.e., shifted by 3).  Correct PCI_VPD_STIN_END
and PCI_VPD_SRDT_END accordingly.

Also, add helper functions to extract the resource data type tags for both
large and small resource data types.

[bhelgaas: changelog]
Tested-by: Shane Seymour <shane.seymour@hpe.com>
Tested-by: Babu Moger <babu.moger@oracle.com>
Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Alexander Duyck <alexander.duyck@gmail.com>
8 years agoMerge branches 'pci/host-designware', 'pci/host-imx6', 'pci/host-layerscape' and...
Bjorn Helgaas [Tue, 9 Feb 2016 18:54:03 +0000 (12:54 -0600)]
Merge branches 'pci/host-designware', 'pci/host-imx6', 'pci/host-layerscape' and 'pci/host-rcar' into next

* pci/host-designware:
  PCI: designware: Remove PCI_PROBE_ONLY handling
  PCI: designware: Explain why we don't program ATU for some platforms

* pci/host-imx6:
  PCI: imx6: Move link up check into imx6_pcie_wait_for_link()
  PCI: imx6: Remove broken Gen2 workaround
  PCI: imx6: Move PHY reset into imx6_pcie_establish_link()
  PCI: imx6: Move imx6_pcie_reset_phy() near other PHY handling functions

* pci/host-layerscape:
  PCI: layerscape: Add "fsl,ls2085a-pcie" compatible ID

* pci/host-rcar:
  PCI: rcar: Remove PCI_PROBE_ONLY handling

8 years agoMerge branches 'pci/aer', 'pci/misc' and 'pci/virtualization' into next
Bjorn Helgaas [Tue, 9 Feb 2016 18:45:58 +0000 (12:45 -0600)]
Merge branches 'pci/aer', 'pci/misc' and 'pci/virtualization' into next

* pci/aer:
  PCI/AER: Use list_first_entry_or_null() to simplify code
  PCI/AER: Restore pci_ops pointer while calling original pci_ops
  PCI/AER: Rename pci_ops_aer to aer_inj_pci_ops

* pci/misc:
  PCI: Remove includes of asm/pci-bridge.h
  PCI: Remove empty asm-generic/pci-bridge.h
  ARM64: PCI: Remove generated include of asm-generic/pci-bridge.h
  PCI: Remove includes of empty asm-generic/pci-bridge.h
  PCI: Move pci_set_flags() from asm-generic/pci-bridge.h to linux/pci.h
  PCI/PME: Restructure pcie_pme_suspend() to prevent compiler warning
  PCI/PME: Remove redundant port lookup
  PCI: Check device_attach() return value always

* pci/virtualization:
  PCI: Add ACS quirk for all Cavium devices

8 years agoPCI: designware: Remove PCI_PROBE_ONLY handling
Lorenzo Pieralisi [Fri, 29 Jan 2016 11:29:32 +0000 (11:29 +0000)]
PCI: designware: Remove PCI_PROBE_ONLY handling

The PCIe designware host driver is not used in system configurations
requiring the PCI_PROBE_ONLY flag to be set to prevent resources
assignment, therefore the driver code handling the flag can be removed
from the kernel.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Pratyush Anand <pratyush.anand@gmail.com>
Acked-by: Jingoo Han Jingoo Han <jingoohan1@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Cc: Zhou Wang <wangzhou1@hisilicon.com>
8 years agoPCI: designware: Explain why we don't program ATU for some platforms
Jisheng Zhang [Thu, 7 Jan 2016 06:12:38 +0000 (14:12 +0800)]
PCI: designware: Explain why we don't program ATU for some platforms

Some platforms don't support ATU, e.g., pci-keystone.c.  These platforms
use their own address translation component rather than ATU, and they
provide the rd_other_conf and wr_other_conf methods to program the
translation component and perform the access.

Add a comment to explain why we don't program the ATU for these platforms.

[bhelgaas: changelog]
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: Remove includes of asm/pci-bridge.h
Bjorn Helgaas [Fri, 5 Feb 2016 20:58:12 +0000 (14:58 -0600)]
PCI: Remove includes of asm/pci-bridge.h

Drivers should include asm/pci-bridge.h only when they need the arch-
specific things provided there.  Outside of the arch/ directories, the only
drivers that actually need things provided by asm/pci-bridge.h are the
powerpc RPA hotplug drivers in drivers/pci/hotplug/rpa*.

Remove the includes of asm/pci-bridge.h from the other drivers, adding an
include of linux/pci.h if necessary.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: Remove empty asm-generic/pci-bridge.h
Bjorn Helgaas [Fri, 5 Feb 2016 20:58:07 +0000 (14:58 -0600)]
PCI: Remove empty asm-generic/pci-bridge.h

include/asm-generic/pci-bridge.h is empty, and nobody includes it, so
remove it.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoARM64: PCI: Remove generated include of asm-generic/pci-bridge.h
Bjorn Helgaas [Fri, 5 Feb 2016 20:58:02 +0000 (14:58 -0600)]
ARM64: PCI: Remove generated include of asm-generic/pci-bridge.h

arm64 generates asm/pci-bridge.h, which merely includes the now-empty
asm-generic/pci-bridge.h.  Stop generating asm/pci-bridge.h, and stop
including it.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Will Deacon <will.deacon@arm.com>
8 years agoPCI: Remove includes of empty asm-generic/pci-bridge.h
Bjorn Helgaas [Fri, 5 Feb 2016 20:57:54 +0000 (14:57 -0600)]
PCI: Remove includes of empty asm-generic/pci-bridge.h

include/asm-generic/pci-bridge.h is now empty, so remove every #include of
it.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Will Deacon <will.deacon@arm.com> (arm64)
8 years agoPCI: Move pci_set_flags() from asm-generic/pci-bridge.h to linux/pci.h
Bjorn Helgaas [Fri, 5 Feb 2016 20:57:47 +0000 (14:57 -0600)]
PCI: Move pci_set_flags() from asm-generic/pci-bridge.h to linux/pci.h

The PCI flag management constants and functions were previously declared in
include/asm-generic/pci-bridge.h.  But they are not specific to bridges,
and arches did not include pci-bridge.h consistently.

Move the following interfaces and related constants to include/linux/pci.h
and remove pci-bridge.h:

  pci_set_flags()
  pci_add_flags()
  pci_clear_flags()
  pci_has_flag()

This fixes these warnings when building for some arches:

  drivers/pci/host/pcie-designware.c:562:20: error: 'PCI_PROBE_ONLY' undeclared (first use in this function)
  drivers/pci/host/pcie-designware.c:562:7: error: implicit declaration of function 'pci_has_flag' [-Werror=implicit-function-declaration]

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI/PME: Restructure pcie_pme_suspend() to prevent compiler warning
Bjorn Helgaas [Fri, 5 Feb 2016 20:57:19 +0000 (14:57 -0600)]
PCI/PME: Restructure pcie_pme_suspend() to prevent compiler warning

Previously we had this:

  if (wakeup)
    ret = enable_irq_wake(...);
  if (!wakeup || ret)
    ...

"ret" is only evaluated when "wakeup" is true, and it is always initialized
in that case, but gcc isn't smart enough to figure that out and warns:

  drivers/pci/pcie/pme.c:414:14: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]

Restructure the code slightly to make it easier for gcc (and maybe for
humans as well).

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com
8 years agoPCI/PME: Remove redundant port lookup
Bjorn Helgaas [Fri, 5 Feb 2016 20:57:12 +0000 (14:57 -0600)]
PCI/PME: Remove redundant port lookup

We've already looked up srv->port a few lines earlier, and there's no need
to do it again.  Remove the redundant lookup.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com
8 years agoPCI: Check device_attach() return value always
Bjorn Helgaas [Wed, 27 Jan 2016 13:35:07 +0000 (07:35 -0600)]
PCI: Check device_attach() return value always

Previously we checked the device_attach() return value only when
CONFIG_BUG=y.  That caused this warning in builds where CONFIG_BUG is not
set:

  drivers/pci/bus.c:237:6: warning: variable 'retval' set but not used [-Wunused-but-set-variable]

Check the return value of device_attach() always and clean up after
failure.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agoPCI: layerscape: Add "fsl,ls2085a-pcie" compatible ID
Yang Shi [Wed, 27 Jan 2016 17:32:05 +0000 (09:32 -0800)]
PCI: layerscape: Add "fsl,ls2085a-pcie" compatible ID

The Layerscape PCI host driver must recognize ls2085a compatible when using
firmware with ls2085a compatible property, otherwise the PCI bus won't be
detected even though ls2085a compatible is included by the dts.

Signed-off-by: Yang Shi <yang.shi@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: rcar: Remove PCI_PROBE_ONLY handling
Lorenzo Pieralisi [Fri, 29 Jan 2016 11:29:31 +0000 (11:29 +0000)]
PCI: rcar: Remove PCI_PROBE_ONLY handling

The PCIe rcar host driver is not used in system configurations requiring
the PCI_PROBE_ONLY flag to be set to prevent resources assignment,
therefore the driver code handling the flag can be removed from the kernel.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Phil Edworthy <phil.edworthy@renesas.com>
8 years agoPCI: Add ACS quirk for all Cavium devices
Manish Jaggi [Fri, 29 Jan 2016 20:03:58 +0000 (01:33 +0530)]
PCI: Add ACS quirk for all Cavium devices

Cavium devices matching this quirk do not perform peer-to-peer with other
functions, allowing masking out these bits as if they were unimplemented in
the ACS capability.

Signed-off-by: Manish Jaggi <mjaggi@caviumnetworks.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Tirumalesh Chalamarla <tchalamarla@cavium.com>
8 years agoPCI/AER: Use list_first_entry_or_null() to simplify code
Geliang Tang [Fri, 22 Jan 2016 14:50:19 +0000 (22:50 +0800)]
PCI/AER: Use list_first_entry_or_null() to simplify code

Use list_first_entry_or_null() instead of list_empty() + list_entry() to
simplify the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI/AER: Restore pci_ops pointer while calling original pci_ops
David Daney [Tue, 22 Dec 2015 21:44:51 +0000 (13:44 -0800)]
PCI/AER: Restore pci_ops pointer while calling original pci_ops

The aer_inject module intercepts config space accesses by replacing the
bus->ops pointer.  If it forwards accesses to the original pci_ops, and
those original ops use bus->ops, they see the aer_pci_ops instead of their
own pci_ops, which can cause a crash.

For example, pci_generic_config_read() uses the bus->ops->map_bus pointer.
If bus->ops is set to aer_pci_ops, which doesn't supply .map_bus,
pci_generic_config_read() will dereference an invalid pointer and cause a
crash.

Temporarily restore the original bus->ops pointer while calling ops->read()
or ops->write().  Callers of these functions already hold pci_lock, which
prevents other users of bus->ops until we're finished.

[bhelgaas: changelog]
Signed-off-by: David Daney <david.daney@cavium.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI/AER: Rename pci_ops_aer to aer_inj_pci_ops
Bjorn Helgaas [Thu, 4 Feb 2016 20:02:45 +0000 (14:02 -0600)]
PCI/AER: Rename pci_ops_aer to aer_inj_pci_ops

Rename

  pci_ops_aer     to aer_inj_pci_ops
  pci_read_aer()  to aer_inj_read_config()
  pci_write_aer() to aer_inj_write_config()

This is more conventional and more informative.  No functional change.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: imx6: Move link up check into imx6_pcie_wait_for_link()
Lucas Stach [Mon, 25 Jan 2016 22:50:02 +0000 (16:50 -0600)]
PCI: imx6: Move link up check into imx6_pcie_wait_for_link()

imx6_pcie_link_up() previously used usleep_range() to wait for the link to
come up.  Since it may be called while holding the config spinlock, the
sleep causes a "BUG: scheduling while atomic" error.

Instead of waiting for the link to come up in imx6_pcie_link_up(), do the
waiting in imx6_pcie_wait_for_link(), where we're not holding a lock and
sleeping is allowed.

[bhelgaas: changelog, references to bugzilla and f95d3ae77191]
Link: https://bugzilla.kernel.org/show_bug.cgi?id=100031
Fixes: f95d3ae77191 ("PCI: imx6: Wait for retraining")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: imx6: Remove broken Gen2 workaround
Lucas Stach [Mon, 25 Jan 2016 22:49:57 +0000 (16:49 -0600)]
PCI: imx6: Remove broken Gen2 workaround

Remove the remnants of the workaround for erratum ERR005184 which was never
completely implemented.  The checks alone don't carry any value as we don't
act properly on the result.

A workaround should be added to the lane speed change in establish_link
later.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: imx6: Move PHY reset into imx6_pcie_establish_link()
Lucas Stach [Mon, 25 Jan 2016 22:49:53 +0000 (16:49 -0600)]
PCI: imx6: Move PHY reset into imx6_pcie_establish_link()

This adds the PHY reset into a common error path of
imx6_pcie_establish_link(), deduplicating some of the debug prints.  Also
reduce the severity of the "no-link" message in the one place where it is
expected to be hit when no peripheral is attached.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoPCI: imx6: Move imx6_pcie_reset_phy() near other PHY handling functions
Lucas Stach [Fri, 15 Jan 2016 18:56:47 +0000 (19:56 +0100)]
PCI: imx6: Move imx6_pcie_reset_phy() near other PHY handling functions

Move imx6_pcie_reset_phy() near the other PHY related functions in the
file.  This is a cosmetic change, but also allows to do the following
changes without introducing needless forward declarations.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
8 years agoLinux 4.5-rc1 v4.5-rc1
Linus Torvalds [Sun, 24 Jan 2016 21:06:47 +0000 (13:06 -0800)]
Linux 4.5-rc1

8 years agoMerge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Linus Torvalds [Sun, 24 Jan 2016 20:50:56 +0000 (12:50 -0800)]
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus

Pull MIPS updates from Ralf Baechle:
 "This is the main pull request for MIPS for 4.5 plus some 4.4 fixes.

  The executive summary:

   - ATH79 platform improvments, use DT bindings for the ATH79 USB PHY.
   - Avoid useless rebuilds for zboot.
   - jz4780: Add NEMC, BCH and NAND device tree nodes
   - Initial support for the MicroChip's DT platform.  As all the device
     drivers are missing this is still of limited use.
   - Some Loongson3 cleanups.
   - The unavoidable whitespace polishing.
   - Reduce clock skew when synchronizing the CPU cycle counters on CPU
     startup.
   - Add MIPS R6 fixes.
   - Lots of cleanups across arch/mips as fallout from KVM.
   - Lots of minor fixes and changes for IEEE 754-2008 support to the
     FPU emulator / fp-assist software.
   - Minor Ralink, BCM47xx and bcm963xx platform support improvments.
   - Support SMP on BCM63168"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (84 commits)
  MIPS: zboot: Add support for serial debug using the PROM
  MIPS: zboot: Avoid useless rebuilds
  MIPS: BMIPS: Enable ARCH_WANT_OPTIONAL_GPIOLIB
  MIPS: bcm63xx: nvram: Remove unused bcm63xx_nvram_get_psi_size() function
  MIPS: bcm963xx: Update bcm_tag field image_sequence
  MIPS: bcm963xx: Move extended flash address to bcm_tag header file
  MIPS: bcm963xx: Move Broadcom BCM963xx image tag data structure
  MIPS: bcm63xx: nvram: Use nvram structure definition from header file
  MIPS: bcm963xx: Add Broadcom BCM963xx board nvram data structure
  MAINTAINERS: Add KVM for MIPS entry
  MIPS: KVM: Add missing newline to kvm_err()
  MIPS: Move KVM specific opcodes into asm/inst.h
  MIPS: KVM: Use cacheops.h definitions
  MIPS: Break down cacheops.h definitions
  MIPS: Use EXCCODE_ constants with set_except_vector()
  MIPS: Update trap codes
  MIPS: Move Cause.ExcCode trap codes to mipsregs.h
  MIPS: KVM: Make kvm_mips_{init,exit}() static
  MIPS: KVM: Refactor added offsetof()s
  MIPS: KVM: Convert EXPORT_SYMBOL to _GPL
  ...

8 years agoMerge tag 'platform-drivers-x86-v4.5-2' of git://git.infradead.org/users/dvhart/linux...
Linus Torvalds [Sun, 24 Jan 2016 20:45:35 +0000 (12:45 -0800)]
Merge tag 'platform-drivers-x86-v4.5-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86

Pull x86 platform driver updates from Darren Hart:
 "Emergency travel prevented me from completing my final testing on this
  until today.  Nothing here that couldn't wait until RC1 fixes, but I
  thought it best to get it out sooner rather than later as it does
  contain a build warning fix.

  Summary:

  A build warning fix, MAINTAINERS cleanup, and a new DMI quirk:

  ideapad-laptop:
   - Add Lenovo Yoga 700 to no_hw_rfkill dmi list

  MAINTAINERS:
   - Combine multiple telemetry entries

  intel_telemetry_debugfs:
   - Fix unused warnings in telemetry debugfs"

* tag 'platform-drivers-x86-v4.5-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
  ideapad-laptop: Add Lenovo Yoga 700 to no_hw_rfkill dmi list
  MAINTAINERS: Combine multiple telemetry entries
  intel_telemetry_debugfs: Fix unused warnings in telemetry debugfs

8 years agoMerge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Linus Torvalds [Sun, 24 Jan 2016 20:43:06 +0000 (12:43 -0800)]
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux

Pull thermal management updates from Zhang Rui:
 "The top merge commit was re-generated yesterday because two topic
  branches were dropped from this pull request in the last minute due to
  some unaddressed comments.  All the other material has been in
  linux-next for quite a while.

  Specifics:

   - Enhance thermal core to handle unexpected device cooling states
     after fresh boot and system resume.  From Zhang Rui and Chen Yu.

   - Several fixes and cleanups on Rockchip and RCAR thermal drivers.
     From Caesar Wang and Kuninori Morimoto.

   - Add Broxton support for Intel processor thermal reporting device
     driver.  From Amy Wiles"

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
  thermal: trip_point_temp_store() calls thermal_zone_device_update()
  thermal: rcar: rcar_thermal_get_temp() return error if strange temp
  thermal: rcar: check irq possibility in rcar_thermal_irq_xxx()
  thermal: rcar: check every rcar_thermal_update_temp() return value
  thermal: rcar: move rcar_thermal_dt_ids to upside
  thermal: rockchip: Support the RK3399 SoCs in thermal driver
  thermal: rockchip: Support the RK3228 SoCs in thermal driver
  dt-bindings: rockchip-thermal: Support the RK3228/RK3399 SoCs compatible
  thermal: rockchip: fix a trivial typo
  Thermal: Enable Broxton SoC thermal reporting device
  thermal: constify pch_dev_ops structure
  Thermal: do thermal zone update after a cooling device registered
  Thermal: handle thermal zone device properly during system sleep
  Thermal: initialize thermal zone device correctly

8 years agoMerge tag 'for-linus-4.5-merge-window' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 24 Jan 2016 20:39:09 +0000 (12:39 -0800)]
Merge tag 'for-linus-4.5-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs

Pull 9p updates from Eric Van Hensbergen:
 "Sorry for the last minute pull request, there's was a change that
  didn't get pulled into for-next until two weeks ago and I wanted to
  give it some bake time.

  Summary:

  Rework and error handling fixes, primarily in the fscatch and fd
  transports"

* tag 'for-linus-4.5-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
  fs/9p: use fscache mutex rather than spinlock
  9p: trans_fd, bail out if recv fcall if missing
  9p: trans_fd, read rework to use p9_parse_header
  net/9p: Add device name details on error

8 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
Linus Torvalds [Sun, 24 Jan 2016 20:34:13 +0000 (12:34 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client

Pull Ceph updates from Sage Weil:
 "The two main changes are aio support in CephFS, and a series that
  fixes several issues in the authentication key timeout/renewal code.

  On top of that are a variety of cleanups and minor bug fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  libceph: remove outdated comment
  libceph: kill off ceph_x_ticket_handler::validity
  libceph: invalidate AUTH in addition to a service ticket
  libceph: fix authorizer invalidation, take 2
  libceph: clear messenger auth_retry flag if we fault
  libceph: fix ceph_msg_revoke()
  libceph: use list_for_each_entry_safe
  ceph: use i_size_{read,write} to get/set i_size
  ceph: re-send AIO write request when getting -EOLDSNAP error
  ceph: Asynchronous IO support
  ceph: Avoid to propagate the invalid page point
  ceph: fix double page_unlock() in page_mkwrite()
  rbd: delete an unnecessary check before rbd_dev_destroy()
  libceph: use list_next_entry instead of list_entry_next
  ceph: ceph_frag_contains_value can be boolean
  ceph: remove unused functions in ceph_frag.h

8 years agoMerge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
Linus Torvalds [Sun, 24 Jan 2016 20:31:12 +0000 (12:31 -0800)]
Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6

Pull SMB3 fixes from Steve French:
 "A collection of CIFS/SMB3 fixes.

  It includes a couple bug fixes, a few for improved debugging of
  cifs.ko and some improvements to the way cifs does key generation.

  I do have some additional bug fixes I expect in the next week or two
  (to address a problem found by xfstest, and some fixes for SMB3.11
  dialect, and a couple patches that just came in yesterday that I am
  reviewing)"

* 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
  cifs_dbg() outputs an uninitialized buffer in cifs_readdir()
  cifs: fix race between call_async() and reconnect()
  Prepare for encryption support (first part). Add decryption and encryption key generation. Thanks to Metze for helping with this.
  cifs: Allow using O_DIRECT with cache=loose
  cifs: Make echo interval tunable
  cifs: Check uniqueid for SMB2+ and return -ESTALE if necessary
  Print IP address of unresponsive server
  cifs: Ratelimit kernel log messages

8 years agoideapad-laptop: Add Lenovo Yoga 700 to no_hw_rfkill dmi list
Josh Boyer [Sun, 24 Jan 2016 15:46:42 +0000 (10:46 -0500)]
ideapad-laptop: Add Lenovo Yoga 700 to no_hw_rfkill dmi list

Like the Yoga 900 models the Lenovo Yoga 700 does not have a
hw rfkill switch, and trying to read the hw rfkill switch through the
ideapad module causes it to always reported blocking breaking wifi.

This commit adds the Lenovo Yoga 700 to the no_hw_rfkill dmi list, fixing
the wifi breakage.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1295272
Tested-by: <dinyar.rabady+spam@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
8 years agoMAINTAINERS: Combine multiple telemetry entries
Souvik Kumar Chakravarty [Thu, 21 Jan 2016 04:00:50 +0000 (09:30 +0530)]
MAINTAINERS: Combine multiple telemetry entries

This patch combines all the telemetry file entries in MAINTAINERS via
wildcard.

Signed-off-by: Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
8 years agointel_telemetry_debugfs: Fix unused warnings in telemetry debugfs
Souvik Kumar Chakravarty [Wed, 20 Jan 2016 06:50:46 +0000 (12:20 +0530)]
intel_telemetry_debugfs: Fix unused warnings in telemetry debugfs

This patch fixes compile time warnings when CONFIG_PM_SLEEP
is undefined. In this case sleep related counters are unused.

Signed-off-by: Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
8 years agovmstat: Remove BUG_ON from vmstat_update
Christoph Lameter [Fri, 22 Jan 2016 16:46:14 +0000 (10:46 -0600)]
vmstat: Remove BUG_ON from vmstat_update

If we detect that there is nothing to do just set the flag and do not
check if it was already set before.  Races really do not matter.  If the
flag is set by any code then the shepherd will start dealing with the
situation and reenable the vmstat workers when necessary again.

Since commit 0eb77e988032 ("vmstat: make vmstat_updater deferrable again
and shut down on idle") quiet_vmstat might update cpu_stat_off and mark
a particular cpu to be handled by vmstat_shepherd.  This might trigger a
VM_BUG_ON in vmstat_update because the work item might have been
sleeping during the idle period and see the cpu_stat_off updated after
the wake up.  The VM_BUG_ON is therefore misleading and no more
appropriate.  Moreover it doesn't really suite any protection from real
bugs because vmstat_shepherd will simply reschedule the vmstat_work
anytime it sees a particular cpu set or vmstat_update would do the same
from the worker context directly.  Even when the two would race the
result wouldn't be incorrect as the counters update is fully idempotent.

Reported-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Christoph Lameter <cl@linux.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8 years agoMerge branch '4.4-fixes' into mips-for-linux-next
Ralf Baechle [Sun, 24 Jan 2016 03:14:40 +0000 (04:14 +0100)]
Merge branch '4.4-fixes' into mips-for-linux-next

8 years agoMIPS: zboot: Add support for serial debug using the PROM
Alban Bedel [Thu, 10 Dec 2015 09:57:21 +0000 (10:57 +0100)]
MIPS: zboot: Add support for serial debug using the PROM

As most platforms implement the PROM serial interface prom_putchar()
add a simple bridge to allow re-using this code for zboot.

Signed-off-by: Alban Bedel <albeu@free.fr>
Cc: Alex Smith <alex.smith@imgtec.com>
Cc: Andrew Bresticker <abrestic@chromium.org>
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/11811/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: zboot: Avoid useless rebuilds
Alban Bedel [Thu, 10 Dec 2015 09:57:20 +0000 (10:57 +0100)]
MIPS: zboot: Avoid useless rebuilds

Add dummy.o to the targets list, and fill targets automatically from
$(vmlinuzobjs) to avoid having to maintain two lists.

When building with XZ compression copy ashldi3.c to the build
directory to use a different object file for the kernel and zboot.
Without this the same object file need to be build with different
flags which cause a rebuild at every run.

Signed-off-by: Alban Bedel <albeu@free.fr>
Cc: linux-mips@linux-mips.org
Cc: Alex Smith <alex.smith@imgtec.com>
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Andrew Bresticker <abrestic@chromium.org>
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/11810/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: BMIPS: Enable ARCH_WANT_OPTIONAL_GPIOLIB
Florian Fainelli [Wed, 6 Jan 2016 18:51:05 +0000 (10:51 -0800)]
MIPS: BMIPS: Enable ARCH_WANT_OPTIONAL_GPIOLIB

Allow BMIPS_GENERIC supported platforms to build GPIO controller
drivers.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Dragan Stancevic <dragan.stancevic@gmail.com>
Cc: cernekee@gmail.com
Cc: jaedon.shin@gmail.com
Cc: gregory.0xf0@gmail.com
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/12019/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: bcm63xx: nvram: Remove unused bcm63xx_nvram_get_psi_size() function
Simon Arlott [Sun, 13 Dec 2015 22:50:13 +0000 (22:50 +0000)]
MIPS: bcm63xx: nvram: Remove unused bcm63xx_nvram_get_psi_size() function

Remove bcm63xx_nvram_get_psi_size() as it now has no users.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Jonas Gorski <jogo@openwrt.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: MIPS Mailing List <linux-mips@linux-mips.org>
Cc: MTD Maling List <linux-mtd@lists.infradead.org>
Patchwork: https://patchwork.linux-mips.org/patch/11836/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: bcm963xx: Update bcm_tag field image_sequence
Simon Arlott [Sun, 13 Dec 2015 22:48:44 +0000 (22:48 +0000)]
MIPS: bcm963xx: Update bcm_tag field image_sequence

The "dual_image" and "inactive_flag" fields should be merged into a single
"image_sequence" field.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Jonas Gorski <jogo@openwrt.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: MIPS Mailing List <linux-mips@linux-mips.org>
Cc: MTD Maling List <linux-mtd@lists.infradead.org>
Patchwork: https://patchwork.linux-mips.org/patch/11834/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: bcm963xx: Move extended flash address to bcm_tag header file
Simon Arlott [Sun, 13 Dec 2015 22:47:55 +0000 (22:47 +0000)]
MIPS: bcm963xx: Move extended flash address to bcm_tag header file

The extended flash address needs to be subtracted from bcm_tag flash
image offsets. Move this value to the bcm_tag header file.

Renamed define name to consistently use bcm963xx for flash layout
which should be considered a property of the board and not the SoC
(i.e. bcm63xx could theoretically be used on a board without CFE
or any flash).

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Jonas Gorski <jogo@openwrt.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: MIPS Mailing List <linux-mips@linux-mips.org>
Cc: MTD Maling List <linux-mtd@lists.infradead.org>
Patchwork: https://patchwork.linux-mips.org/patch/11833/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: bcm963xx: Move Broadcom BCM963xx image tag data structure
Simon Arlott [Sun, 13 Dec 2015 22:46:59 +0000 (22:46 +0000)]
MIPS: bcm963xx: Move Broadcom BCM963xx image tag data structure

Move Broadcom BCM963xx image tag data structure to include/linux/
so that drivers outside of mach-bcm63xx can use it.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Jonas Gorski <jogo@openwrt.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: MIPS Mailing List <linux-mips@linux-mips.org>
Cc: MTD Maling List <linux-mtd@lists.infradead.org>
Patchwork: https://patchwork.linux-mips.org/patch/11832/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: bcm63xx: nvram: Use nvram structure definition from header file
Simon Arlott [Sun, 13 Dec 2015 22:46:15 +0000 (22:46 +0000)]
MIPS: bcm63xx: nvram: Use nvram structure definition from header file

Use the common definition of the nvram structure from the header file
include/linux/bcm963xx_nvram.h instead of maintaining a separate copy.

Read the version 5 size of nvram data from memory and then call the
new checksum verification function from the header file.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Jonas Gorski <jogo@openwrt.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: MIPS Mailing List <linux-mips@linux-mips.org>
Cc: MTD Maling List <linux-mtd@lists.infradead.org>
Patchwork: https://patchwork.linux-mips.org/patch/11831/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: bcm963xx: Add Broadcom BCM963xx board nvram data structure
Simon Arlott [Sun, 13 Dec 2015 22:45:30 +0000 (22:45 +0000)]
MIPS: bcm963xx: Add Broadcom BCM963xx board nvram data structure

Broadcom BCM963xx boards have multiple nvram variants across different
SoCs with additional checksum fields added whenever the size of the
nvram was extended.

Add this structure as a header file so that multiple drivers can use it.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Jonas Gorski <jogo@openwrt.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: MIPS Mailing List <linux-mips@linux-mips.org>
Cc: MTD Maling List <linux-mtd@lists.infradead.org>
Patchwork: https://patchwork.linux-mips.org/patch/11830/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma
Linus Torvalds [Sun, 24 Jan 2016 02:45:06 +0000 (18:45 -0800)]
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma

Pull rdma updates from Doug Ledford:
 "Initial roundup of 4.5 merge window patches

   - Remove usage of ib_query_device and instead store attributes in
     ib_device struct

   - Move iopoll out of block and into lib, rename to irqpoll, and use
     in several places in the rdma stack as our new completion queue
     polling library mechanism.  Update the other block drivers that
     already used iopoll to use the new mechanism too.

   - Replace the per-entry GID table locks with a single GID table lock

   - IPoIB multicast cleanup

   - Cleanups to the IB MR facility

   - Add support for 64bit extended IB counters

   - Fix for netlink oops while parsing RDMA nl messages

   - RoCEv2 support for the core IB code

   - mlx4 RoCEv2 support

   - mlx5 RoCEv2 support

   - Cross Channel support for mlx5

   - Timestamp support for mlx5

   - Atomic support for mlx5

   - Raw QP support for mlx5

   - MAINTAINERS update for mlx4/mlx5

   - Misc ocrdma, qib, nes, usNIC, cxgb3, cxgb4, mlx4, mlx5 updates

   - Add support for remote invalidate to the iSER driver (pushed
     through the RDMA tree due to dependencies, acknowledged by nab)

   - Update to NFSoRDMA (pushed through the RDMA tree due to
     dependencies, acknowledged by Bruce)"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (169 commits)
  IB/mlx5: Unify CQ create flags check
  IB/mlx5: Expose Raw Packet QP to user space consumers
  {IB, net}/mlx5: Move the modify QP operation table to mlx5_ib
  IB/mlx5: Support setting Ethernet priority for Raw Packet QPs
  IB/mlx5: Add Raw Packet QP query functionality
  IB/mlx5: Add create and destroy functionality for Raw Packet QP
  IB/mlx5: Refactor mlx5_ib_qp to accommodate other QP types
  IB/mlx5: Allocate a Transport Domain for each ucontext
  net/mlx5_core: Warn on unsupported events of QP/RQ/SQ
  net/mlx5_core: Add RQ and SQ event handling
  net/mlx5_core: Export transport objects
  IB/mlx5: Expose CQE version to user-space
  IB/mlx5: Add CQE version 1 support to user QPs and SRQs
  IB/mlx5: Fix data validation in mlx5_ib_alloc_ucontext
  IB/sa: Fix netlink local service GFP crash
  IB/srpt: Remove redundant wc array
  IB/qib: Improve ipoib UD performance
  IB/mlx4: Advertise RoCE v2 support
  IB/mlx4: Create and use another QP1 for RoCEv2
  IB/mlx4: Enable send of RoCE QP1 packets with IP/UDP headers
  ...

8 years agoMAINTAINERS: Add KVM for MIPS entry
James Hogan [Wed, 16 Dec 2015 23:49:41 +0000 (23:49 +0000)]
MAINTAINERS: Add KVM for MIPS entry

I've pretty much been maintaining KVM for MIPS for a while now. Lets
make it more official (and make sure I get Cc'd on relevant patches).

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/11898/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: KVM: Add missing newline to kvm_err()
James Hogan [Wed, 16 Dec 2015 23:49:39 +0000 (23:49 +0000)]
MIPS: KVM: Add missing newline to kvm_err()

Add missing newline to end of kvm_err string when guest PMAP couldn't be
allocated.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11896/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: Move KVM specific opcodes into asm/inst.h
James Hogan [Wed, 16 Dec 2015 23:49:38 +0000 (23:49 +0000)]
MIPS: Move KVM specific opcodes into asm/inst.h

The header arch/mips/kvm/opcode.h defines a few extra opcodes which
aren't in arch/mips/include/uapi/asm/inst.h. There's nothing KVM
specific about them, so lets move them into inst.h where they belong and
delete the header.

Note that mfmcz_op is renamed to mfmc0_op to match the instruction set
manual, and wait_op was already added to inst.h in commit b0a3eae2b943
("MIPS: inst.h: define COP0 wait op"), merged in v3.16-rc1.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/11895/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
8 years agoMIPS: KVM: Use cacheops.h definitions
James Hogan [Wed, 16 Dec 2015 23:49:37 +0000 (23:49 +0000)]
MIPS: KVM: Use cacheops.h definitions

Drop the custom cache operation code definitions used by KVM for
emulating guest CACHE instructions, and switch to use the existing
definitions in <asm/cacheops.h>.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11893/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>