deliverable/linux.git
10 years agoMerge branch 'pci/misc' into next
Bjorn Helgaas [Thu, 31 Oct 2013 20:12:40 +0000 (14:12 -0600)] 
Merge branch 'pci/misc' into next

* pci/misc:
  PCI: Report pci_pme_active() kmalloc failure
  mn10300/PCI: Remove useless pcibios_last_bus
  frv/PCI: Remove pcibios_last_bus
  PCI: Fail MSI/MSI-X initialization if device is not in PCI_D0
  x86/PCI: Coalesce multiple overlapping host bridge windows
  MAINTAINERS: Add arch/x86/pci to PCI file patterns
  PCI/PM: Remove pci_pm_complete()
  PCI: Add pci_dev_show_local_cpu() to simplify code
  mn10300/PCI: Remove unused pci_mem_start
  cris/PCI: Remove unused pci_mem_start
  PCI: Make pci_dev_pm_ops static

Conflicts:
drivers/pci/pci-sysfs.c

10 years agoMerge branch 'pci/yijing-mps-v1' into next
Bjorn Helgaas [Thu, 31 Oct 2013 20:05:13 +0000 (14:05 -0600)] 
Merge branch 'pci/yijing-mps-v1' into next

* pci/yijing-mps-v1:
  drm/radeon: use pcie_get_readrq() and pcie_set_readrq() to simplify code
  staging: et131x: Use pci_dev->pcie_mpss and pcie_set_readrq() to simplify code
  IB/qib: Drop qib_tune_pcie_caps() and qib_tune_pcie_coalesce() return values
  IB/qib: Use pcie_set_mps() and pcie_get_mps() to simplify code
  IB/qib: Use pci_is_root_bus() to check whether it is a root bus
  tile/PCI: use cached pci_dev->pcie_mpss to simplify code
  PCI: Export pcie_set_mps() and pcie_get_mps()

10 years agoMerge branch 'pci/host-rcar' into next
Bjorn Helgaas [Thu, 31 Oct 2013 19:58:49 +0000 (13:58 -0600)] 
Merge branch 'pci/host-rcar' into next

* pci/host-rcar:
  PCI: Add R-Car Gen2 internal PCI support

10 years agoMerge branch 'pci/host-imx6' into next
Bjorn Helgaas [Thu, 31 Oct 2013 19:58:38 +0000 (13:58 -0600)] 
Merge branch 'pci/host-imx6' into next

* pci/host-imx6:
  PCI: imx6: Probe the PCIe in fs_initcall()
  PCI: imx6: Remove redundant of_match_ptr
  PCI: imx6: Increase link startup timeout
  PCI: imx6: Fix imprecise abort handler
  PCI: imx6: Remove redundant dev_err() in imx6_pcie_probe()

10 years agoMerge branch 'pci/host-exynos' into next
Bjorn Helgaas [Thu, 31 Oct 2013 19:58:29 +0000 (13:58 -0600)] 
Merge branch 'pci/host-exynos' into next

* pci/host-exynos:
  PCI: exynos: Remove redundant of_match_ptr
  PCI: designware: Add irq_create_mapping()
  PCI: designware: Make dw_pcie_rd_own_conf(), etc., static
  PCI: designware: Add header guards
  PCI: exynos: Add missing clk_disable_unprepare() on error path

10 years agoMerge branch 'pci/gregkh-driver-core' into next
Bjorn Helgaas [Thu, 31 Oct 2013 19:50:08 +0000 (13:50 -0600)] 
Merge branch 'pci/gregkh-driver-core' into next

* pci/gregkh-driver-core:
  PCI: Make pci_bus_attrs, pci_dev_attrs, dev_rescan_attr, dev_remove_attr, vga_attr static
  PCI: convert bus code to use dev_groups
  PCI: convert bus code to use drv_groups
  PCI: convert bus code to use bus_groups

10 years agoPCI: imx6: Probe the PCIe in fs_initcall()
Marek Vasut [Tue, 15 Oct 2013 16:06:38 +0000 (18:06 +0200)] 
PCI: imx6: Probe the PCIe in fs_initcall()

Probe the PCIe driver in fs_initcall() instead of module_init()
to assure that pci_assign_unassigned_resources() will be called
early.  This function is called in dw_pcie_host_init(), which is
in turn called from imx6_add_pcie_port(), which is called from
imx6_pcie_probe().  If this is not called early, we will hit
resource collisions since pcieport driver is then probed way too
late.

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Frank Li <lznuaa@gmail.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Mohit KUMAR <Mohit.KUMAR@st.com>
Cc: Pratyush Anand <pratyush.anand@st.com>
Cc: Richard Zhu <r65037@freescale.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Sean Cross <xobs@kosagi.com>
Cc: Siva Reddy Kallam <siva.kallam@samsung.com>
Cc: Srikanth T Shivanand <ts.srikanth@samsung.com>
Cc: Tim Harvey <tharvey@gateworks.com>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Yinghai Lu <yinghai@kernel.org>
10 years agoPCI: Add R-Car Gen2 internal PCI support
Valentine Barshak [Tue, 29 Oct 2013 16:12:51 +0000 (20:12 +0400)] 
PCI: Add R-Car Gen2 internal PCI support

This adds internal PCI controller driver for R-Car Gen2 SoC.  There are
three PCI controllers available with only a single EHCI/OHCI device
built-in on each PCI bus.  This gives us three USB channels.  Channel 0 is
shared with the USBHS device, while channel 2 is shared with the USBSS.

The PCI controllers do not support I/O port space mapping, and it is not
needed here.

Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: imx6: Remove redundant of_match_ptr
Sachin Kamat [Mon, 21 Oct 2013 09:06:41 +0000 (14:36 +0530)] 
PCI: imx6: Remove redundant of_match_ptr

imx6_pcie_of_match is always compiled in because PCI_IMX6 depends on
SOC_IMX6Q, which only supports OF build.  Hence of_match_ptr is not
required.

[bhelgaas: add changelog details from Shawn]
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Sean Cross <xobs@kosagi.com>
10 years agoPCI: Report pci_pme_active() kmalloc failure
Bjorn Helgaas [Wed, 16 Oct 2013 18:32:53 +0000 (12:32 -0600)] 
PCI: Report pci_pme_active() kmalloc failure

Previously, if kmalloc() failed, we claimed "PME# enabled" in dmesg,
even though we didn't add the device to the pci_pme_list.  This prints
a more correct warning.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agomn10300/PCI: Remove useless pcibios_last_bus
Bjorn Helgaas [Wed, 23 Oct 2013 03:06:20 +0000 (21:06 -0600)] 
mn10300/PCI: Remove useless pcibios_last_bus

pcibios_last_bus was apparently copied from x86.  On mn10300, it is
statically initialized to -1 and may be set with the "pci=lastbus=<X>"
boot option, but it is never tested.  This patch removes everything
related to pcibios_last_bus.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agofrv/PCI: Remove pcibios_last_bus
Bjorn Helgaas [Wed, 23 Oct 2013 02:55:46 +0000 (20:55 -0600)] 
frv/PCI: Remove pcibios_last_bus

pcibios_last_bus was apparently copied from x86.  On FR-V, it is
statically initialized to -1 and never changed unless the user boots
with "pci=lastbus=<X>".  I doubt that option is used on FR-V, so this
patch removes all the code related to pcibios_last_bus.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: imx6: Increase link startup timeout
Marek Vasut [Wed, 23 Oct 2013 05:12:18 +0000 (22:12 -0700)] 
PCI: imx6: Increase link startup timeout

