1. 09 12月, 2022 1 次提交
  2. 08 12月, 2022 1 次提交
  3. 07 12月, 2022 1 次提交
  4. 06 12月, 2022 2 次提交
  5. 29 11月, 2022 1 次提交
  6. 23 11月, 2022 6 次提交
    • S
      PCI: dwc: Add Baikal-T1 PCIe controller support · ba6ed462
      Serge Semin 提交于
      Baikal-T1 SoC is equipped with DWC PCIe v4.60a host controller. It can be
      trained to work up to Gen.3 speed over up to x4 lanes. The host controller
      is attached to the DW PCIe 3.0 PCS via the PIPE-4 interface, which in its
      turn is connected to the DWC 10G PHY. The whole system is supposed to be
      fed up with four clock sources: DBI peripheral clock, AXI application
      clocks and external PHY/core reference clock generating the 100MHz signal.
      In addition to that the platform provide a way to reset each part of the
      controller: sticky/non-sticky bits, host controller core, PIPE interface,
      PCS/PHY and Hot/Power reset signal. The driver also provides a way to
      handle the GPIO-based PERST# signal.
      
      Note due to the Baikal-T1 MMIO peculiarity we have to implement the DBI
      interface accessors which make sure the IO operations are dword-aligned.
      
      Link: https://lore.kernel.org/r/20221113191301.5526-21-Sergey.Semin@baikalelectronics.ruSigned-off-by: NSerge Semin <Sergey.Semin@baikalelectronics.ru>
      Signed-off-by: NLorenzo Pieralisi <lpieralisi@kernel.org>
      ba6ed462
    • S
      PCI: dwc: Introduce generic platform clocks and resets · ef69f852
      Serge Semin 提交于
      Currently almost each platform driver uses its own resets and clocks
      naming in order to get the corresponding descriptors. It makes the code
      harder to maintain and comprehend especially seeing the DWC PCIe core main
      resets and clocks signals set hasn't changed much for about at least one
      major IP-core release. So in order to organize things around these signals
      we suggest to create a generic interface for them in accordance with the
      naming introduced in the DWC PCIe IP-core reference manual:
      
      Application clocks:
      - "dbi"  - data bus interface clock (on some DWC PCIe platforms it's
                 referred as "pclk", "pcie", "sys", "ahb", "cfg", "iface",
                 "gio", "reg", "pcie_apb_sys");
      - "mstr" - AXI-bus master interface clock (some DWC PCIe glue drivers
                 refer to this clock as "port", "bus", "pcie_bus",
                 "bus_master/master_bus/axi_m", "pcie_aclk");
      - "slv"  - AXI-bus slave interface clock (also called as "port", "bus",
                 "pcie_bus", "bus_slave/slave_bus/axi_s", "pcie_aclk",
                 "pcie_inbound_axi").
      
      Core clocks:
      - "pipe" - core-PCS PIPE interface clock coming from external PHY (it's
                 normally named by the platform drivers as just "pipe");
      - "core" - primary clock of the controller (none of the platform drivers
                 declare such a clock but in accordance with the ref. manual
                 the devices may have it separately specified);
      - "aux"  - auxiliary PMC domain clock (it is named by some platforms as
                 "pcie_aux" and just "aux");
      - "ref"  - Generic reference clock (it is a generic clock source, which
                 can be used as a signal source for multiple interfaces, some
                 platforms call it as "ref", "general", "pcie_phy",
                 "pcie_phy_ref").
      
      Application resets:
      - "dbi"  - Data-bus interface reset (it's CSR interface clock and is
                 normally called as "apb" though technically it's not APB but
                 DWC PCIe-specific interface);
      - "mstr" - AXI-bus master reset (some platforms call it as "port", "apps",
                 "bus", "axi_m");
      - "slv"  - ABI-bus slave reset (some platforms call it as "port", "apps",
                 "bus", "axi_s").
      
      Core resets:
      - "non-sticky" - non-sticky CSR flags reset;
      - "sticky"     - sticky CSR flags reset;
      - "pipe"       - PIPE-interface (Core-PCS) logic reset (some platforms
                       call it just "pipe");
      - "core"       - controller primary reset (resets everything except PMC
                       module, some platforms refer to this signal as "soft",
                       "pci");
      - "phy"        - PCS/PHY block reset (strictly speaking it is normally
                       connected to the input of an external block, but the
                       reference manual says it must be available for the PMC
                       working correctly, some existing platforms call it
                       "pciephy", "phy", "link");
      - "hot"        - PMC hot reset signal (also called as "sleep");
      - "pwr"        - cold reset signal (can be referred as "pwr", "turnoff").
      
      Bus reset:
      - "perst" - PCIe standard signal used to reset the PCIe peripheral
                  devices.
      
      As you can see each platform uses it's own naming for basically the same
      set of the signals. In the framework of this commit we suggest to add a
      set of the clocks and reset signals resources, corresponding names and
      identifiers for each denoted entity. At current stage the platforms will
      be able to use the provided infrastructure to automatically request all
      these resources and manipulate with them in the Host/EP init callbacks.
      Alas it isn't that easy to create a common cold/hot reset procedure due to
      too many platform-specifics in the procedure, like the external flags
      exposure and the delays requirement.
      
      Link: https://lore.kernel.org/r/20221113191301.5526-20-Sergey.Semin@baikalelectronics.ruSigned-off-by: NSerge Semin <Sergey.Semin@baikalelectronics.ru>
      Signed-off-by: NLorenzo Pieralisi <lpieralisi@kernel.org>
      ef69f852
    • S
      PCI: dwc: Combine iATU detection procedures · 9f67ecdd
      Serge Semin 提交于
      Since the iATU CSR region is now retrieved in the DW PCIe resources getter
      there is no much benefits in the iATU detection procedures splitting up.
      Therefore let's join the iATU unroll/viewport detection procedure with the
      rest of the iATU parameters detection code. The resultant method will be
      as coherent as before, while the redundant functions will be eliminated
      thus producing more readable code.
      
      Link: https://lore.kernel.org/r/20221113191301.5526-19-Sergey.Semin@baikalelectronics.ruSigned-off-by: NSerge Semin <Sergey.Semin@baikalelectronics.ru>
      Signed-off-by: NLorenzo Pieralisi <lpieralisi@kernel.org>
      Reviewed-by: NRob Herring <robh@kernel.org>
      Reviewed-by: NManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
      9f67ecdd
    • S
      PCI: dwc: Introduce generic resources getter · ef8c5887
      Serge Semin 提交于
      Currently the DW PCIe Root Port and Endpoint CSR spaces are retrieved in
      the separate parts of the DW PCIe core driver. It doesn't really make
      sense since the both controller types have identical set of the core CSR
      regions: DBI, DBI CS2 and iATU/eDMA. Thus we can simplify the DW PCIe Host
      and EP initialization methods by moving the platform-specific registers
      space getting and mapping into a common method. It gets to be even more
      justified seeing the CSRs base address pointers are preserved in the
      common DW PCIe descriptor. Note all the OF-based common DW PCIe settings
      initialization will be moved to the new method too in order to have a
      single function for all the generic platform properties handling in single
      place.
      
      A nice side-effect of this change is that the pcie-designware-host.c and
      pcie-designware-ep.c drivers are cleaned up from all the direct dw_pcie
      storage modification, which makes the DW PCIe core, Root Port and Endpoint
      modules more coherent.
      
      Link: https://lore.kernel.org/r/20221113191301.5526-18-Sergey.Semin@baikalelectronics.ruSigned-off-by: NSerge Semin <Sergey.Semin@baikalelectronics.ru>
      Signed-off-by: NLorenzo Pieralisi <lpieralisi@kernel.org>
      Reviewed-by: NRob Herring <robh@kernel.org>
      ef8c5887
    • S
      PCI: dwc: Introduce generic controller capabilities interface · 7f9e982d
      Serge Semin 提交于
      Since in addition to the already available iATU unrolled mapping we are
      about to add a few more DW PCIe platform-specific capabilities (CDM-check
      and generic clocks/resets resources) let's add a generic interface to set
      and get the flags indicating their availability. The new interface shall
      improve maintainability of the platform-specific code.
      
      Link: https://lore.kernel.org/r/20221113191301.5526-17-Sergey.Semin@baikalelectronics.ruSigned-off-by: NSerge Semin <Sergey.Semin@baikalelectronics.ru>
      Signed-off-by: NLorenzo Pieralisi <lpieralisi@kernel.org>
      Reviewed-by: NRob Herring <robh@kernel.org>
      Reviewed-by: NManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
      7f9e982d
    • S
      PCI: dwc: Introduce dma-ranges property support for RC-host · 8522e17d
      Serge Semin 提交于
      In accordance with the generic PCIe Root Port DT-bindings the "dma-ranges"
      property has the same format as the "ranges" property. The only difference
      is in their semantics. The "dma-ranges" property describes the PCIe-to-CPU
      memory mapping in opposite to the CPU-to-PCIe mapping of the "ranges"
      property. Even though the DW PCIe controllers are normally equipped with
      the internal Address Translation Unit which inbound and outbound tables
      can be used to implement both properties semantics, it was surprising for
      me to discover that the host-related part of the DW PCIe driver currently
      supports the "ranges" property only while the "dma-ranges" windows are
      just ignored. Having the "dma-ranges" supported in the driver would be
      very handy for the platforms, that don't tolerate the 1:1 CPU-PCIe memory
      mapping and require a customized PCIe memory layout. So let's fix that by
      introducing the "dma-ranges" property support.
      
      First of all we suggest to rename the dw_pcie_prog_inbound_atu() method to
      dw_pcie_prog_ep_inbound_atu() and create a new version of the
      dw_pcie_prog_inbound_atu() function. Thus we'll have two methods for the
      RC and EP controllers respectively in the same way as it has been
      developed for the outbound ATU setup methods.
      
      Secondly aside with the memory window index and type the new
      dw_pcie_prog_inbound_atu() function will accept CPU address, PCIe address
      and size as its arguments. These parameters define the PCIe and CPU memory
      ranges which will be used to setup the respective inbound ATU mapping. The
      passed parameters need to be verified against the ATU ranges constraints
      in the same way as it is done for the outbound ranges.
      
      Finally the DMA-ranges detected for the PCIe controller need to be
      converted to the inbound ATU entries during the host controller
      initialization procedure. It will be done in the framework of the
      dw_pcie_iatu_setup() method. Note before setting the inbound ranges up we
      need to disable all the inbound ATU entries in order to prevent unexpected
      PCIe TLPs translations defined by some third party software like
      bootloaders.
      
      Link: https://lore.kernel.org/r/20221113191301.5526-16-Sergey.Semin@baikalelectronics.ruSigned-off-by: NSerge Semin <Sergey.Semin@baikalelectronics.ru>
      Signed-off-by: NLorenzo Pieralisi <lpieralisi@kernel.org>
      Reviewed-by: NRob Herring <robh@kernel.org>
      Reviewed-by: NManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
      8522e17d
  7. 18 11月, 2022 1 次提交
  8. 17 11月, 2022 2 次提交
  9. 14 11月, 2022 1 次提交
  10. 12 11月, 2022 1 次提交
    • D
      PCI: hv: Only reuse existing IRTE allocation for Multi-MSI · c234ba80
      Dexuan Cui 提交于
      Jeffrey added Multi-MSI support to the pci-hyperv driver by the 4 patches:
      08e61e86 ("PCI: hv: Fix multi-MSI to allow more than one MSI vector")
      455880df ("PCI: hv: Fix hv_arch_irq_unmask() for multi-MSI")
      b4b77778 ("PCI: hv: Reuse existing IRTE allocation in compose_msi_msg()")
      a2bad844 ("PCI: hv: Fix interrupt mapping for multi-MSI")
      
      It turns out that the third patch (b4b77778) causes a performance
      regression because all the interrupts now happen on 1 physical CPU (or two
      pCPUs, if one pCPU doesn't have enough vectors). When a guest has many PCI
      devices, it may suffer from soft lockups if the workload is heavy, e.g.,
      see https://lwn.net/ml/linux-kernel/20220804025104.15673-1-decui@microsoft.com/
      
      Commit b4b77778 itself is good. The real issue is that the hypercall in
      hv_irq_unmask() -> hv_arch_irq_unmask() ->
      hv_do_hypercall(HVCALL_RETARGET_INTERRUPT...) only changes the target
      virtual CPU rather than physical CPU; with b4b77778, the pCPU is
      determined only once in hv_compose_msi_msg() where only vCPU0 is specified;
      consequently the hypervisor only uses 1 target pCPU for all the interrupts.
      
      Note: before b4b77778, the pCPU is determined twice, and when the pCPU
      is determined the second time, the vCPU in the effective affinity mask is
      used (i.e., it isn't always vCPU0), so the hypervisor chooses different
      pCPU for each interrupt.
      
      The hypercall will be fixed in future to update the pCPU as well, but
      that will take quite a while, so let's restore the old behavior in
      hv_compose_msi_msg(), i.e., don't reuse the existing IRTE allocation for
      single-MSI and MSI-X; for multi-MSI, we choose the vCPU in a round-robin
      manner for each PCI device, so the interrupts of different devices can
      happen on different pCPUs, though the interrupts of each device happen on
      some single pCPU.
      
      The hypercall fix may not be backported to all old versions of Hyper-V, so
      we want to have this guest side change forever (or at least till we're sure
      the old affected versions of Hyper-V are no longer supported).
      
      Fixes: b4b77778 ("PCI: hv: Reuse existing IRTE allocation in compose_msi_msg()")
      Co-developed-by: NJeffrey Hugo <quic_jhugo@quicinc.com>
      Signed-off-by: NJeffrey Hugo <quic_jhugo@quicinc.com>
      Co-developed-by: NCarl Vanderlip <quic_carlv@quicinc.com>
      Signed-off-by: NCarl Vanderlip <quic_carlv@quicinc.com>
      Signed-off-by: NDexuan Cui <decui@microsoft.com>
      Reviewed-by: NMichael Kelley <mikelley@microsoft.com>
      Link: https://lore.kernel.org/r/20221104222953.11356-1-decui@microsoft.comSigned-off-by: NWei Liu <wei.liu@kernel.org>
      c234ba80
  11. 11 11月, 2022 13 次提交
  12. 10 11月, 2022 2 次提交
  13. 03 11月, 2022 1 次提交
  14. 27 10月, 2022 3 次提交
  15. 18 10月, 2022 1 次提交
  16. 06 10月, 2022 3 次提交