Skip to content
Snippets Groups Projects
  1. Dec 14, 2021
    • Thomas Gleixner's avatar
      PCI/MSI: Clear PCI_MSIX_FLAGS_MASKALL on error · 94185adb
      Thomas Gleixner authored
      
      PCI_MSIX_FLAGS_MASKALL is set in the MSI-X control register at MSI-X
      interrupt setup time. It's cleared on success, but the error handling path
      only clears the PCI_MSIX_FLAGS_ENABLE bit.
      
      That's incorrect as the reset state of the PCI_MSIX_FLAGS_MASKALL bit is
      zero. That can be observed via lspci:
      
              Capabilities: [b0] MSI-X: Enable- Count=67 Masked+
      
      Clear the bit in the error path to restore the reset state.
      
      Fixes: 43855395 ("PCI/MSI: Enable and mask MSI-X early")
      Reported-by: default avatarStefan Roese <sr@denx.de>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarStefan Roese <sr@denx.de>
      Cc: linux-pci@vger.kernel.org
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: Marek Vasut <marex@denx.de>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/87tufevoqx.ffs@tglx
      94185adb
    • Stefan Roese's avatar
      PCI/MSI: Mask MSI-X vectors only on success · 83dbf898
      Stefan Roese authored
      
      Masking all unused MSI-X entries is done to ensure that a crash kernel
      starts from a clean slate, which correponds to the reset state of the
      device as defined in the PCI-E specificion 3.0 and later:
      
       Vector Control for MSI-X Table Entries
       --------------------------------------
      
       "00: Mask bit:  When this bit is set, the function is prohibited from
                       sending a message using this MSI-X Table entry.
                       ...
                       This bit’s state after reset is 1 (entry is masked)."
      
      A Marvell NVME device fails to deliver MSI interrupts after trying to
      enable MSI-X interrupts due to that masking. It seems to take the MSI-X
      mask bits into account even when MSI-X is disabled.
      
      While not specification compliant, this can be cured by moving the masking
      into the success path, so that the MSI-X table entries stay in device reset
      state when the MSI-X setup fails.
      
      [ tglx: Move it into the success path, add comment and amend changelog ]
      
      Fixes: aa8092c1d1f1 ("PCI/MSI: Mask all unused MSI-X entries")                                                                                                                                                                                                                 
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: linux-pci@vger.kernel.org
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: Marek Vasut <marex@denx.de>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20211210161025.3287927-1-sr@denx.de
      83dbf898
  2. Dec 13, 2021
    • Sergio Paracuellos's avatar
      PCI: mt7621: Convert driver into 'bool' · aa50faff
      Sergio Paracuellos authored
      
      The driver is not ready yet to be compiled as a module since it depends
      on some symbols not exported on MIPS.  We have the following current
      problems:
      
        Building mips:allmodconfig ... failed
        --------------
        Error log:
        ERROR: modpost: missing MODULE_LICENSE() in drivers/pci/controller/pcie-mt7621.o
        ERROR: modpost: "mips_cm_unlock_other" [drivers/pci/controller/pcie-mt7621.ko] undefined!
        ERROR: modpost: "mips_cpc_base" [drivers/pci/controller/pcie-mt7621.ko] undefined!
        ERROR: modpost: "mips_cm_lock_other" [drivers/pci/controller/pcie-mt7621.ko] undefined!
        ERROR: modpost: "mips_cm_is64" [drivers/pci/controller/pcie-mt7621.ko] undefined!
        ERROR: modpost: "mips_gcr_base" [drivers/pci/controller/pcie-mt7621.ko] undefined!
      
      Temporarily move from 'tristate' to 'bool' until a better solution is
      ready.
      
      Also RALINK is redundant because SOC_MT7621 already depends on it.
      Hence, simplify condition.
      
      Fixes: 2bdd5238 ("PCI: mt7621: Add MediaTek MT7621 PCIe host controller driver").
      Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
      Reviewed-and-Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      aa50faff
  3. Dec 07, 2021
  4. Dec 03, 2021
  5. Dec 02, 2021
    • Marek Behún's avatar
      Revert "PCI: aardvark: Fix support for PCI_ROM_ADDRESS1 on emulated bridge" · 39bd54d4
      Marek Behún authored
      This reverts commit 239edf68.
      
      239edf68 ("PCI: aardvark: Fix support for PCI_ROM_ADDRESS1 on emulated
      bridge") added support for the Type 1 Expansion ROM BAR at config offset
      0x38, based on the register being listed in the Marvell Armada A3720 spec.
      But the spec doesn't document it at all for RC mode, and there is no ROM in
      the SOC, so remove this emulation for now.
      
      The PCI bridge which represents aardvark's PCIe Root Port has an Expansion
      ROM Base Address register at offset 0x30, but its meaning is different than
      PCI's Expansion ROM BAR register, although the layout is the same.  (This
      is why we thought it does the same thing.)
      
      First: there is no ROM (or part of BootROM) in the A3720 SOC dedicated for
      PCIe Root Port (or controller in RC mode) containing executable code that
      would initialize the Root Port, suitable for execution in bootloader (this
      is how Expansion ROM BAR is used on x86).
      
      Second: in A3720 spec the register (address 0xD0070030) is not documented
      at all for Root Complex mode, but similar to other BAR registers, it has an
      "entangled partner" in register 0xD0075920, which does address translation
      for the BAR in 0xD0070030:
      
        - the BAR register sets the address from the view of PCIe bus
      
        - the translation register sets the address from the view of the CPU
      
      The other BAR registers also have this entangled partner, and they can be
      used to:
      
        - in RC mode: address-checking on the receive side of the RC (they can
          define address ranges for memory accesses from remote Endpoints to the
          RC)
      
        - in Endpoint mode: allow the remote CPU to access memory on A3720
      
      The Expansion ROM BAR has only the Endpoint part documented, but from the
      similarities we think that it can also be used in RC mode in that way.
      
      So either Expansion ROM BAR has different meaning (if the hypothesis above
      is true), or we don't know it's meaning (since it is not documented for RC
      mode).
      
      Remove the register from the emulated bridge accessing functions.
      
      [bhelgaas: summarize reason for removal (first paragraph)]
      Fixes: 239edf68 ("PCI: aardvark: Fix support for PCI_ROM_ADDRESS1 on emulated bridge")
      Link: https://lore.kernel.org/r/20211125160148.26029-3-kabel@kernel.org
      
      
      Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarPali Rohár <pali@kernel.org>
      39bd54d4
  6. Nov 11, 2021
  7. Nov 09, 2021
  8. Nov 08, 2021
  9. Nov 05, 2021
  10. Nov 04, 2021
  11. Nov 03, 2021
  12. Nov 02, 2021
Loading