A longer link startup timeout is required when certain PCI switches are
attached to the root complex.  This was tested with a Pericom switch
and a PLX switch.

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Tim Harvey <tharvey@gateworks.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoPCI: exynos: Remove redundant of_match_ptr
Sachin Kamat [Mon, 21 Oct 2013 09:06:43 +0000 (14:36 +0530)] 
PCI: exynos: Remove redundant of_match_ptr

This driver is DT only.  Hence of_match_ptr is not required.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
10 years agoPCI: imx6: Fix imprecise abort handler
Tim Harvey [Fri, 18 Oct 2013 00:27:22 +0000 (17:27 -0700)] 
PCI: imx6: Fix imprecise abort handler

An imprecise abort is triggered when a port behind a switch is accessed
and no device is present.  At enumeration, imprecise aborts are not enabled
thus this ends up getting deferred until the kernel has completed init.  At
that point we must not adjust PC - the handler must do nothing, but a
handler must exist.

This fixes random crashes that occur right after freeing init.

Tested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Marek Vasut <marex@denx.de>
10 years agoPCI: Fail MSI/MSI-X initialization if device is not in PCI_D0
Yijing Wang [Thu, 10 Oct 2013 12:58:11 +0000 (20:58 +0800)] 
PCI: Fail MSI/MSI-X initialization if device is not in PCI_D0

Currently, pci_enable_msi() and pci_enable_msix() return success even if
the device power state is not D0.  However, we don't write the MSI message
to the device registers, and the registers will never be updated later.

This patch makes pci_enable_msi() and pci_enable_msix() return an error
instead.

[bhelgaas: changelog]
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Acked-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: imx6: Remove redundant dev_err() in imx6_pcie_probe()
Wei Yongjun [Sat, 12 Oct 2013 06:11:02 +0000 (14:11 +0800)] 
PCI: imx6: Remove redundant dev_err() in imx6_pcie_probe()

There is an error message within devm_ioremap_resource()
already, so remove the dev_err() call to avoid redundant
error message.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
10 years agox86/PCI: Coalesce multiple overlapping host bridge windows
Alexey Neyman [Wed, 9 Oct 2013 22:16:38 +0000 (16:16 -0600)] 
x86/PCI: Coalesce multiple overlapping host bridge windows

Previously we coalesced windows by expanding the first overlapping one and
making the second invalid.  But we never look at the expanded first window
again, so we fail to notice other windows that overlap it.  For example, we
coalesced these:

  [io  0x0000-0x03af] // #0
  [io  0x03e0-0x0cf7] // #1
  [io  0x0000-0xdfff] // #2

into these, which still overlap:

  [io  0x0000-0xdfff] // #0
  [io  0x03e0-0x0cf7] // #1

The fix is to expand the *second* overlapping resource and ignore the
first, so we get this instead with no overlaps:

  [io  0x0000-0xdfff] // #2

[bhelgaas: changelog]
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=62511
Signed-off-by: Alexey Neyman <stilor@att.net>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoMAINTAINERS: Add arch/x86/pci to PCI file patterns
Bjorn Helgaas [Wed, 9 Oct 2013 20:39:08 +0000 (14:39 -0600)] 
MAINTAINERS: Add arch/x86/pci to PCI file patterns

I handle many arch/x86/pci changes, so help those patches get to the
PCI patchwork.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
10 years agoPCI: designware: Add irq_create_mapping()
Pratyush Anand [Wed, 9 Oct 2013 12:32:12 +0000 (21:32 +0900)] 
PCI: designware: Add irq_create_mapping()

Without irq_create_mapping(), the correct IRQ number cannot be
provided.  In this case, it makes problems such as NULL dereference.
Thus, irq_create_mapping() should be added for MSI.

Suggested-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Pratyush Anand <pratyush.anand@st.com>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: designware: Make dw_pcie_rd_own_conf(), etc., static
Bjorn Helgaas [Wed, 9 Oct 2013 15:12:37 +0000 (09:12 -0600)] 
PCI: designware: Make dw_pcie_rd_own_conf(), etc., static

The following variables and functions are used only in pcie-designware.c,
so make them static:

  global_io_offset
  dw_pcie_rd_own_conf()
  dw_pcie_wr_own_conf()
  dw_pcie_setup()
  dw_pcie_scan_bus()
  dw_pcie_map_irq()

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
10 years agoPCI: designware: Add header guards
Seungwon Jeon [Wed, 9 Oct 2013 15:12:21 +0000 (09:12 -0600)] 
PCI: designware: Add header guards

Add header guards to prevent redundant inclusion.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI/PM: Remove pci_pm_complete()
Liu Chuansheng [Mon, 7 Oct 2013 21:29:27 +0000 (15:29 -0600)] 
PCI/PM: Remove pci_pm_complete()

88d26136 ("PM: Prevent runtime suspend during system resume") removed the
pm_runtime_put_sync() from pci_pm_complete() to PM core code
device_complete().

Here the pci_pm_complete() is doing the same work which can be done in
device_complete(), so we can remove it directly.

Signed-off-by: Liu Chuansheng <chuansheng.liu@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agoPCI: Add pci_dev_show_local_cpu() to simplify code
Yijing Wang [Mon, 30 Sep 2013 07:02:38 +0000 (15:02 +0800)] 
PCI: Add pci_dev_show_local_cpu() to simplify code

local_cpus_show() and local_cpulist_show() are almost the same.
This adds a new helper function, pci_dev_show_local_cpu(), to simplify
code.

The same strategy is already used by cpuaffinity_show() and
cpulistaffinity_show().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agomn10300/PCI: Remove unused pci_mem_start
Myron Stowe [Sat, 28 Sep 2013 17:59:56 +0000 (11:59 -0600)] 
mn10300/PCI: Remove unused pci_mem_start

Remove unused 'pci_mem_start' variable.

Signed-off-by: Myron Stowe <myron.stowe@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: David Howells <dhowells@redhat.com>
CC: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
10 years agocris/PCI: Remove unused pci_mem_start
Myron Stowe [Sat, 28 Sep 2013 17:55:49 +0000 (11:55 -0600)] 
cris/PCI: Remove unused pci_mem_start

Remove unused 'pci_mem_start' variable.

Signed-off-by: Myron Stowe <myron.stowe@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Mikael Starvik <starvik@axis.com>
CC: Jesper Nilsson <jesper.nilsson@axis.com>
10 years agoPCI: Make pci_dev_pm_ops static
Sachin Kamat [Fri, 4 Oct 2013 18:04:44 +0000 (12:04 -0600)] 
PCI: Make pci_dev_pm_ops static

pci_dev_pm_ops is local to pci-driver.c.  Make it static.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: Make pci_bus_attrs, pci_dev_attrs, dev_rescan_attr, dev_remove_attr, vga_attr...
Sachin Kamat [Sat, 28 Sep 2013 10:12:00 +0000 (15:42 +0530)] 
PCI: Make pci_bus_attrs, pci_dev_attrs, dev_rescan_attr, dev_remove_attr, vga_attr static

Local variables used only in this file are made static.

