1. 15 Jan, 2024 7 commits
    • Bjorn Helgaas's avatar
      Merge branch 'pci/switchtec' · d6f5bcc2
      Bjorn Helgaas authored
      - Do dma_mrpc cleanup during switchtec_pci_remove() to match its devm
        ioremapping in switchtec_pci_probe().  Previously the cleanup was done in
        stdev_release(), which used stale pointers if stdev->cdev happened to be
        open when the PCI device was removed (Daniel Stodden)
      
      * pci/switchtec:
        PCI: switchtec: Fix stdev_release() crash after surprise hot remove
      d6f5bcc2
    • Bjorn Helgaas's avatar
      Merge branch 'pci/resource' · 5a4af2ca
      Bjorn Helgaas authored
      - Restructure pci_dev_for_each_resource() to avoid computing the address of
        an out-of-bounds array element (the bounds check was performed later so
        the element was never actually *read*, but it's nicer to avoid even
        computing an out-of-bounds address) (Andy Shevchenko)
      
      * pci/resource:
        PCI: Avoid potential out-of-bounds read in pci_dev_for_each_resource()
      5a4af2ca
    • Bjorn Helgaas's avatar
      Merge branch 'pci/p2pdma' · 18c3850f
      Bjorn Helgaas authored
      - Remove documentation for obsolete pci_p2pdma_map_sg() (Tadeusz Struk)
      
      * pci/p2pdma:
        PCI/P2PDMA: Remove reference to pci_p2pdma_map_sg()
      18c3850f
    • Bjorn Helgaas's avatar
      Merge branch 'pci/enumeration-logging' · 564af7a5
      Bjorn Helgaas authored
      - Log device type (Root Port, Switch Port, etc) during enumeration (Bjorn
        Helgaas)
      
      - Log resource names (BAR 0, VF BAR 0, bridge window, etc) consistently
        instead of a mix of names and "reg 0x10" (Puranjay Mohan, Bjorn Helgaas)
      
      - Log bridges before devices below the bridges (Bjorn Helgaas)
      
      * pci/enumeration-logging:
        PCI: Log bridge info when first enumerating bridge
        PCI: Log bridge windows conditionally
        PCI: Supply bridge device, not secondary bus, to read window details
        PCI: Move pci_read_bridge_windows() below individual window accessors
        PCI: Use resource names in PCI log messages
        PCI: Update BAR # and window messages
        PCI: Log device type during enumeration
      564af7a5
    • Bjorn Helgaas's avatar
      Merge branch 'pci/enumeration' · 78e5ad79
      Bjorn Helgaas authored
      - Convert pci-host-common.c platform .remove() callback to .remove_new()
        returning 'void' since it's not useful to return error codes here (Uwe
        Kleine-König)
      
      - Log a message about updating AMD USB controller class code (so dwc3, not
        xhci, claims it) only when we actually change it (Guilherme G.  Piccoli)
      
      - Use PCI_HEADER_TYPE_* instead of literals in x86, powerpc, SCSI lpfc
        (Ilpo Järvinen)
      
      - Clean up open-coded PCIBIOS return code mangling (Ilpo Järvinen)
      
      - Fix 64GT/s effective data rate calculation to use 1b/1b encoding rather
        than the 8b/10b or 128b/130b used by lower rates (Ilpo Järvinen)
      
      * pci/enumeration:
        PCI: Fix 64GT/s effective data rate calculation
        x86/pci: Clean up open-coded PCIBIOS return code mangling
        scsi: lpfc: Use PCI_HEADER_TYPE_MFD instead of literal
        powerpc/fsl-pci: Use PCI_HEADER_TYPE_MASK instead of literal
        x86/pci: Use PCI_HEADER_TYPE_* instead of literals
        PCI: Only override AMD USB controller if required
        PCI: host-generic: Convert to platform remove callback returning void
      78e5ad79
    • Bjorn Helgaas's avatar
      Merge branch 'pci/ecam' · 996e337f
      Bjorn Helgaas authored
      - Reserve ECAM if BIOS didn't include it in PNP0C02 _CRS (Bjorn Helgaas)
      
      - Add MMCONFIG/ECAM debug logging (Bjorn Helgaas)
      
      - Rename 'MMCONFIG' to 'ECAM' to match spec usage (Bjorn Helgaas)
      
      * pci/ecam:
        x86/pci: Reorder pci_mmcfg_arch_map() definition before calls
        x86/pci: Return pci_mmconfig_add() failure early
        x86/pci: Comment pci_mmconfig_insert() obscure MCFG dependency
        x86/pci: Rename pci_mmcfg_check_reserved() to pci_mmcfg_reserved()
        x86/pci: Rename acpi_mcfg_check_entry() to acpi_mcfg_valid_entry()
        x86/pci: Rename 'MMCONFIG' to 'ECAM', use pr_fmt
        x86/pci: Add MCFG debug logging
        x86/pci: Reword ECAM EfiMemoryMappedIO logging to avoid 'reserved'
        x86/pci: Reserve ECAM if BIOS didn't include it in PNP0C02 _CRS
      996e337f
    • Bjorn Helgaas's avatar
      Merge branch 'pci/aer' · f04e5285
      Bjorn Helgaas authored
      - Log AER errors as "Correctable" (not "Corrected") or "Uncorrectable" to
        match spec terminology (Bjorn Helgaas)
      
      - Decode Requester ID when no error info found instead of printing the raw
        hex value (Bjorn Helgaas)
      
      * pci/aer:
        PCI/AER: Use explicit register sizes for struct members
        PCI/AER: Decode Requester ID when no error info found
        PCI/AER: Use 'Correctable' and 'Uncorrectable' spec terms for errors
      f04e5285
  2. 02 Jan, 2024 4 commits
  3. 15 Dec, 2023 7 commits
    • Bjorn Helgaas's avatar
      PCI: Log bridge info when first enumerating bridge · 95140c2f
      Bjorn Helgaas authored
      Log bridge secondary/subordinate bus and window information at the same
      time we log the bridge BARs, just after discovering the bridge and before
      scanning the bridge's secondary bus.  This logs the bridge and downstream
      devices in a more logical order:
      
        - pci 0000:00:01.0: [8086:1901] type 01 class 0x060400
        - pci 0000:01:00.0: [10de:13b6] type 00 class 0x030200
        - pci 0000:01:00.0: reg 0x10: [mem 0xec000000-0xecffffff]
        - pci 0000:00:01.0: PCI bridge to [bus 01]
        - pci 0000:00:01.0:   bridge window [io  0xe000-0xefff]
      
        + pci 0000:00:01.0: [8086:1901] type 01 class 0x060400
        + pci 0000:00:01.0: PCI bridge to [bus 01]
        + pci 0000:00:01.0:   bridge window [io  0xe000-0xefff]
        + pci 0000:01:00.0: [10de:13b6] type 00 class 0x030200
        + pci 0000:01:00.0: reg 0x10: [mem 0xec000000-0xecffffff]
      
      Note that we read the windows into a temporary struct resource that is
      thrown away, not into the resources in the struct pci_bus.
      
      The windows may be adjusted after we know what downstream devices require,
      and those adjustments are logged as they are made.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      95140c2f
    • Bjorn Helgaas's avatar
      PCI: Log bridge windows conditionally · 63c6ebb2
      Bjorn Helgaas authored
      Previously pci_read_bridge_io(), pci_read_bridge_mmio(), and
      pci_read_bridge_mmio_pref() unconditionally logged the bridge window
      resource.  A future change will call these functions earlier and more
      often.  Add a "log" parameter so callers can control whether to generate
      the log message.  No functional change intended.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      63c6ebb2
    • Bjorn Helgaas's avatar
      PCI: Supply bridge device, not secondary bus, to read window details · 281e1f13
      Bjorn Helgaas authored
      Previously we logged information about devices *below* the bridge before
      logging information about the bridge itself, e.g.,
      
        pci 0000:00:01.0: [8086:1901] type 01 class 0x060400
        pci 0000:01:00.0: [10de:13b6] type 00 class 0x030200
        pci 0000:01:00.0: reg 0x10: [mem 0xec000000-0xecffffff]
        pci 0000:00:01.0: PCI bridge to [bus 01]
        pci 0000:00:01.0:   bridge window [io  0xe000-0xefff]
      
      This is partly because the bridge windows are read in this path:
      
        pci_scan_child_bus_extend
          for (devfn = 0; devfn < 256; devfn += 8)
            pci_scan_slot(bus, devfn)       # scan below bridge
          pcibios_fixup_bus(bus)
            pci_read_bridge_bases(bus)      # read bridge windows
              pci_read_bridge_io(bus)
      
      Remove the assumption that the secondary (child) pci_bus already exists by
      passing in the bridge device (instead of the pci_bus) and a resource
      pointer when reading bridge windows.  A future change can use this to log
      the bridge details before we enumerate the devices below the bridge.
      
      No functional change intended.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      281e1f13
    • Bjorn Helgaas's avatar
      PCI: Move pci_read_bridge_windows() below individual window accessors · 6f32099a
      Bjorn Helgaas authored
      Move pci_read_bridge_windows() below the functions that read the I/O,
      memory, and prefetchable memory windows, so pci_read_bridge_windows() can
      use them in the future.  No functional change intended.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      6f32099a
    • Puranjay Mohan's avatar
      PCI: Use resource names in PCI log messages · dc4e6f21
      Puranjay Mohan authored
      Use the pci_resource_name() to get the name of the resource and use it
      while printing log messages.
      
      [bhelgaas: rename to match struct resource * names, also use names in other
      BAR messages]
      Link: https://lore.kernel.org/r/20211106112606.192563-3-puranjay12@gmail.comSigned-off-by: default avatarPuranjay Mohan <puranjay12@gmail.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      dc4e6f21
    • Puranjay Mohan's avatar
      PCI: Update BAR # and window messages · 65f8e0be
      Puranjay Mohan authored
      The PCI log messages print the register offsets at some places and BAR
      numbers at other places. There is no uniformity in this logging mechanism.
      It would be better to print names than register offsets.
      
      Add a helper function that aids in printing more meaningful information
      about the BAR numbers like "VF BAR", "ROM", "bridge window", etc.  This
      function can be called while printing PCI log messages.
      
      [bhelgaas: fold in Lukas' static array suggestion from
      https://lore.kernel.org/all/20211106115831.GA7452@wunner.de/]
      Link: https://lore.kernel.org/r/20211106112606.192563-2-puranjay12@gmail.comSigned-off-by: default avatarPuranjay Mohan <puranjay12@gmail.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      65f8e0be
    • Bjorn Helgaas's avatar
      PCI: Log device type during enumeration · 35259ff1
      Bjorn Helgaas authored
      Log the device type when enumeration a device.  Sample output changes:
      
        - pci 0000:00:00.0: [8086:1237] type 00 class 0x060000
        + pci 0000:00:00.0: [8086:1237] type 00 class 0x060000 conventional PCI endpoint
      
        - pci 0000:00:1c.0: [8086:a110] type 01 class 0x060400
        + pci 0000:00:1c.0: [8086:a110] type 01 class 0x060400 PCIe Root Port
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      35259ff1
  4. 05 Dec, 2023 9 commits
  5. 01 Dec, 2023 4 commits
  6. 22 Nov, 2023 1 commit
  7. 20 Nov, 2023 4 commits
  8. 13 Nov, 2023 1 commit
  9. 12 Nov, 2023 3 commits