1. 08 Jan, 2014 1 commit
  2. 02 Jan, 2014 1 commit
  3. 20 Dec, 2013 14 commits
  4. 19 Dec, 2013 11 commits
    • Greg Kroah-Hartman's avatar
      PCI/MSI: Export MSI mode using attributes, not kobjects · 1c51b50c
      Greg Kroah-Hartman authored
      The PCI MSI sysfs code is a mess with kobjects for things that don't really
      need to be kobjects.  This patch creates attributes dynamically for the MSI
      interrupts instead of using kobjects.
      
      Note, this removes a directory from sysfs.  Old MSI kobjects:
      
        pci_device
           └── msi_irqs
               └── 40
                   └── mode
      
      New MSI attributes:
      
        pci_device
           └── msi_irqs
               └── 40
      
      As there was only one file "mode" with the kobject model, the interrupt
      number is now a file that returns the "mode" of the interrupt (msi vs.
      msix).
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      1c51b50c
    • Bjorn Helgaas's avatar
      PCI/portdrv: Remove extra get_device()/put_device() for pcie_device · e75f34ce
      Bjorn Helgaas authored
      Previously pcie_device_init() called get_device() if device_register() for
      the new pcie_device succeeded, and remove_iter() called put_device() when
      removing before unregistering the device.
      
      But device_register() already increments the reference count in
      device_add(), so we don't need to do it again here.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      e75f34ce
    • Levente Kurusa's avatar
      PCI/portdrv: Add put_device() after device_register() failure · f3986205
      Levente Kurusa authored
      This is required so that we give up the last reference to the device.
      Removed the kfree() as put_device will result in release_pcie_device()
      being called and hence the container of the device will be kfree'd.
      
      [bhelgaas: fix conflict after my previous cleanup]
      Signed-off-by: default avatarLevente Kurusa <levex@linux.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      f3986205
    • Bjorn Helgaas's avatar
      PCI/portdrv: Cleanup error paths · 8f3acca9
      Bjorn Helgaas authored
      Make the straightline path the normal no-error path.  Check for errors and
      return them directly, instead of checking for success and putting the
      normal path in an "if" body.
      
      No functional change.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      8f3acca9
    • Sachin Kamat's avatar
      PCI: mvebu: Remove redundant of_match_ptr · 339135ff
      Sachin Kamat authored
      mvebu_pcie_of_match_table is always compiled in.  Hence of_match_ptr is not
      required.
      Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      339135ff
    • Richard Zhu's avatar
      PCI: imx6: Fix bugs in PCIe startup code · bc9ef770
      Richard Zhu authored
      LTSSM shouldn't be set once in assert_core_reset().  Move peripheral reset
      just before LTSSM start.
      Signed-off-by: default avatarRichard Zhu <r65037@freescale.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
      Cc: Frank Li <lznuaa@gmail.com>
      Cc: Harro Haan <hrhaan@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>
      bc9ef770
    • Marek Vasut's avatar
      PCI: imx6: Start link in Gen1 before negotiating for Gen2 mode · fa33a6d8
      Marek Vasut authored
      This patch first forces the link into Gen1 mode before starting up the link
      and, only after the link is up, start negotiating possible Gen2 mode
      operation.  This is because without such sequence, some PCIe switches are
      not detected at all.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
      Cc: Frank Li <lznuaa@gmail.com>
      Cc: Harro Haan <hrhaan@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>
      fa33a6d8
    • Marek Vasut's avatar
      PCI: imx6: Factor out link up wait loop · 66a60f93
      Marek Vasut authored
      Split the function that waits for the PCIe link to come up from the rest if
      the host init function.  We will find this change useful in the subsequent
      patch, since this will be called twice then.
      
      No functional change.
      
      [bhelgaas: remove useless "return;"]
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
      Cc: Frank Li <lznuaa@gmail.com>
      Cc: Harro Haan <hrhaan@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>
      66a60f93
    • Marek Vasut's avatar
      PCI: imx6: Factor out PHY reset · 982aa234
      Marek Vasut authored
      Split the PCIe PHY reset from the link up function to make the code a
      little more structured.
      
      No functional change.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
      Cc: Frank Li <lznuaa@gmail.com>
      Cc: Harro Haan <hrhaan@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>
      982aa234
    • Marek Vasut's avatar
      PCI: imx6: Report "link up" only after link training completes · 7f9f40c0
      Marek Vasut authored
      While waiting for the PHY to report the PCIe link is up, we might hit a
      situation where the link training is still in progress, while the PHY
      already reports the link is up.  Add additional check for this condition.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
      Cc: Frank Li <lznuaa@gmail.com>
      Cc: Harro Haan <hrhaan@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>
      7f9f40c0
    • Marek Vasut's avatar
      PCI: imx6: Make reset-gpio optional · c28f8a1f
      Marek Vasut authored
      Some boards do not have a PCIe reset GPIO.  To avoid probe failure on these
      boards, make the reset GPIO optional as well.
      
      [bhelgaas: whitespace fixes]
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarJingoo Han <jg1.han@samsung.com>
      Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
      Cc: Frank Li <lznuaa@gmail.com>
      Cc: Harro Haan <hrhaan@gmail.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>
      c28f8a1f
  5. 18 Dec, 2013 13 commits
    • Bjorn Helgaas's avatar
      Merge branch 'pci/vc' into next · 608235a3
      Bjorn Helgaas authored
      * pci/vc:
        PCI: Rename PCI_VC_PORT_REG1/2 to PCI_VC_PORT_CAP1/2
        PCI: Add Virtual Channel to save/restore support
        PCI: Add support for save/restore of extended capabilities
        PCI: Add pci_wait_for_pending() (refactor pci_wait_for_pending_transaction())
      608235a3
    • Bjorn Helgaas's avatar
      Merge branch 'pci/pciehp' into next · a737f76b
      Bjorn Helgaas authored
      * pci/pciehp:
        PCI: pciehp: Move Attention & Power Indicator support tests to accessors
        PCI: pciehp: Use symbolic constants for Slot Control fields
        PCI: pciehp: Use symbolic constants, not hard-coded bitmask
        PCI: pciehp: Simplify "Power Fault Detected" checking/clearing
        PCI: pciehp: Announce slot capabilities (slot #, button, LEDs, etc)
        PCI: pciehp: Make various functions void since they can't fail
        PCI: pciehp: Remove error checks when accessing PCIe Capability
        PCI: pciehp: Drop pciehp_readw()/pciehp_writew() wrappers
      a737f76b
    • Bjorn Helgaas's avatar
      Merge branch 'pci/host-tegra' into next · 765147f8
      Bjorn Helgaas authored
      * pci/host-tegra:
        PCI: Disable Gen2 for Tegra20 and Tegra30
      765147f8
    • Bjorn Helgaas's avatar
      Merge branch 'pci/host-rcar' into next · 1c898ba1
      Bjorn Helgaas authored
      * pci/host-rcar:
        PCI: rcar: Add runtime PM support
        PCI: rcar: Fix rcar_pci_probe() return value check
      1c898ba1
    • Bjorn Helgaas's avatar
      Merge branch 'pci/host-mvebu' into next · 7160266a
      Bjorn Helgaas authored
      * pci/host-mvebu:
        PCI: mvebu: Remove duplicate of_clk_get_by_name() call
        PCI: mvebu: Support a bridge with no IO port window
        PCI: mvebu: Obey bridge PCI_COMMAND_MEM and PCI_COMMAND_IO bits
        PCI: mvebu: Drop writes to bridge Secondary Status register
      7160266a
    • Bjorn Helgaas's avatar
      Merge branch 'pci/host-imx6' into next · ed00f97d
      Bjorn Helgaas authored
      * pci/host-imx6:
        PCI: imx6: Remove unneeded 'goto err'
        PCI: imx6: Remove unneeded check of platform_get_resource()
      ed00f97d
    • Bjorn Helgaas's avatar
      Merge branch 'pci/host-designware' into next · c354e811
      Bjorn Helgaas authored
      * pci/host-designware:
        PCI: designware: Use typical "for" loop idiom
        PCI: designware: Remove redundant call to pci_write_config_word()
        PCI: designware: Fix crash in dw_msi_teardown_irq()
      c354e811
    • Bjorn Helgaas's avatar
      Merge branch 'pci/deletion' into next · 330ebfe3
      Bjorn Helgaas authored
      * pci/deletion:
        PCI: Remove from bus_list and release resources in pci_release_dev()
        PCI: Move pci_proc_attach_device() to pci_bus_add_device()
        PCI: Use device_release_driver() in pci_stop_root_bus()
        PCI: Move device_del() from pci_stop_dev() to pci_destroy_dev()
      
      Conflicts:
      	drivers/pci/remove.c
      330ebfe3
    • Bjorn Helgaas's avatar
      Merge branch 'pci/aer' into next · d9cdfb87
      Bjorn Helgaas authored
      * pci/aer:
        PCI/AER: Consolidate HEST error source parsers
        PCI/AER: Ignore non-PCIe AER error sources in aer_hest_parse()
        PCI/AER: Clean up error printing code a bit
        PCI/AER: Add a TLP header print helper
      d9cdfb87
    • Bjorn Helgaas's avatar
      Merge branch 'eisa' into next · e338e49d
      Bjorn Helgaas authored
      * eisa:
        EISA: Call put_device() if device_register() fails
      e338e49d
    • Yinghai Lu's avatar
      PCI: Remove from bus_list and release resources in pci_release_dev() · ef83b078
      Yinghai Lu authored
      Previously we removed the pci_dev from the bus_list and released its
      resources in pci_destroy_dev().  But that's too early: it's possible to
      call pci_destroy_dev() twice for the same device (e.g., via sysfs), and
      that will cause an oops when we try to remove it from bus_list the second
      time.
      
      We should remove it from the bus_list only when the last reference to the
      pci_dev has been released, i.e., in pci_release_dev().
      
      [bhelgaas: changelog]
      Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      ef83b078
    • Yinghai Lu's avatar
      PCI: Move pci_proc_attach_device() to pci_bus_add_device() · ef37702e
      Yinghai Lu authored
      4f535093 ("PCI: Put pci_dev in device tree as early as possible")
      moved pci_proc_attach_device() from pci_bus_add_device() to
      pci_device_add().
      
      This moves it back to pci_bus_add_device(), essentially reverting that
      part of 4f535093.  This makes it symmetric with pci_stop_dev(),
      where we call pci_proc_detach_device() and pci_remove_sysfs_dev_files()
      and set dev->is_added = 0.
      
      [bhelgaas: changelog, create sysfs then attach proc for symmetry]
      Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      ef37702e
    • Yinghai Lu's avatar
      PCI: Use device_release_driver() in pci_stop_root_bus() · e3b439e1
      Yinghai Lu authored
      To be consistent with 4bff6749 ("PCI: Move device_del() from
      pci_stop_dev() to pci_destroy_dev()", this changes pci_stop_root_bus()
      to use device_release_driver() instead of device_del().
      
      This also changes pci_remove_root_bus() to use device_unregister()
      instead of put_device() so it corresponds with the device_register()
      call in pci_create_root_bus().
      
      [bhelgaas: changelog]
      Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e3b439e1