[bhelgaas: also make pci_dev_attrs[] static (from Fengguang)]
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: convert bus code to use dev_groups
Greg Kroah-Hartman [Mon, 7 Oct 2013 06:55:40 +0000 (23:55 -0700)] 
PCI: convert bus code to use dev_groups

The dev_attrs field of struct bus_type is going away soon, dev_groups
should be used instead.  This converts the PCI bus code to use the
correct field.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: convert bus code to use drv_groups
Greg Kroah-Hartman [Mon, 7 Oct 2013 20:51:20 +0000 (14:51 -0600)] 
PCI: convert bus code to use drv_groups

The drv_attrs field of struct bus_type is going away soon, drv_groups
should be used instead.  This converts the PCI bus code to use the
correct field.

Cc: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoPCI: convert bus code to use bus_groups
Greg Kroah-Hartman [Mon, 7 Oct 2013 20:51:02 +0000 (14:51 -0600)] 
PCI: convert bus code to use bus_groups

The bus_attrs field of struct bus_type is going away soon, dev_groups
should be used instead.  This converts the PCI bus code to use the
correct field.

Cc: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoPCI: exynos: Add missing clk_disable_unprepare() on error path
Wei Yongjun [Sun, 29 Sep 2013 02:29:11 +0000 (10:29 +0800)] 
PCI: exynos: Add missing clk_disable_unprepare() on error path

Add the missing clk_disable_unprepare() before return
from exynos_pcie_probe() in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
10 years agodrm/radeon: use pcie_get_readrq() and pcie_set_readrq() to simplify code
Yijing Wang [Mon, 9 Sep 2013 13:13:08 +0000 (21:13 +0800)] 
drm/radeon: use pcie_get_readrq() and pcie_set_readrq() to simplify code

Use pcie_get_readrq() and pcie_set_readrq() functions to simplify code.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
10 years agostaging: et131x: Use pci_dev->pcie_mpss and pcie_set_readrq() to simplify code
Yijing Wang [Mon, 9 Sep 2013 13:13:07 +0000 (21:13 +0800)] 
staging: et131x: Use pci_dev->pcie_mpss and pcie_set_readrq() to simplify code

The PCI core caches the "PCIe Max Payload Size Supported" in
pci_dev->pcie_mpss, so use that instead of pcie_capability_read_dword().
Also use pcie_set_readrq() instead of pcie_capability_clear_and_set_word()
to simplify code.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Mark Einon <mark.einon@gmail.com>
10 years agoIB/qib: Drop qib_tune_pcie_caps() and qib_tune_pcie_coalesce() return values
Bjorn Helgaas [Tue, 24 Sep 2013 20:24:49 +0000 (14:24 -0600)] 
IB/qib: Drop qib_tune_pcie_caps() and qib_tune_pcie_coalesce() return values

The callers of qib_tune_pcie_caps() and qib_tune_pcie_coalesce() don't
check the return values, so this patch drops the return values altogether.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
10 years agoMerge branch 'pci/misc' into next
Bjorn Helgaas [Fri, 27 Sep 2013 22:35:43 +0000 (16:35 -0600)] 
Merge branch 'pci/misc' into next

* pci/misc:
  PCI: Remove unused PCI_MSIX_FLAGS_BIRMASK definition
  PCI: acpiphp_ibm: Convert to dynamic debug
  PCI: acpiphp: Convert to dynamic debug
  PCI: Remove Intel Haswell D3 delays
  PCI: Pass type, width, and prefetchability for window alignment
  PCI: Document reason for using pci_is_root_bus()
  PCI: Use pci_is_root_bus() to check for root bus
  PCI: Remove unused "is_pcie" from pci_dev structure
  PCI: Update pci_find_slot() description in pci.txt
  [SCSI] qla2xxx: Use standard PCIe Capability Link register field names
  PCI: Fix comment typo, remove unnecessary !! in pci_is_pcie()
  PCI: Drop "setting latency timer" messages

10 years agoPCI: Remove unused PCI_MSIX_FLAGS_BIRMASK definition
Yijing Wang [Thu, 12 Sep 2013 08:20:00 +0000 (16:20 +0800)] 
PCI: Remove unused PCI_MSIX_FLAGS_BIRMASK definition

PCI_MSIX_FLAGS_BIRMASK has been replaced by PCI_MSIX_TABLE_BIR for better
readability.  Now no one uses it, remove it.  No functional change.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoMerge branch 'pci/host-tegra' into next
Bjorn Helgaas [Fri, 27 Sep 2013 19:27:20 +0000 (13:27 -0600)] 
Merge branch 'pci/host-tegra' into next

* pci/host-tegra:
  PCI: tegra: Add missing __iomem annotation

10 years agoMerge branch 'pci/host-imx6' into next
Bjorn Helgaas [Fri, 27 Sep 2013 19:24:10 +0000 (13:24 -0600)] 
Merge branch 'pci/host-imx6' into next

* pci/host-imx6:
  PCI: imx6: Add support for i.MX6 PCIe controller
  ARM: imx6q: Add PCIe bits to GPR syscon definition

10 years agoPCI: imx6: Add support for i.MX6 PCIe controller
Sean Cross [Thu, 26 Sep 2013 03:24:47 +0000 (11:24 +0800)] 
PCI: imx6: Add support for i.MX6 PCIe controller

Add support for the PCIe port present on the i.MX6 family of controllers.
These use the Synopsis Designware core tied to their own PHY.

Signed-off-by: Sean Cross <xobs@kosagi.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
10 years agoARM: imx6q: Add PCIe bits to GPR syscon definition
Sean Cross [Thu, 26 Sep 2013 03:24:46 +0000 (11:24 +0800)] 
ARM: imx6q: Add PCIe bits to GPR syscon definition

PCIe requires additional bits be defined for GPR8 and GPR12.

Signed-off-by: Sean Cross <xobs@kosagi.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoMerge branch 'pci/host-exynos' into next
Bjorn Helgaas [Fri, 27 Sep 2013 19:06:41 +0000 (13:06 -0600)] 
Merge branch 'pci/host-exynos' into next

* pci/host-exynos:
  PCI: exynos: Turn off power of phy block when link failed
  PCI: exynos: Add support for MSI
  MAINTAINERS: Add Jingoo Han as Samsung Exynos PCIe driver maintainer

10 years agoPCI: acpiphp_ibm: Convert to dynamic debug
Lan Tianyu [Wed, 25 Sep 2013 00:07:28 +0000 (18:07 -0600)] 
PCI: acpiphp_ibm: Convert to dynamic debug

This patch is to use pr_debug/info/warn/err to replace acpiphp_ibm debug
functions and remove module's debug param.

User interface change: before this patch, boot with the "acpiphp_ibm.debug"
kernel parameter to turn on debug.  After this patch, set
CONFIG_DYNAMIC_DEBUG=y and boot with "acpiphp_ibm.dyndebug=+p" instead.
See Documentation/dynamic-debug-howto.txt.

[bhelgaas: changelog]
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: acpiphp: Convert to dynamic debug
Lan Tianyu [Wed, 25 Sep 2013 00:11:48 +0000 (18:11 -0600)] 
PCI: acpiphp: Convert to dynamic debug

This patch is to use pr_debug/info/warn/err to replace acpiphp debug
functions and remove module's debug param.

