1. 27 6月, 2019 2 次提交
  2. 07 5月, 2019 5 次提交
  3. 15 4月, 2019 1 次提交
  4. 05 4月, 2019 4 次提交
  5. 01 3月, 2019 2 次提交
    • L
      PCI: dwc: skip MSI init if MSIs have been explicitly disabled · 3afc8299
      Lucas Stach 提交于
      Since 7c5925af (PCI: dwc: Move MSI IRQs allocation to IRQ domains
      hierarchical API) the MSI init claims one of the controller IRQs as a
      chained IRQ line for the MSI controller. On some designs, like the i.MX6,
      this line is shared with a PCIe legacy IRQ. When the line is claimed for
      the MSI domain, any device trying to use this legacy IRQs will fail to
      request this IRQ line.
      
      As MSI and legacy IRQs are already mutually exclusive on the DWC core,
      as the core won't forward any legacy IRQs once any MSI has been enabled,
      users wishing to use legacy IRQs already need to explictly disable MSI
      support (usually via the pci=nomsi kernel commandline option). To avoid
      any issues with MSI conflicting with legacy IRQs, just skip all of the
      DWC MSI initalization, including the IRQ line claim, when MSI is disabled.
      
      Fixes: 7c5925af ("PCI: dwc: Move MSI IRQs allocation to IRQ domains hierarchical API")
      Tested-by: NTim Harvey <tharvey@gateworks.com>
      Signed-off-by: NLucas Stach <l.stach@pengutronix.de>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: NGustavo Pimentel <gustavo.pimentel@synopsys.com>
      Cc: stable@vger.kernel.org
      3afc8299
    • A
      PCI: dwc: Share code for dw_pcie_rd/wr_other_conf() · 689e349a
      Andrey Smirnov 提交于
      Default implementation of pcie_rd_other_conf() and
      dw_pcie_wd_other_conf() share more than 80% of their code. Move shared
      code into a dedicated subroutine and convert pcie_rd_other_conf() and
      dw_pcie_wd_other_conf() to use it. No functional change intended.
      Signed-off-by: NAndrey Smirnov <andrew.smirnov@gmail.com>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: NGustavo Pimentel <gustavo.pimentel@synopsys.com>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Fabio Estevam <fabio.estevam@nxp.com>
      Cc: Chris Healy <cphealy@gmail.com>
      Cc: Lucas Stach <l.stach@pengutronix.de>
      Cc: Leonard Crestez <leonard.crestez@nxp.com>
      Cc: "A.s. Dong" <aisheng.dong@nxp.com>
      Cc: Richard Zhu <hongxing.zhu@nxp.com>
      Cc: linux-imx@nxp.com
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-pci@vger.kernel.org
      689e349a
  6. 01 2月, 2019 6 次提交
  7. 18 12月, 2018 1 次提交
    • S
      PCI: dwc: Don't hard-code DBI/ATU offset · 6d6b05e3
      Stephen Warren 提交于
      The DWC PCIe core contains various separate register spaces: DBI, DBI2,
      ATU, DMA, etc. The relationship between the addresses of these register
      spaces is entirely determined by the implementation of the IP block, not
      by the IP block design itself. Hence, the DWC driver must not make
      assumptions that one register space can be accessed at a fixed offset from
      any other register space. To avoid such assumptions, introduce an
      explicit/separate register pointer for the ATU register space. In
      particular, the current assumption is not valid for NVIDIA's T194 SoC.
      
      The ATU register space is only used on systems that require unrolled ATU
      access. This property is detected at run-time for host controllers, and
      when this is detected, this patch provides a default value for atu_base
      that matches the previous assumption re: register layout. An alternative
      would be to update all drivers for HW that requires unrolled access to
      explicitly set atu_base. However, it's hard to tell which drivers would
      require atu_base to be set. The unrolled property is not detected for
      endpoint systems, and so any endpoint driver that requires unrolled access
      must explicitly set the iatu_unroll_enabled flag (none do at present), and
      so a check is added to require the driver to also set atu_base while at
      it.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: NGustavo Pimentel <gustavo.pimentel@synopsys.com>
      Acked-by: NVidya Sagar <vidyas@nvidia.com>
      6d6b05e3
  8. 11 12月, 2018 3 次提交
  9. 19 7月, 2018 1 次提交
    • S
      PCI: designware: Fix I/O space page leak · fd07f5e1
      Sergei Shtylyov 提交于
      When testing the R-Car PCIe driver on the Condor board, if the PCIe PHY
      driver is left disabled, the kernel crashed with this BUG:
      
        kernel BUG at lib/ioremap.c:72!
        Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
        Modules linked in:
        CPU: 0 PID: 39 Comm: kworker/0:1 Not tainted 4.17.0-dirty #1092
        Hardware name: Renesas Condor board based on r8a77980 (DT)
        Workqueue: events deferred_probe_work_func
        pstate: 80000005 (Nzcv daif -PAN -UAO)
        pc : ioremap_page_range+0x370/0x3c8
        lr : ioremap_page_range+0x40/0x3c8
        sp : ffff000008da39e0
        x29: ffff000008da39e0 x28: 00e8000000000f07
        x27: ffff7dfffee00000 x26: 0140000000000000
        x25: ffff7dfffef00000 x24: 00000000000fe100
        x23: ffff80007b906000 x22: ffff000008ab8000
        x21: ffff000008bb1d58 x20: ffff7dfffef00000
        x19: ffff800009c30fb8 x18: 0000000000000001
        x17: 00000000000152d0 x16: 00000000014012d0
        x15: 0000000000000000 x14: 0720072007200720
        x13: 0720072007200720 x12: 0720072007200720
        x11: 0720072007300730 x10: 00000000000000ae
        x9 : 0000000000000000 x8 : ffff7dffff000000
        x7 : 0000000000000000 x6 : 0000000000000100
        x5 : 0000000000000000 x4 : 000000007b906000
        x3 : ffff80007c61a880 x2 : ffff7dfffeefffff
        x1 : 0000000040000000 x0 : 00e80000fe100f07
        Process kworker/0:1 (pid: 39, stack limit = 0x        (ptrval))
        Call trace:
         ioremap_page_range+0x370/0x3c8
         pci_remap_iospace+0x7c/0xac
         pci_parse_request_of_pci_ranges+0x13c/0x190
         rcar_pcie_probe+0x4c/0xb04
         platform_drv_probe+0x50/0xbc
         driver_probe_device+0x21c/0x308
         __device_attach_driver+0x98/0xc8
         bus_for_each_drv+0x54/0x94
         __device_attach+0xc4/0x12c
         device_initial_probe+0x10/0x18
         bus_probe_device+0x90/0x98
         deferred_probe_work_func+0xb0/0x150
         process_one_work+0x12c/0x29c
         worker_thread+0x200/0x3fc
         kthread+0x108/0x134
         ret_from_fork+0x10/0x18
        Code: f9004ba2 54000080 aa0003fb 17ffff48 (d4210000)
      
      It turned out that pci_remap_iospace() wasn't undone when the driver's
      probe failed, and since devm_phy_optional_get() returned -EPROBE_DEFER,
      the probe was retried, finally causing the BUG due to trying to remap
      already remapped pages.
      
      The DesignWare PCIe controller driver has the same issue.
      
      Replace devm_pci_remap_iospace() with a devm_ managed version to fix the
      bug.
      
      Fixes: cbce7900 ("PCI: designware: Make driver arch-agnostic")
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      [lorenzo.pieralisi@arm.com: updated the commit log]
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Acked-by: NJingoo Han <jingoohan1@gmail.com>
      fd07f5e1
  10. 08 6月, 2018 1 次提交
  11. 31 5月, 2018 2 次提交
  12. 15 5月, 2018 4 次提交
  13. 08 3月, 2018 1 次提交
    • K
      PCI: dwc: Fix enumeration end when reaching root subordinate · fc110ebd
      Koen Vandeputte 提交于
      The subordinate value indicates the highest bus number which can be
      reached downstream though a certain device.
      
      Commit a20c7f36 ("PCI: Do not allocate more buses than available in
      parent") ensures that downstream devices cannot assign busnumbers higher
      than the upstream device subordinate number, which was indeed illogical.
      
      By default, dw_pcie_setup_rc() inits the Root Complex subordinate to a
      value of 0x01.
      
      Due to this combined with above commit, enumeration stops digging deeper
      downstream as soon as bus num 0x01 has been assigned, which is always the
      case for a bridge device.
      
      This results in all devices behind a bridge bus remaining undetected, as
      these would be connected to bus 0x02 or higher.
      
      Fix this by initializing the RC to a subordinate value of 0xff, which is
      not altering hardware behaviour in any way, but informs probing function
      pci_scan_bridge() later on which reads this value back from register.
      
      The following nasty errors during boot are also fixed by this:
      
        pci_bus 0000:02: busn_res: can not insert [bus 02-ff] under [bus 01] (conflicts with (null) [bus 01])
        ...
        pci_bus 0000:03: [bus 03] partially hidden behind bridge 0000:01 [bus 01]
        ...
        pci_bus 0000:04: [bus 04] partially hidden behind bridge 0000:01 [bus 01]
        ...
        pci_bus 0000:05: [bus 05] partially hidden behind bridge 0000:01 [bus 01]
        pci_bus 0000:02: busn_res: [bus 02-ff] end is updated to 05
        pci_bus 0000:02: busn_res: can not insert [bus 02-05] under [bus 01] (conflicts with (null) [bus 01])
        pci_bus 0000:02: [bus 02-05] partially hidden behind bridge 0000:01 [bus 01]
      
      Fixes: a20c7f36 ("PCI: Do not allocate more buses than available in
      parent")
      Tested-by: NNiklas Cassel <niklas.cassel@axis.com>
      Tested-by: NFabio Estevam <fabio.estevam@nxp.com>
      Tested-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
      Signed-off-by: NKoen Vandeputte <koen.vandeputte@ncentric.com>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NLucas Stach <l.stach@pengutronix.de>
      Cc: stable@vger.kernel.org	# v4.15+
      Cc: Binghui Wang <wangbinghui@hisilicon.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: Jianguo Sun <sunjianguo1@huawei.com>
      Cc: Jingoo Han <jingoohan1@gmail.com>
      Cc: Kishon Vijay Abraham I <kishon@ti.com>
      Cc: Lucas Stach <l.stach@pengutronix.de>
      Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
      Cc: Minghuan Lian <minghuan.Lian@freescale.com>
      Cc: Mingkai Hu <mingkai.hu@freescale.com>
      Cc: Murali Karicheri <m-karicheri2@ti.com>
      Cc: Pratyush Anand <pratyush.anand@gmail.com>
      Cc: Richard Zhu <hongxing.zhu@nxp.com>
      Cc: Roy Zang <tie-fei.zang@freescale.com>
      Cc: Shawn Guo <shawn.guo@linaro.org>
      Cc: Stanimir Varbanov <svarbanov@mm-sol.com>
      Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: Xiaowei Song <songxiaowei@hisilicon.com>
      Cc: Zhou Wang <wangzhou1@hisilicon.com>
      fc110ebd
  14. 07 3月, 2018 1 次提交
    • K
      PCI: dwc: Fix enumeration end when reaching root subordinate · c2deae44
      Koen Vandeputte 提交于
      The subordinate value indicates the highest bus number which can be
      reached downstream though a certain device.
      
      Commit a20c7f36 ("PCI: Do not allocate more buses than available in
      parent")
      ensures that downstream devices cannot assign busnumbers higher than the
      upstream device subordinate number, which was indeed illogical.
      
      By default, dw_pcie_setup_rc() inits the Root Complex subordinate to a
      value of 0x01.
      
      Due to this combined with above commit, enumeration stops digging deeper
      downstream as soon as bus num 0x01 has been assigned, which is always
      the case for a bridge device.
      
      This results in all devices behind a bridge bus to remain undetected, as
      these would be connected to bus 0x02 or higher.
      
      Fix this by initializing the RC to a subordinate value of 0xff, which is
      not altering hardware behaviour in any way, but informs probing
      function pci_scan_bridge() later on which reads this value back from
      register.
      
      Following nasty errors during boot are also fixed by this:
      
      [    0.459145] pci_bus 0000:02: busn_res: can not insert [bus 02-ff]
      under [bus 01] (conflicts with (null) [bus 01])
      ...
      [    0.464515] pci_bus 0000:03: [bus 03] partially hidden behind bridge
      0000:01 [bus 01]
      ...
      [    0.464892] pci_bus 0000:04: [bus 04] partially hidden behind bridge
      0000:01 [bus 01]
      ...
      [    0.466488] pci_bus 0000:05: [bus 05] partially hidden behind bridge
      0000:01 [bus 01]
      [    0.466506] pci_bus 0000:02: busn_res: [bus 02-ff] end is updated to
      05
      [    0.466517] pci_bus 0000:02: busn_res: can not insert [bus 02-05]
      under [bus 01] (conflicts with (null) [bus 01])
      [    0.466534] pci_bus 0000:02: [bus 02-05] partially hidden behind
      bridge 0000:01 [bus 01]
      
      Fixes: a20c7f36 ("PCI: Do not allocate more buses than available in
      parent")
      Tested-by: NNiklas Cassel <niklas.cassel@axis.com>
      Tested-by: NFabio Estevam <fabio.estevam@nxp.com>
      Tested-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
      Signed-off-by: NKoen Vandeputte <koen.vandeputte@ncentric.com>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NLucas Stach <l.stach@pengutronix.de>
      Cc: <stable@vger.kernel.org> # 4.15
      Cc: Binghui Wang <wangbinghui@hisilicon.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: Jianguo Sun <sunjianguo1@huawei.com>
      Cc: Jingoo Han <jingoohan1@gmail.com>
      Cc: Kishon Vijay Abraham I <kishon@ti.com>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Lucas Stach <l.stach@pengutronix.de>
      Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
      Cc: Minghuan Lian <minghuan.Lian@freescale.com>
      Cc: Mingkai Hu <mingkai.hu@freescale.com>
      Cc: Murali Karicheri <m-karicheri2@ti.com>
      Cc: Pratyush Anand <pratyush.anand@gmail.com>
      Cc: Richard Zhu <hongxing.zhu@nxp.com>
      Cc: Roy Zang <tie-fei.zang@freescale.com>
      Cc: Shawn Guo <shawn.guo@linaro.org>
      Cc: Stanimir Varbanov <svarbanov@mm-sol.com>
      Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: Xiaowei Song <songxiaowei@hisilicon.com>
      Cc: Zhou Wang <wangzhou1@hisilicon.com>
      c2deae44
  15. 06 3月, 2018 3 次提交
  16. 29 1月, 2018 1 次提交
  17. 21 12月, 2017 1 次提交
  18. 02 9月, 2017 1 次提交