1. 12 5月, 2016 1 次提交
    • J
      PCI: generic, thunder: Use generic ECAM API · 1958e717
      Jayachandran C 提交于
      Use functions provided by drivers/pci/ecam.h for mapping the config space
      in drivers/pci/host/pci-host-common.c, and update its users to use 'struct
      pci_config_window' and 'struct pci_ecam_ops'.
      
      The changes are mostly to use 'struct pci_config_window' in place of
      'struct gen_pci'.  Some of the fields of gen_pci were only used temporarily
      and can be eliminated by using local variables or function arguments, these
      are not carried over to struct pci_config_window.
      
      pci-thunder-ecam.c and pci-thunder-pem.c are the only users of the
      pci_host_common_probe function and the gen_pci structure; these have been
      updated to use the new API as well.
      
      The patch does not introduce any functional changes other than a very minor
      one: with the new code, on 64-bit platforms, we do just a single ioremap
      for the whole config space.
      Signed-off-by: NJayachandran C <jchandra@broadcom.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      1958e717
  2. 05 5月, 2016 1 次提交
    • V
      PCI: hv: Add explicit barriers to config space access · bdd74440
      Vitaly Kuznetsov 提交于
      I'm trying to pass-through Broadcom BCM5720 NIC (Dell device 1f5b) on a
      Dell R720 server.  Everything works fine when the target VM has only one
      CPU, but SMP guests reboot when the NIC driver accesses PCI config space
      with hv_pcifront_read_config()/hv_pcifront_write_config().  The reboot
      appears to be induced by the hypervisor and no crash is observed.  Windows
      event logs are not helpful at all ('Virtual machine ... has quit
      unexpectedly').  The particular access point is always different and
      putting debug between them (printk/mdelay/...) moves the issue further
      away.  The server model affects the issue as well: on Dell R420 I'm able to
      pass-through BCM5720 NIC to SMP guests without issues.
      
      While I'm obviously failing to reveal the essence of the issue I was able
      to come up with a (possible) solution: if explicit barriers are added to
      hv_pcifront_read_config()/hv_pcifront_write_config() the issue goes away.
      The essential minimum is rmb() at the end on _hv_pcifront_read_config() and
      wmb() at the end of _hv_pcifront_write_config() but I'm not confident it
      will be sufficient for all hardware.  I suggest the following barriers:
      
      1) wmb()/mb() between choosing the function and writing to its space.
      2) mb() before releasing the spinlock in both _hv_pcifront_read_config()/
         _hv_pcifront_write_config() to ensure that consecutive reads/writes to
        the space won't get re-ordered as drivers may count on that.
      
      Config space access is not supposed to be performance-critical so these
      explicit barriers should not cause any slowdown.
      
      [bhelgaas: use Linux "barriers" terminology]
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NJake Oshins <jakeo@microsoft.com>
      bdd74440
  3. 03 5月, 2016 6 次提交
  4. 01 5月, 2016 1 次提交
  5. 29 4月, 2016 1 次提交
  6. 27 4月, 2016 1 次提交
  7. 26 4月, 2016 1 次提交
    • M
      PCI: keystone: Remove unnecessary goto statement · 1e9f8dcf
      Murali Karicheri 提交于
      Fix the misuse of goto statement in ks_pcie_get_irq_controller_info() as
      simple return is more appropriate for this function.  While at it add an
      error log for absence of interrupt controller node.
      
      [bhelgaas: drop "ret" altogether since we always know the return value]
      Signed-off-by: NMurali Karicheri <m-karicheri2@ti.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      CC: Rob Herring <robh+dt@kernel.org>
      CC: Pawel Moll <pawel.moll@arm.com>
      CC: Mark Rutland <mark.rutland@arm.com>
      CC: Ian Campbell <ijc+devicetree@hellion.org.uk>
      CC: Kumar Gala <galak@codeaurora.org>
      1e9f8dcf
  8. 22 4月, 2016 1 次提交
  9. 20 4月, 2016 4 次提交
    • T
      PCI: imx6: Add DT property for link gen, default to Gen1 · a5fcec48
      Tim Harvey 提交于
      Freescale has stated [1] that the LVDS clock source of the IMX6 does not
      pass the PCI Gen2 clock jitter test, therefore unless an external Gen2
      compliant external clock source is present and supplied back to the IMX6
      PCIe core via LVDS CLK1/CLK2 you can not claim Gen2 compliance.
      
      Add a DT property to specify Gen1 vs Gen2 and check this before allowing a
      Gen2 link.
      
      We default to Gen1 if the property is not present because at this time
      there are no IMX6 boards in mainline that 'input' a clock on LVDS
      CLK1/CLK2.
      
      In order to be Gen2 compliant on IMX6 you need to:
      
       - Have a Gen2 compliant external clock generator and route that clock back
         to either LVDS CLK1 or LVDS CLK2 as an input (see IMX6SX-SabreSD
         reference design).
      
       - Specify this clock in the PCIe node in the DT (i.e.,
         IMX6QDL_CLK_LVDS1_IN or IMX6QDL_CLK_LVDS2_IN instead of
         IMX6QDL_CLK_LVDS1_GATE which configures it as a CLK output).
      
      [1] https://community.freescale.com/message/453209Signed-off-by: NTim Harvey <tharvey@gateworks.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NLucas Stach <l.stach@pengutronix.de>
      CC: Fabio Estevam <fabio.estevam@freescale.com>
      CC: Zhu Richard <Richard.Zhu@freescale.com>
      CC: Akshay Bhat <akshay.bhat@timesys.com>
      CC: Rob Herring <robh+dt@kernel.org>
      CC: Shawn Guo <shawnguo@kernel.org>
      a5fcec48
    • P
      PCI: imx6: Add reset-gpio-active-high boolean property to DT · 3ea8529a
      Petr Štetiar 提交于
      Currently the reset-gpio DT property which controls the PCI bus device
      reset signal defaults to active-low reset sequence (L=reset state,
      H=operation state) plus the code in reset function isn't GPIO polarity
      aware - it doesn't matter if the defined reset-gpio is active-low or
      active-high, it will always result into active-low reset sequence.
      
      I've tried to fix it properly and change the reset-gpio reset sequence to
      be polarity-aware, but this patch has been accepted and then reverted as it
      has introduced few backward incompatible issues:
      
      1. Some DTBs, for example, imx6qdl-sabresd, don't define reset-gpio
      polarity correctly:
      
        reset-gpio = <&gpio7 12 0>;
      
      which means that it's defined as active-high, but in reality it's
      active-low; thus it wouldn't work without a DTS fix.
      
      2. The logic in the reset function is inverted:
      
      	gpio_set_value_cansleep(imx6_pcie->reset_gpio, 0)
      	msleep(100);
      	gpio_set_value_cansleep(imx6_pcie->reset_gpio, 1);
      
      so even if some of the i.MX6 boards had reset-gpio polarity defined
      correctly in their DTSes, they would stop working.
      
      As we can't break old DTBs, we can't fix them, so we need to introduce this
      new DT reset-gpio-active-high boolean property so we can support boards
      with active-high reset sequence.
      
      This active-high reset sequence is for example needed on Apalis SoMs, where
      GPIO1_IO28, used to PCIe reset is not connected directly to PERST# PCIe
      signal, but it's ORed with RESETBMCU coming off the PMIC, and thus is
      inverted, active-high.
      
      Tested-by: Tim Harvey <tharvey@gateworks.com>	# Gateworks Ventana boards (which have active-low PERST#)
      Signed-off-by: NPetr Štetiar <ynezz@true.cz>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NLucas Stach <l.stach@pengutronix.de>
      Acked-by: NRob Herring <robh@kernel.org>
      3ea8529a
    • C
      PCI: imx6: Add initial imx6sx support · e3c06cd0
      Christoph Fritz 提交于
      Add initial PCIe support for the imx6 SoC derivate imx6sx.  PCI MSI support
      is untested as the necessary suspend/resume quirk is not included in this
      patch.
      
      This patch is heavily based on patches by Richard Zhu.
      
      [bhelgaas: factor out refclk enable, fix adjacent typos in imx6q-pcie.txt]
      Signed-off-by: NChristoph Fritz <chf.fritz@googlemail.com>
      Acked-by: NRichard Zhu <Richard.Zhu@freescale.com>
      Acked-by: NLucas Stach <l.stach@pengutronix.de>
      e3c06cd0
    • B
      PCI: imx6: Factor out ref clock enable · 4d1821e7
      Bjorn Helgaas 提交于
      Factor out ref clock enable to make it cleaner to add imx6sx support.  No
      functional change intended.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Tested-by: NChristoph Fritz <chf.fritz@googlemail.com>
      4d1821e7
  10. 15 4月, 2016 1 次提交
  11. 08 4月, 2016 2 次提交
  12. 06 4月, 2016 3 次提交
  13. 22 3月, 2016 1 次提交
  14. 15 3月, 2016 3 次提交
  15. 12 3月, 2016 9 次提交
  16. 09 3月, 2016 4 次提交