User interface change: before this patch, boot with the "acpiphp.debug"
kernel parameter to turn on debug.  After this patch, set
CONFIG_DYNAMIC_DEBUG=y and boot with "acpiphp.dyndebug=+p" instead.
See Documentation/dynamic-debug-howto.txt.

[bhelgaas: changelog]
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: tegra: Add missing __iomem annotation
Jingoo Han [Wed, 25 Sep 2013 22:40:54 +0000 (16:40 -0600)] 
PCI: tegra: Add missing __iomem annotation

Added missing __iomem annotation in order to fix the following
sparse warnings:

drivers/pci/host/pci-tegra.c:411:41: warning: incorrect type in return expression (different address spaces)
drivers/pci/host/pci-tegra.c:411:41:    expected void [noderef] <asn:2>*
drivers/pci/host/pci-tegra.c:411:41:    got void *addr
drivers/pci/host/pci-tegra.c:419:25: warning: incorrect type in return expression (different address spaces)
drivers/pci/host/pci-tegra.c:419:25:    expected void [noderef] <asn:2>*
drivers/pci/host/pci-tegra.c:419:25:    got void *addr

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Thierry Reding <treding@nvidia.com>
10 years agoPCI: exynos: Turn off power of phy block when link failed
Jingoo Han [Fri, 6 Sep 2013 08:21:45 +0000 (17:21 +0900)] 
PCI: exynos: Turn off power of phy block when link failed

When link failed, there is no need to turn on phy block. Also,
turning on phy block is added, in order to turn on phy block
regardless of the default value of phy registers.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: exynos: Add support for MSI
Jingoo Han [Fri, 6 Sep 2013 06:54:59 +0000 (15:54 +0900)] 
PCI: exynos: Add support for MSI

This patch adds support for Message Signaled Interrupt in the
Exynos PCIe driver using Synopsys designware PCIe core IP.

Signed-off-by: Siva Reddy Kallam <siva.kallam@samsung.com>
Signed-off-by: Srikanth T Shivanand <ts.srikanth@samsung.com>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Pratyush Anand <pratyush.anand@st.com>
Cc: Mohit KUMAR <Mohit.KUMAR@st.com>
10 years agoMAINTAINERS: Add Jingoo Han as Samsung Exynos PCIe driver maintainer
Jingoo Han [Thu, 12 Sep 2013 11:29:24 +0000 (20:29 +0900)] 
MAINTAINERS: Add Jingoo Han as Samsung Exynos PCIe driver maintainer

Add myself as maintainer for Samsung Exynos PCIe driver.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: Remove Intel Haswell D3 delays
Todd E Brandt [Tue, 10 Sep 2013 23:10:43 +0000 (16:10 -0700)] 
PCI: Remove Intel Haswell D3 delays

The latest Intel Haswell chipsets have a hardware optimization which
allows on-chip PCI devices to ignore the 10ms delay before entering
or exiting D3 suspend.

This patch implements the optimization as a PCI quirk, since we want
tight control over which devices use it. This way we can test each device
individually to be sure there are no issues before we enable the quirk.
The first set of devices are from the Haswell platform, which includes
every PCI device that is on the northbridge and southbridge.

This patch reduces the Haswell suspend time from 93 ms to 47 ms and resume
time from 160 ms to 64 ms.

Signed-off-by: Todd Brandt <todd.e.brandt@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agoPCI: Pass type, width, and prefetchability for window alignment
Wei Yang [Fri, 6 Sep 2013 01:45:58 +0000 (09:45 +0800)] 
PCI: Pass type, width, and prefetchability for window alignment

When calculating window_alignment(), type information like IORESOURCE_MEM
and IORESOURCE_PREFETCH may not be enough.  For example, on powernv, we
need to know whether the window is 64-bit or not.

This patch passes the full resource type (res->flags) for window alignment.

[bhelgaas: changelog]
Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Gavin Shan <shangw@linux.vnet.ibm.com>
10 years agoPCI: Document reason for using pci_is_root_bus()
Bjorn Helgaas [Tue, 24 Sep 2013 21:14:57 +0000 (15:14 -0600)] 
PCI: Document reason for using pci_is_root_bus()

Some code assumes "bus->self == NULL" means the bus is a root bus.  This
adds a comment explaining why this is incorrect ("virtual" buses added for
SR-IOV have "bus->self == NULL" but are not root buses).

No functional change.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: Use pci_is_root_bus() to check for root bus
Wei Yang [Fri, 6 Sep 2013 01:45:56 +0000 (09:45 +0800)] 
PCI: Use pci_is_root_bus() to check for root bus

In __pci_bus_size_bridges() we check whether a bus is a root bus by testing
bus->self.  As indicated by commit 79af72d7 ("PCI: pci_is_root_bus
helper"), bus->self == NULL is not a proper way to check for a root bus.
One issue is that "virtual" buses added for SR-IOV (via virtfn_add_bus())
have bus->self == NULL but are not root buses.

This patch changes it to pci_is_root_bus() to check whether it is a root
bus.

[bhelgaas: changelog]
Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: Remove unused "is_pcie" from pci_dev structure
Yijing Wang [Tue, 3 Sep 2013 02:02:09 +0000 (10:02 +0800)] 
PCI: Remove unused "is_pcie" from pci_dev structure

No one uses "is_pcie" now; remove this obsolete member.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: Update pci_find_slot() description in pci.txt
Yijing Wang [Mon, 2 Sep 2013 06:34:40 +0000 (14:34 +0800)] 
PCI: Update pci_find_slot() description in pci.txt

pci_find_slot() has been removed from the kernel.  Document its
closest replacement, pci_get_domain_bus_and_slot(), instead.

[bhelgaas: fix indentation, keep mention in "obsolete" section]
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years ago[SCSI] qla2xxx: Use standard PCIe Capability Link register field names
Bjorn Helgaas [Fri, 6 Sep 2013 17:26:24 +0000 (11:26 -0600)] 
[SCSI] qla2xxx: Use standard PCIe Capability Link register field names

Use the standard #defines for PCIe Link Capability register fields
rather than bare numbers.  This also uses the new PCI Express Capability
accessor rather than reading the capability directly.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Acked-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
10 years agoPCI: Fix comment typo, remove unnecessary !! in pci_is_pcie()
Joe Perches [Tue, 3 Sep 2013 20:31:05 +0000 (13:31 -0700)] 
PCI: Fix comment typo, remove unnecessary !! in pci_is_pcie()

Use normal kernel-doc "Returns:" instead of "retrun"
Assignment to bool is always 1 or 0 so the !! isn't necessary.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: Drop "setting latency timer" messages
Bjorn Helgaas [Mon, 23 Sep 2013 21:25:26 +0000 (15:25 -0600)] 
PCI: Drop "setting latency timer" messages

This message isn't useful any more, so drop it.

Reference: https://bugzilla.kernel.org/show_bug.cgi?id=60636
Reported-by: Oleksil Shevchuk <alxchk@gmail.com>
Reference: http://lkml.kernel.org/r/CALCETrWkr53ZjqdN3t7rTTfr=+ZKZXJoYsuBcwPf0kN_33GfAw@mail.gmail.com
Reported-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoIB/qib: Use pcie_set_mps() and pcie_get_mps() to simplify code
Yijing Wang [Mon, 9 Sep 2013 13:13:06 +0000 (21:13 +0800)] 
IB/qib: Use pcie_set_mps() and pcie_get_mps() to simplify code

Refactor qib_tune_pcie_caps().  Use pcie_get_mps(), pcie_set_mps(),
pcie_get_readrq(), and pcie_set_readrq() to simplify the code.  The PCI
core caches the "PCIe Max Payload Size Supported" in pci_dev->pcie_mpss,
so use that instead of pcie_capability_read_word().  Remove the unused
val2fld() and fld2val().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
10 years agoIB/qib: Use pci_is_root_bus() to check whether it is a root bus
Yijing Wang [Mon, 9 Sep 2013 13:13:05 +0000 (21:13 +0800)] 
IB/qib: Use pci_is_root_bus() to check whether it is a root bus

Use pci_is_root_bus() instead of "if (bus->parent)" statement
for better readability.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
10 years agotile/PCI: use cached pci_dev->pcie_mpss to simplify code
Yijing Wang [Mon, 9 Sep 2013 13:13:04 +0000 (21:13 +0800)] 
tile/PCI: use cached pci_dev->pcie_mpss to simplify code

The PCI core caches the "PCIe Max Payload Size Supported" in
pci_dev->pcie_mpss, so use that instead of pcie_capability_read_dword().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: Export pcie_set_mps() and pcie_get_mps()
Yijing Wang [Tue, 24 Sep 2013 18:08:06 +0000 (12:08 -0600)] 
PCI: Export pcie_set_mps() and pcie_get_mps()

Export pcie_get_mps() and pcie_set_mps() functions so drivers can use
them to simplify code.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoMerge branch 'pci/yijing-pci_is_pcie-v2' into next
Bjorn Helgaas [Tue, 24 Sep 2013 00:00:08 +0000 (18:00 -0600)] 
Merge branch 'pci/yijing-pci_is_pcie-v2' into next

* pci/yijing-pci_is_pcie-v2:
  powerpc/pci: Use pci_is_pcie() to simplify code
  [SCSI] qla2xxx: Use pcie_is_pcie() to simplify code
  [SCSI] csiostor: Use pcie_capability_clear_and_set_word() to simplify code
  [SCSI] bfa: Use pcie_set()/get_readrq() to simplify code
  x86/pci: Use cached pci_dev->pcie_cap to simplify code
  PCI: Use pci_is_pcie() to simplify code

10 years agoMerge branch 'pci/bjorn-osc' into next
Bjorn Helgaas [Mon, 23 Sep 2013 23:58:08 +0000 (17:58 -0600)] 
Merge branch 'pci/bjorn-osc' into next

* pci/bjorn-osc:
  PCI/ACPI: Decode _OSC bitmasks symbolically
  PCI/ACPI: Separate out _OSC "we don't support enough services" path
  PCI/ACPI: Separate out _OSC "PCIe port services disabled" path
  PCI/ACPI: Skip _OSC control tests if _OSC support call failed
  PCI/ACPI: Run _OSC only once for OSPM feature support
  PCI/ACPI: Split _OSC "support" and "control" flags into separate variables
  PCI/ACPI: Move _OSC stuff from acpi_pci_root_add() to negotiate_os_control()
  PCI/ACPI: Drop unnecessary _OSC existence tests
  PCI/ACPI: Name _OSC #defines more consistently
  ACPI: Write OSC_PCI_CONTROL_MASKS like OSC_PCI_SUPPORT_MASKS
  ACPI: Remove unused OSC_PCI_NATIVE_HOTPLUG
  ACPI: Tidy acpi_run_osc() declarations
  ACPI: Rename OSC_QUERY_TYPE to OSC_QUERY_DWORD
  ACPI: Write _OSC bit field definitions in hex

10 years agoPCI/ACPI: Decode _OSC bitmasks symbolically
Bjorn Helgaas [Thu, 5 Sep 2013 21:07:45 +0000 (15:07 -0600)] 
PCI/ACPI: Decode _OSC bitmasks symbolically

This updates _OSC-related messages to be more human-readable.  We now always
show the features we declare support for (this was previously invisible) as
well as the features we are granted control of.

Typical changes:

  -acpi PNP0A08:00: Requesting ACPI _OSC control (0x1d)
  -acpi PNP0A08:00: ACPI _OSC control (0x1d) granted
  +acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI]
  +acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME AER PCIeCapability]

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agoPCI/ACPI: Separate out _OSC "we don't support enough services" path
Bjorn Helgaas [Thu, 5 Sep 2013 21:50:52 +0000 (15:50 -0600)] 
PCI/ACPI: Separate out _OSC "we don't support enough services" path

Test the services we support (extended config space, ASPM, MSI) separately
so we can give a better message.  Previously we said "Unable to request
_OSC control..."; now we'll say "we support %#02x but %#02x are required".

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agoPCI/ACPI: Separate out _OSC "PCIe port services disabled" path
Bjorn Helgaas [Thu, 5 Sep 2013 21:07:43 +0000 (15:07 -0600)] 
PCI/ACPI: Separate out _OSC "PCIe port services disabled" path

Test "pcie_ports_disabled" separately so we can give a better message.
Previously we said "Unable to request _OSC control..."; now we'll
say "PCIe port services disabled; not requesting _OSC control".

"pcie_ports_disabled" is true when CONFIG_PCIEPORTBUS=n or we boot
with "pcie_ports=compat".

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agoPCI/ACPI: Skip _OSC control tests if _OSC support call failed
Bjorn Helgaas [Thu, 5 Sep 2013 21:07:43 +0000 (15:07 -0600)] 
PCI/ACPI: Skip _OSC control tests if _OSC support call failed

If the _OSC support notification fails, we will never request control
(because "support == OSC_PCI_SEGMENT_GROUPS_SUPPORT", which doesn't include
all the features in ACPI_PCIE_REQ_SUPPORT), so we can return early to
simplify the code.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agoPCI/ACPI: Run _OSC only once for OSPM feature support
Bjorn Helgaas [Thu, 5 Sep 2013 21:07:42 +0000 (15:07 -0600)] 
PCI/ACPI: Run _OSC only once for OSPM feature support

Previously, we ran _OSC once to tell the platform that we support
PCI Segment Groups, then we ran it again if we supported any additional
features (ASPM, MSI, or extended config space).  I don't think it's
necessary to run it twice, since we can easily build the complete
mask of features we support before running _OSC the first time.

We run _OSC again later when requesting control of PCIe features;
that's unaffected by this change.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agoPCI/ACPI: Split _OSC "support" and "control" flags into separate variables
Bjorn Helgaas [Thu, 5 Sep 2013 21:07:42 +0000 (15:07 -0600)] 
PCI/ACPI: Split _OSC "support" and "control" flags into separate variables

Previously we used "flags" for both:

  - the bitmask of features we support (segments, ASPM, MSI, etc.), and
  - the bitmask of features we want to control (native hotplug, AER, etc.)

To reduce confusion, this patch splits this into two variables:
"support" is the bitmask of features we support, and "control" is the
bitmask of features we want to control.  No functional change.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agoPCI/ACPI: Move _OSC stuff from acpi_pci_root_add() to negotiate_os_control()
Bjorn Helgaas [Thu, 5 Sep 2013 21:07:41 +0000 (15:07 -0600)] 
PCI/ACPI: Move _OSC stuff from acpi_pci_root_add() to negotiate_os_control()

This doesn't change any of the _OSC code; it just moves it out into
a new function so it doesn't clutter acpi_pci_root_add() so much.  This
also enables future simplifications.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agoPCI/ACPI: Drop unnecessary _OSC existence tests
Bjorn Helgaas [Thu, 5 Sep 2013 21:07:41 +0000 (15:07 -0600)] 
PCI/ACPI: Drop unnecessary _OSC existence tests

There's no need to check whether _OSC exists here; we eventually
call acpi_evaluate_object(..., "_OSC", ...), and that will fail
gracefully if _OSC doesn't exist.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agoPCI/ACPI: Name _OSC #defines more consistently
Bjorn Helgaas [Thu, 5 Sep 2013 21:07:39 +0000 (15:07 -0600)] 
PCI/ACPI: Name _OSC #defines more consistently

Make PCI Host Bridge _OSC #defines more consistent.  No functional change.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agoACPI: Write OSC_PCI_CONTROL_MASKS like OSC_PCI_SUPPORT_MASKS
Bjorn Helgaas [Thu, 5 Sep 2013 21:24:24 +0000 (15:24 -0600)] 
ACPI: Write OSC_PCI_CONTROL_MASKS like OSC_PCI_SUPPORT_MASKS

We write OSC_PCI_SUPPORT_MASKS as a simple 0x1f, so do the same
for OSC_PCI_CONTROL_MASKS.  No functional change.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agoACPI: Remove unused OSC_PCI_NATIVE_HOTPLUG
Bjorn Helgaas [Thu, 5 Sep 2013 21:22:11 +0000 (15:22 -0600)] 
ACPI: Remove unused OSC_PCI_NATIVE_HOTPLUG

OSC_PCI_NATIVE_HOTPLUG is completely unused, so remove it.  No functional
change.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agoACPI: Tidy acpi_run_osc() declarations
Bjorn Helgaas [Thu, 5 Sep 2013 21:05:55 +0000 (15:05 -0600)] 
ACPI: Tidy acpi_run_osc() declarations

Move the acpi_run_osc() prototype next to the related structure and
update comments.  No functional change.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agoACPI: Rename OSC_QUERY_TYPE to OSC_QUERY_DWORD
Bjorn Helgaas [Thu, 5 Sep 2013 21:05:54 +0000 (15:05 -0600)] 
ACPI: Rename OSC_QUERY_TYPE to OSC_QUERY_DWORD

OSC_QUERY_TYPE isn't a "type"; it's an index into the _OSC Capabilities
Buffer of DWORDs.  Rename OSC_QUERY_TYPE, OSC_SUPPORT_TYPE, and
OSC_CONTROL_TYPE to OSC_QUERY_DWORD, etc., to make this clear.
No functional change.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agoACPI: Write _OSC bit field definitions in hex
Bjorn Helgaas [Thu, 5 Sep 2013 21:05:53 +0000 (15:05 -0600)] 
ACPI: Write _OSC bit field definitions in hex

Update _OSC definition comments to correspond to the 1-based spec wording
(DWORD 1, etc.)  Write _OSC field #defines as hex to make clear that they
are bits in a 32-bit DWORD, not arbitrary values.  No functional change.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agopowerpc/pci: Use pci_is_pcie() to simplify code
Yijing Wang [Thu, 5 Sep 2013 07:55:27 +0000 (15:55 +0800)] 
powerpc/pci: Use pci_is_pcie() to simplify code

Use pci_is_pcie() to simplify code.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Reviewed-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Cc: Gavin Shan <shangw@linux.vnet.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
10 years ago[SCSI] qla2xxx: Use pcie_is_pcie() to simplify code
Yijing Wang [Thu, 5 Sep 2013 07:55:30 +0000 (15:55 +0800)] 
[SCSI] qla2xxx: Use pcie_is_pcie() to simplify code

Use pci_is_pcie() instead of pci_find_capability() to simplify code.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>
Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: linux-driver@qlogic.com
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
10 years ago[SCSI] csiostor: Use pcie_capability_clear_and_set_word() to simplify code
Yijing Wang [Thu, 5 Sep 2013 07:55:26 +0000 (15:55 +0800)] 
[SCSI] csiostor: Use pcie_capability_clear_and_set_word() to simplify code

pci_is_pcie() and pcie_capability_clear_and_set_word() make it trivial
to set the PCIe Completion Timeout, so just fold the
csio_set_pcie_completion_timeout() function into its caller.

[bhelgaas: changelog, fold csio_set_pcie_completion_timeout() into caller]
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Jiang Liu <jiang.liu@huawei.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Naresh Kumar Inna <naresh@chelsio.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jesper Juhl <jj@chaosbits.net>
10 years ago[SCSI] bfa: Use pcie_set()/get_readrq() to simplify code
Yijing Wang [Thu, 5 Sep 2013 07:55:25 +0000 (15:55 +0800)] 
[SCSI] bfa: Use pcie_set()/get_readrq() to simplify code

Use pcie_get_readrq()/pcie_set_readrq() to simplify code.

Jon Mason proposed a similar patch a couple years ago (see below).

[bhelgaas: validate pcie_max_read_reqsz, add pointer to Jon's patch]
Reference: http://lkml.kernel.org/r/1309191190-14670-1-git-send-email-jdmason@kudzu.us
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Jiang Liu <jiang.liu@huawei.com>
Cc: Anil Gurumurthy <agurumur@brocade.com>
Cc: Vijaya Mohan Guvva <vmohan@brocade.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
10 years agox86/pci: Use cached pci_dev->pcie_cap to simplify code
Yijing Wang [Thu, 5 Sep 2013 07:55:28 +0000 (15:55 +0800)] 
x86/pci: Use cached pci_dev->pcie_cap to simplify code

The PCI core caches the PCIe Capability offset in pci_dev->pcie_cap, so
use that instead of pci_find_capability().  Use pci_bus_set_ops() when
replacing the device pci_ops.  And use #defines instead of numeric
constants.

[bhelgaas: changelog, also use PCI_EXP_LNKCTL_ASPMC]
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: Use pci_is_pcie() to simplify code
Yijing Wang [Thu, 5 Sep 2013 07:55:29 +0000 (15:55 +0800)] 
PCI: Use pci_is_pcie() to simplify code

Use pci_is_pcie() instead of pci_find_capability() to simplify code.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoLinux 3.12-rc2
Linus Torvalds [Mon, 23 Sep 2013 22:41:09 +0000 (15:41 -0700)] 
Linux 3.12-rc2

10 years agoMerge tag 'staging-3.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
Linus Torvalds [Mon, 23 Sep 2013 19:53:07 +0000 (12:53 -0700)] 
Merge tag 'staging-3.12-rc2' of git://git./linux/kernel/git/gregkh/staging

Pull staging fixes from Greg KH:
 "Here are a number of small staging tree and iio driver fixes.  Nothing
  major, just lots of little things"

* tag 'staging-3.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (34 commits)
  iio:buffer_cb: Add missing iio_buffer_init()
  iio: Prevent race between IIO chardev opening and IIO device free
  iio: fix: Keep a reference to the IIO device for open file descriptors
  iio: Stop sampling when the device is removed
  iio: Fix crash when scan_bytes is computed with active_scan_mask == NULL
  iio: Fix mcp4725 dev-to-indio_dev conversion in suspend/resume
  iio: Fix bma180 dev-to-indio_dev conversion in suspend/resume
  iio: Fix tmp006 dev-to-indio_dev conversion in suspend/resume
  iio: iio_device_add_event_sysfs() bugfix
  staging: iio: ade7854-spi: Fix return value
  staging:iio:hmc5843: Fix measurement conversion
  iio: isl29018: Fix uninitialized value
  staging:iio:dummy fix kfifo_buf kconfig dependency issue if kfifo modular and buffer enabled for built in dummy driver.
  iio: at91: fix adc_clk overflow
  staging: line6: add bounds check in snd_toneport_source_put()
  Staging: comedi: Fix dependencies for drivers misclassified as PCI
  staging: r8188eu: Adjust RX gain
  staging: r8188eu: Fix smatch warning in core/rtw_ieee80211.
  staging: r8188eu: Fix smatch error in core/rtw_mlme_ext.c
  staging: r8188eu: Fix Smatch off-by-one warning in hal/rtl8188e_hal_init.c
  ...

10 years agoMerge tag 'usb-3.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Mon, 23 Sep 2013 19:52:35 +0000 (12:52 -0700)] 
Merge tag 'usb-3.12-rc2' of git://git./linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
 "Here are a number of small USB fixes for 3.12-rc2.

  One is a revert of a EHCI change that isn't quite ready for 3.12.
  Others are minor things, gadget fixes, Kconfig fixes, and some quirks
  and documentation updates.

  All have been in linux-next for a bit"

* tag 'usb-3.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  USB: pl2303: distinguish between original and cloned HX chips
  USB: Faraday fotg210: fix email addresses
  USB: fix typo in usb serial simple driver Kconfig
  Revert "USB: EHCI: support running URB giveback in tasklet context"
  usb: s3c-hsotg: do not disconnect gadget when receiving ErlySusp intr
  usb: s3c-hsotg: fix unregistration function
  usb: gadget: f_mass_storage: reset endpoint driver data when disabled
  usb: host: fsl-mph-dr-of: Staticize local symbols
  usb: gadget: f_eem: Staticize eem_alloc
  usb: gadget: f_ecm: Staticize ecm_alloc
  usb: phy: omap-usb3: Fix return value
  usb: dwc3: gadget: avoid memory leak when failing to allocate all eps
  usb: dwc3: remove extcon dependency
  usb: gadget: add '__ref' for rndis_config_register() and cdc_config_register()
  usb: dwc3: pci: add support for BayTrail
  usb: gadget: cdc2: fix conversion to new interface of f_ecm
  usb: gadget: fix a bug and a WARN_ON in dummy-hcd
  usb: gadget: mv_u3d_core: fix violation of locking discipline in mv_u3d_ep_disable()

10 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Mon, 23 Sep 2013 02:51:49 +0000 (19:51 -0700)] 
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 - some small fixes for msm and exynos
 - a regression revert affecting nouveau users with old userspace
 - intel pageflip deadlock and gpu hang fixes, hsw modesetting hangs

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (22 commits)
  Revert "drm: mark context support as a legacy subsystem"
  drm/i915: Don't enable the cursor on a disable pipe
  drm/i915: do not update cursor in crtc mode set
  drm/exynos: fix return value check in lowlevel_buffer_allocate()
  drm/exynos: Fix address space warnings in exynos_drm_fbdev.c
  drm/exynos: Fix address space warning in exynos_drm_buf.c
  drm/exynos: Remove redundant OF dependency
  drm/msm: drop unnecessary set_need_resched()
  drm/i915: kill set_need_resched
  drm/msm: fix potential NULL pointer dereference
  drm/i915/dvo: set crtc timings again for panel fixed modes
  drm/i915/sdvo: Robustify the dtd<->drm_mode conversions
  drm/msm: workaround for missing irq
  drm/msm: return -EBUSY if bo still active
  drm/msm: fix return value check in ERR_PTR()
  drm/msm: fix cmdstream size check
  drm/msm: hangcheck harder
  drm/msm: handle read vs write fences
  drm/i915/sdvo: Fully translate sync flags in the dtd->mode conversion
  drm/i915: Use proper print format for debug prints
  ...

10 years agoMerge branch 'for-3.12/core' of git://git.kernel.dk/linux-block
Linus Torvalds [Sun, 22 Sep 2013 22:00:11 +0000 (15:00 -0700)] 
Merge branch 'for-3.12/core' of git://git.kernel.dk/linux-block

Pull block IO fixes from Jens Axboe:
 "After merge window, no new stuff this time only a collection of neatly
  confined and simple fixes"

* 'for-3.12/core' of git://git.kernel.dk/linux-block:
  cfq: explicitly use 64bit divide operation for 64bit arguments
  block: Add nr_bios to block_rq_remap tracepoint
  If the queue is dying then we only call the rq->end_io callout. This leaves bios setup on the request, because the caller assumes when the blk_execute_rq_nowait/blk_execute_rq call has completed that the rq->bios have been cleaned up.
  bio-integrity: Fix use of bs->bio_integrity_pool after free
  blkcg: relocate root_blkg setting and clearing
  block: Convert kmalloc_node(...GFP_ZERO...) to kzalloc_node(...)
  block: trace all devices plug operation

10 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
Linus Torvalds [Sun, 22 Sep 2013 21:58:49 +0000 (14:58 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/mason/linux-btrfs

Pull btrfs fixes from Chris Mason:
 "These are mostly bug fixes and a two small performance fixes.  The
  most important of the bunch are Josef's fix for a snapshotting
  regression and Mark's update to fix compile problems on arm"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (25 commits)
  Btrfs: create the uuid tree on remount rw
  btrfs: change extent-same to copy entire argument struct
  Btrfs: dir_inode_operations should use btrfs_update_time also
  btrfs: Add btrfs: prefix to kernel log output
  btrfs: refuse to remount read-write after abort
  Btrfs: btrfs_ioctl_default_subvol: Revert back to toplevel subvolume when arg is 0
  Btrfs: don't leak transaction in btrfs_sync_file()
  Btrfs: add the missing mutex unlock in write_all_supers()
  Btrfs: iput inode on allocation failure
  Btrfs: remove space_info->reservation_progress
  Btrfs: kill delay_iput arg to the wait_ordered functions
  Btrfs: fix worst case calculator for space usage
  Revert "Btrfs: rework the overcommit logic to be based on the total size"
  Btrfs: improve replacing nocow extents
  Btrfs: drop dir i_size when adding new names on replay
  Btrfs: replay dir_index items before other items
  Btrfs: check roots last log commit when checking if an inode has been logged
  Btrfs: actually log directory we are fsync()'ing
  Btrfs: actually limit the size of delalloc range
  Btrfs: allocate the free space by the existed max extent size when ENOSPC
  ...

10 years agocfq: explicitly use 64bit divide operation for 64bit arguments
Anatol Pomozov [Sun, 22 Sep 2013 18:43:47 +0000 (12:43 -0600)] 
cfq: explicitly use 64bit divide operation for 64bit arguments

'samples' is 64bit operant, but do_div() second parameter is 32.
do_div silently truncates high 32 bits and calculated result
is invalid.

In case if low 32bit of 'samples' are zeros then do_div() produces
kernel crash.

Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
10 years agoMerge tag 'iio-fixes-for-3.12a' of git://git.kernel.org/pub/scm/linux/kernel/git...
Greg Kroah-Hartman [Sat, 21 Sep 2013 23:45:36 +0000 (16:45 -0700)] 
Merge tag 'iio-fixes-for-3.12a' of git://git./linux/kernel/git/jic23/iio into staging-linus

Jonathan writes:

First round of IIO fixes for 3.12

A series of wrong 'struct dev' assumptions in suspend/resume callbacks
following on from this issue being identified in a new driver review.
One to watch out for in future.

A number of driver specific fixes
1) at91 - fix a overflow in clock rate computation
2) dummy - Kconfig dependency issue
3) isl29018 - uninitialized value
4) hmc5843 - measurement conversion bug introduced by recent cleanup.
5) ade7854-spi - wrong return value.

Some IIO core fixes
1) Wrong value picked up for event code creation for a modified channel
2) A null dereference on failure to initialize a buffer after no buffer has
   been in use, when using the available_scan_masks approach.
3) Sampling not stopped when a device is removed. Effects forced removal
   such as hot unplugging.
4) Prevent device going away if a chrdev is still open in userspace.
5) Prevent race on chardev opening and device being freed.
6) Add a missing iio_buffer_init in the call back buffer.

These last few are the first part of a set from Lars-Peter Clausen who
has been taking a closer look at our removal paths and buffer handling
than anyone has for quite some time.

10 years agoMerge tag 'nfs-for-3.12-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Linus Torvalds [Sat, 21 Sep 2013 22:59:41 +0000 (15:59 -0700)] 
Merge tag 'nfs-for-3.12-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull NFS client bugfix from Trond Myklebust:
 "Fix a regression due to incorrect sharing of gss auth caches"

* tag 'nfs-for-3.12-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
  RPCSEC_GSS: fix crash on destroying gss auth

10 years agoblock: Add nr_bios to block_rq_remap tracepoint
Jun'ichi Nomura [Sat, 21 Sep 2013 19:57:47 +0000 (13:57 -0600)] 
block: Add nr_bios to block_rq_remap tracepoint

Adding the number of bios in a remapped request to 'block_rq_remap'
tracepoint.

Request remapper clones bios in a request to track the completion
status of each bio. So the number of bios can be useful information
for investigation.

Related discussions:
  http://www.redhat.com/archives/dm-devel/2013-August/msg00084.html
  http://www.redhat.com/archives/dm-devel/2013-September/msg00024.html

Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
10 years agoBtrfs: create the uuid tree on remount rw
Josef Bacik [Sat, 21 Sep 2013 02:33:20 +0000 (22:33 -0400)] 
Btrfs: create the uuid tree on remount rw

Users have been complaining of the uuid tree stuff warning that there is no uuid
root when trying to do snapshot operations.  This is because if you mount -o ro
we will not create the uuid tree.  But then if you mount -o rw,remount we will
still not create it and then any subsequent snapshot/subvol operations you try
to do will fail gloriously.  Fix this by creating the uuid_root on remount rw if
it was not already there.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
10 years agobtrfs: change extent-same to copy entire argument struct
Mark Fasheh [Tue, 17 Sep 2013 22:43:54 +0000 (15:43 -0700)] 
btrfs: change extent-same to copy entire argument struct

btrfs_ioctl_file_extent_same() uses __put_user_unaligned() to copy some data
back to it's argument struct. Unfortunately, not all architectures provide
__put_user_unaligned(), so compiles break on them if btrfs is selected.

Instead, just copy the whole struct in / out at the start and end of
operations, respectively.

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
10 years agoBtrfs: dir_inode_operations should use btrfs_update_time also
Guangyu Sun [Mon, 16 Sep 2013 17:42:03 +0000 (10:42 -0700)] 
Btrfs: dir_inode_operations should use btrfs_update_time also

Commit 2bc5565286121d2a77ccd728eb3484dff2035b58 (Btrfs: don't update atime on
RO subvolumes) ensures that the access time of an inode is not updated when
the inode lives in a read-only subvolume.
However, if a directory on a read-only subvolume is accessed, the atime is
updated. This results in a write operation to a read-only subvolume. I
believe that access times should never be updated on read-only subvolumes.

To reproduce:

 # mkfs.btrfs -f /dev/dm-3
 (...)
 # mount /dev/dm-3 /mnt
 # btrfs subvol create /mnt/sub
  Create subvolume '/mnt/sub'
 # mkdir /mnt/sub/dir
 # echo "abc" > /mnt/sub/dir/file
 # btrfs subvol snapshot -r /mnt/sub /mnt/rosnap
  Create a readonly snapshot of '/mnt/sub' in '/mnt/rosnap'
 # stat /mnt/rosnap/dir
  File: `/mnt/rosnap/dir'
  Size: 8         Blocks: 0          IO Block: 4096   directory
 Device: 16h/22d    Inode: 257         Links: 1
 Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
  Access: 2013-09-11 07:21:49.389157126 -0400
  Modify: 2013-09-11 07:22:02.330156079 -0400
  Change: 2013-09-11 07:22:02.330156079 -0400
 # ls /mnt/rosnap/dir
  file
 # stat /mnt/rosnap/dir
  File: `/mnt/rosnap/dir'
  Size: 8         Blocks: 0          IO Block: 4096   directory
 Device: 16h/22d    Inode: 257         Links: 1
 Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
  Access: 2013-09-11 07:22:56.797151670 -0400
  Modify: 2013-09-11 07:22:02.330156079 -0400
  Change: 2013-09-11 07:22:02.330156079 -0400

Reported-by: Koen De Wit <koen.de.wit@oracle.com>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
10 years agobtrfs: Add btrfs: prefix to kernel log output
Frank Holton [Fri, 13 Sep 2013 15:46:50 +0000 (11:46 -0400)] 
btrfs: Add btrfs: prefix to kernel log output

The kernel log entries for device label %s and device fsid %pU
are missing the btrfs: prefix. Add those here.

Signed-off-by: Frank Holton <fholton@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
10 years agobtrfs: refuse to remount read-write after abort
David Sterba [Fri, 13 Sep 2013 15:41:20 +0000 (17:41 +0200)] 
btrfs: refuse to remount read-write after abort

It's still possible to flip the filesystem into RW mode after it's
remounted RO due to an abort. There are lots of places that check for
the superblock error bit and will not write data, but we should not let
the filesystem appear read-write.

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
10 years agoBtrfs: btrfs_ioctl_default_subvol: Revert back to toplevel subvolume when arg is 0
chandan [Fri, 13 Sep 2013 14:04:10 +0000 (19:34 +0530)] 
Btrfs: btrfs_ioctl_default_subvol: Revert back to toplevel subvolume when arg is 0

This patch makes it possible to set BTRFS_FS_TREE_OBJECTID as the default
subvolume by passing a subvolume id of 0.

Signed-off-by: chandan <chandan@linux.vnet.ibm.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
10 years agoBtrfs: don't leak transaction in btrfs_sync_file()
Filipe David Borba Manana [Wed, 11 Sep 2013 19:36:44 +0000 (20:36 +0100)] 
Btrfs: don't leak transaction in btrfs_sync_file()

In btrfs_sync_file(), if the call to btrfs_log_dentry_safe() returns
a negative error (for e.g. -ENOMEM via btrfs_log_inode()), we would
return without ending/freeing the transaction.

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This page took 0.04668 seconds and 5 git commands to generate.