]> Git Repo - J-linux.git/commitdiff
Merge tag 'pci-v6.8-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci
authorLinus Torvalds <[email protected]>
Thu, 18 Jan 2024 00:23:17 +0000 (16:23 -0800)
committerLinus Torvalds <[email protected]>
Thu, 18 Jan 2024 00:23:17 +0000 (16:23 -0800)
Pull pci updates from Bjorn Helgaas:
 "Enumeration:

   - Reserve ECAM so we don't assign it to PCI BARs; this works around
     bugs where BIOS included ECAM in a PNP0A03 host bridge window,
     didn't reserve it via a PNP0C02 motherboard device, and didn't
     allocate space for SR-IOV VF BARs (Bjorn Helgaas)

   - Add MMCONFIG/ECAM debug logging (Bjorn Helgaas)

   - Rename 'MMCONFIG' to 'ECAM' to match spec usage (Bjorn Helgaas)

   - Log device type (Root Port, Switch Port, etc) during enumeration
     (Bjorn Helgaas)

   - Log bridges before downstream devices so the dmesg order is more
     logical (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)

   - 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)

   - 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)

  Resource management:

   - 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)

  Driver binding:

   - 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)

   - Convert exynos, keystone, kirin from .remove() to .remove_new(),
     which returns void instead of int (Uwe Kleine-König)

   - Drop unused struct pci_driver.node member (Mathias Krause)

  Virtualization:

   - Add ACS quirk for more Zhaoxin Root Ports (LeoLiuoc)

  Error handling:

   - 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)

  Endpoint framework:

   - Use a unique test pattern for each BAR in the pci_endpoint_test to
     make it easier to debug address translation issues (Niklas Cassel)

  Broadcom STB PCIe controller driver:

   - Add DT property "brcm,clkreq-mode" and driver support for different
     CLKREQ# modes to make ASPM L1.x states possible (Jim Quinlan)

  Freescale Layerscape PCIe controller driver:

   - Add suspend/resume support for Layerscape LS1043a and LS1021a,
     including software-managed PME_Turn_Off and transitions between L0,
     L2/L3_Ready Link states (Frank Li)

  MediaTek PCIe controller driver:

   - Clear MSI interrupt status before handler to avoid missing MSIs
     that occur after the handler (qizhong cheng)

  MediaTek PCIe Gen3 controller driver:

   - Update mediatek-gen3 translation window setup to handle MMIO space
     that is not a power of two in size (Jianjun Wang)

  Qualcomm PCIe controller driver:

   - Increase qcom iommu-map maxItems to accommodate SDX55 (five
     entries) and SDM845 (sixteen entries) (Krzysztof Kozlowski)

   - Describe qcom,pcie-sc8180x clocks and resets accurately (Krzysztof
     Kozlowski)

   - Describe qcom,pcie-sm8150 clocks and resets accurately (Krzysztof
     Kozlowski)

   - Correct the qcom "reset-name" property, previously incorrectly
     called "reset-names" (Krzysztof Kozlowski)

   - Document qcom,pcie-sm8650, based on qcom,pcie-sm8550 (Neil
     Armstrong)

  Renesas R-Car PCIe controller driver:

   - Replace of_device.h with explicit of.h include to untangle header
     usage (Rob Herring)

   - Add DT and driver support for optional miniPCIe 1.5v and 3.3v
     regulators on KingFisher (Wolfram Sang)

  SiFive FU740 PCIe controller driver:

   - Convert fu740 CONFIG_PCIE_FU740 dependency from SOC_SIFIVE to
     ARCH_SIFIVE (Conor Dooley)

  Synopsys DesignWare PCIe controller driver:

   - Align iATU mapping for endpoint MSI-X (Niklas Cassel)

   - Drop "host_" prefix from struct dw_pcie_host_ops members (Yoshihiro
     Shimoda)

   - Drop "ep_" prefix from struct dw_pcie_ep_ops members (Yoshihiro
     Shimoda)

   - Rename struct dw_pcie_ep_ops.func_conf_select() to
     .get_dbi_offset() to be more descriptive (Yoshihiro Shimoda)

   - Add Endpoint DBI accessors to encapsulate offset lookups (Yoshihiro
     Shimoda)

  TI J721E PCIe driver:

   - Add j721e DT and driver support for 'num-lanes' for devices that
     support x1, x2, or x4 Links (Matt Ranostay)

   - Add j721e DT compatible strings and driver support for j784s4 (Matt
     Ranostay)

   - Make TI J721E Kconfig depend on ARCH_K3 since the hardware is
     specific to those TI SoC parts (Peter Robinson)

  TI Keystone PCIe controller driver:

   - Hold power management references to all PHYs while enabling them to
     avoid a race when one provides clocks to others (Siddharth
     Vadapalli)

  Xilinx XDMA PCIe controller driver:

   - Remove redundant dev_err(), since platform_get_irq() and
     platform_get_irq_byname() already log errors (Yang Li)

   - Fix uninitialized symbols in xilinx_pl_dma_pcie_setup_irq()
     (Krzysztof Wilczyński)

   - Fix xilinx_pl_dma_pcie_init_irq_domain() error return when
     irq_domain_add_linear() fails (Harshit Mogalapalli)

  MicroSemi Switchtec management driver:

   - 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)

  Miscellaneous:

   - Convert interrupt terminology from "legacy" to "INTx" to be more
     specific and match spec terminology (Damien Le Moal)

   - In dw-xdata-pcie, pci_endpoint_test, and vmd, replace usage of
     deprecated ida_simple_*() API with ida_alloc() and ida_free()
     (Christophe JAILLET)"

* tag 'pci-v6.8-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci: (97 commits)
  PCI: Fix kernel-doc issues
  PCI: brcmstb: Configure HW CLKREQ# mode appropriate for downstream device
  dt-bindings: PCI: brcmstb: Add property "brcm,clkreq-mode"
  PCI: mediatek-gen3: Fix translation window size calculation
  PCI: mediatek: Clear interrupt status before dispatching handler
  PCI: keystone: Fix race condition when initializing PHYs
  PCI: xilinx-xdma: Fix error code in xilinx_pl_dma_pcie_init_irq_domain()
  PCI: xilinx-xdma: Fix uninitialized symbols in xilinx_pl_dma_pcie_setup_irq()
  PCI: rcar-gen4: Fix -Wvoid-pointer-to-enum-cast error
  PCI: iproc: Fix -Wvoid-pointer-to-enum-cast warning
  PCI: dwc: Add dw_pcie_ep_{read,write}_dbi[2] helpers
  PCI: dwc: Rename .func_conf_select to .get_dbi_offset in struct dw_pcie_ep_ops
  PCI: dwc: Rename .ep_init to .init in struct dw_pcie_ep_ops
  PCI: dwc: Drop host prefix from struct dw_pcie_host_ops members
  misc: pci_endpoint_test: Use a unique test pattern for each BAR
  PCI: j721e: Make TI J721E depend on ARCH_K3
  PCI: j721e: Add TI J784S4 PCIe configuration
  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
  ...

1  2 
drivers/pci/controller/dwc/pcie-qcom.c
drivers/pci/controller/vmd.c
drivers/pci/pci.c
drivers/pci/pci.h
drivers/pci/quirks.c
drivers/scsi/lpfc/lpfc_sli.c
include/linux/pci.h

index 11c80555d97543990fdd17cf9326cf58826ab457,cd986f50ec4a481141737b9c30e6a917931ad0b8..10f2d0bb86bec008e82e6a86211161c693ae568e
@@@ -968,12 -968,9 +968,12 @@@ static int qcom_pcie_post_init_2_7_0(st
  
  static int qcom_pcie_enable_aspm(struct pci_dev *pdev, void *userdata)
  {
 -      /* Downstream devices need to be in D0 state before enabling PCI PM substates */
 +      /*
 +       * Downstream devices need to be in D0 state before enabling PCI PM
 +       * substates.
 +       */
        pci_set_power_state(pdev, PCI_D0);
 -      pci_enable_link_state(pdev, PCIE_LINK_STATE_ALL);
 +      pci_enable_link_state_locked(pdev, PCIE_LINK_STATE_ALL);
  
        return 0;
  }
@@@ -1247,9 -1244,9 +1247,9 @@@ static void qcom_pcie_host_post_init(st
  }
  
  static const struct dw_pcie_host_ops qcom_pcie_dw_ops = {
-       .host_init      = qcom_pcie_host_init,
-       .host_deinit    = qcom_pcie_host_deinit,
-       .host_post_init = qcom_pcie_host_post_init,
+       .init           = qcom_pcie_host_init,
+       .deinit         = qcom_pcie_host_deinit,
+       .post_init      = qcom_pcie_host_post_init,
  };
  
  /* Qcom IP rev.: 2.1.0        Synopsys IP rev.: 4.01a */
index 0452cbc362eef7b8707337a2d6efde15a01e9dcc,00a4264711f1b982df78ff65f08c18a461d13a72..87b7856f375abf48676e4f892d05fd92a3b5d5a9
@@@ -751,7 -751,7 +751,7 @@@ static int vmd_pm_enable_quirk(struct p
        if (!(features & VMD_FEAT_BIOS_PM_QUIRK))
                return 0;
  
 -      pci_enable_link_state(pdev, PCIE_LINK_STATE_ALL);
 +      pci_enable_link_state_locked(pdev, PCIE_LINK_STATE_ALL);
  
        pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_LTR);
        if (!pos)
@@@ -984,7 -984,7 +984,7 @@@ static int vmd_probe(struct pci_dev *de
                return -ENOMEM;
  
        vmd->dev = dev;
-       vmd->instance = ida_simple_get(&vmd_instance_ida, 0, 0, GFP_KERNEL);
+       vmd->instance = ida_alloc(&vmd_instance_ida, GFP_KERNEL);
        if (vmd->instance < 0)
                return vmd->instance;
  
        return 0;
  
   out_release_instance:
-       ida_simple_remove(&vmd_instance_ida, vmd->instance);
+       ida_free(&vmd_instance_ida, vmd->instance);
        return err;
  }
  
@@@ -1048,7 -1048,7 +1048,7 @@@ static void vmd_remove(struct pci_dev *
        vmd_cleanup_srcu(vmd);
        vmd_detach_resources(vmd);
        vmd_remove_irq_domain(vmd);
-       ida_simple_remove(&vmd_instance_ida, vmd->instance);
+       ida_free(&vmd_instance_ida, vmd->instance);
  }
  
  static void vmd_shutdown(struct pci_dev *dev)
diff --combined drivers/pci/pci.c
index ae550d71b815c4f9bd5d9127de6b835e173fcfb5,101af94af2d4065f93137710639cd4bcd05ed560..43e11c9502d1bab04a36130a744ea9c3174b4d15
@@@ -850,6 -850,66 +850,66 @@@ struct resource *pci_find_resource(stru
  }
  EXPORT_SYMBOL(pci_find_resource);
  
+ /**
+  * pci_resource_name - Return the name of the PCI resource
+  * @dev: PCI device to query
+  * @i: index of the resource
+  *
+  * Return the standard PCI resource (BAR) name according to their index.
+  */
+ const char *pci_resource_name(struct pci_dev *dev, unsigned int i)
+ {
+       static const char * const bar_name[] = {
+               "BAR 0",
+               "BAR 1",
+               "BAR 2",
+               "BAR 3",
+               "BAR 4",
+               "BAR 5",
+               "ROM",
+ #ifdef CONFIG_PCI_IOV
+               "VF BAR 0",
+               "VF BAR 1",
+               "VF BAR 2",
+               "VF BAR 3",
+               "VF BAR 4",
+               "VF BAR 5",
+ #endif
+               "bridge window",        /* "io" included in %pR */
+               "bridge window",        /* "mem" included in %pR */
+               "bridge window",        /* "mem pref" included in %pR */
+       };
+       static const char * const cardbus_name[] = {
+               "BAR 1",
+               "unknown",
+               "unknown",
+               "unknown",
+               "unknown",
+               "unknown",
+ #ifdef CONFIG_PCI_IOV
+               "unknown",
+               "unknown",
+               "unknown",
+               "unknown",
+               "unknown",
+               "unknown",
+ #endif
+               "CardBus bridge window 0",      /* I/O */
+               "CardBus bridge window 1",      /* I/O */
+               "CardBus bridge window 0",      /* mem */
+               "CardBus bridge window 1",      /* mem */
+       };
+       if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS &&
+           i < ARRAY_SIZE(cardbus_name))
+               return cardbus_name[i];
+       if (i < ARRAY_SIZE(bar_name))
+               return bar_name[i];
+       return "unknown";
+ }
  /**
   * pci_wait_for_pending - wait for @mask bit(s) to clear in status word @pos
   * @dev: the PCI device to operate on
@@@ -1219,9 -1279,6 +1279,9 @@@ static int pci_dev_wait(struct pci_dev 
        if (delay > PCI_RESET_WAIT)
                pci_info(dev, "ready %dms after %s\n", delay - 1,
                         reset_type);
 +      else
 +              pci_dbg(dev, "ready %dms after %s\n", delay - 1,
 +                      reset_type);
  
        return 0;
  }
@@@ -1338,9 -1395,6 +1398,9 @@@ static int pci_set_full_power_state(str
                pci_restore_bars(dev);
        }
  
 +      if (dev->bus->self)
 +              pcie_aspm_pm_state_change(dev->bus->self);
 +
        return 0;
  }
  
@@@ -1435,9 -1489,6 +1495,9 @@@ static int pci_set_low_power_state(stru
                                     pci_power_name(dev->current_state),
                                     pci_power_name(state));
  
 +      if (dev->bus->self)
 +              pcie_aspm_pm_state_change(dev->bus->self);
 +
        return 0;
  }
  
@@@ -3299,6 -3350,7 +3359,7 @@@ static struct resource *pci_ea_get_reso
  static int pci_ea_read(struct pci_dev *dev, int offset)
  {
        struct resource *res;
+       const char *res_name;
        int ent_size, ent_offset = offset;
        resource_size_t start, end;
        unsigned long flags;
                goto out;
  
        res = pci_ea_get_resource(dev, bei, prop);
+       res_name = pci_resource_name(dev, bei);
        if (!res) {
                pci_err(dev, "Unsupported EA entry BEI: %u\n", bei);
                goto out;
        res->flags = flags;
  
        if (bei <= PCI_EA_BEI_BAR5)
-               pci_info(dev, "BAR %d: %pR (from Enhanced Allocation, properties %#02x)\n",
-                          bei, res, prop);
+               pci_info(dev, "%s %pR: from Enhanced Allocation, properties %#02x\n",
+                        res_name, res, prop);
        else if (bei == PCI_EA_BEI_ROM)
-               pci_info(dev, "ROM: %pR (from Enhanced Allocation, properties %#02x)\n",
-                          res, prop);
+               pci_info(dev, "%s %pR: from Enhanced Allocation, properties %#02x\n",
+                        res_name, res, prop);
        else if (bei >= PCI_EA_BEI_VF_BAR0 && bei <= PCI_EA_BEI_VF_BAR5)
-               pci_info(dev, "VF BAR %d: %pR (from Enhanced Allocation, properties %#02x)\n",
-                          bei - PCI_EA_BEI_VF_BAR0, res, prop);
+               pci_info(dev, "%s %pR: from Enhanced Allocation, properties %#02x\n",
+                        res_name, res, prop);
        else
-               pci_info(dev, "BEI %d res: %pR (from Enhanced Allocation, properties %#02x)\n",
+               pci_info(dev, "BEI %d %pR: from Enhanced Allocation, properties %#02x\n",
                           bei, res, prop);
  
  out:
@@@ -6698,14 -6751,15 +6760,15 @@@ static void pci_request_resource_alignm
                                           resource_size_t align, bool resize)
  {
        struct resource *r = &dev->resource[bar];
+       const char *r_name = pci_resource_name(dev, bar);
        resource_size_t size;
  
        if (!(r->flags & IORESOURCE_MEM))
                return;
  
        if (r->flags & IORESOURCE_PCI_FIXED) {
-               pci_info(dev, "BAR%d %pR: ignoring requested alignment %#llx\n",
-                        bar, r, (unsigned long long)align);
+               pci_info(dev, "%s %pR: ignoring requested alignment %#llx\n",
+                        r_name, r, (unsigned long long)align);
                return;
        }
  
         * devices and we use the second.
         */
  
-       pci_info(dev, "BAR%d %pR: requesting alignment to %#llx\n",
-                bar, r, (unsigned long long)align);
+       pci_info(dev, "%s %pR: requesting alignment to %#llx\n",
+                r_name, r, (unsigned long long)align);
  
        if (resize) {
                r->start = 0;
diff --combined drivers/pci/pci.h
index f43873049d52cf08e71fcf26e9dcc74afb7ef6d8,251a1c9627da735a2c37aed229b78cdb5c5070d2..2336a8d1edab27646220794a3a4cdd085ba7b3e9
@@@ -255,6 -255,8 +255,8 @@@ void __pci_bus_assign_resources(const s
                                struct list_head *fail_head);
  bool pci_bus_clip_resource(struct pci_dev *dev, int idx);
  
+ const char *pci_resource_name(struct pci_dev *dev, unsigned int i);
  void pci_reassigndev_resource_alignment(struct pci_dev *dev);
  void pci_disable_bridge_window(struct pci_dev *dev);
  struct pci_bus *pci_bus_get(struct pci_bus *bus);
@@@ -272,7 -274,7 +274,7 @@@ void pci_bus_put(struct pci_bus *bus)
  
  /* PCIe speed to Mb/s reduced by encoding overhead */
  #define PCIE_SPEED2MBS_ENC(speed) \
-       ((speed) == PCIE_SPEED_64_0GT ? 64000*128/130 : \
+       ((speed) == PCIE_SPEED_64_0GT ? 64000*1/1 : \
         (speed) == PCIE_SPEED_32_0GT ? 32000*128/130 : \
         (speed) == PCIE_SPEED_16_0GT ? 16000*128/130 : \
         (speed) == PCIE_SPEED_8_0GT  ?  8000*128/130 : \
@@@ -569,12 -571,10 +571,12 @@@ int pcie_retrain_link(struct pci_dev *p
  #ifdef CONFIG_PCIEASPM
  void pcie_aspm_init_link_state(struct pci_dev *pdev);
  void pcie_aspm_exit_link_state(struct pci_dev *pdev);
 +void pcie_aspm_pm_state_change(struct pci_dev *pdev);
  void pcie_aspm_powersave_config_link(struct pci_dev *pdev);
  #else
  static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) { }
  static inline void pcie_aspm_exit_link_state(struct pci_dev *pdev) { }
 +static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev) { }
  static inline void pcie_aspm_powersave_config_link(struct pci_dev *pdev) { }
  #endif
  
diff --combined drivers/pci/quirks.c
index d208047d1b8f22f972b59218e1ba870a4c462cc2,e4bf0ed46393128b21c5aca3d6231f3dba845f5c..d797df6e5f3e917d08dfce4e40f594e322a5782e
@@@ -570,13 -570,14 +570,14 @@@ static void quirk_extend_bar_to_page(st
  
        for (i = 0; i < PCI_STD_NUM_BARS; i++) {
                struct resource *r = &dev->resource[i];
+               const char *r_name = pci_resource_name(dev, i);
  
                if (r->flags & IORESOURCE_MEM && resource_size(r) < PAGE_SIZE) {
                        r->end = PAGE_SIZE - 1;
                        r->start = 0;
                        r->flags |= IORESOURCE_UNSET;
-                       pci_info(dev, "expanded BAR %d to page size: %pR\n",
-                                i, r);
+                       pci_info(dev, "%s %pR: expanded to page size\n",
+                                r_name, r);
                }
        }
  }
@@@ -605,6 -606,7 +606,7 @@@ static void quirk_io(struct pci_dev *de
        u32 region;
        struct pci_bus_region bus_region;
        struct resource *res = dev->resource + pos;
+       const char *res_name = pci_resource_name(dev, pos);
  
        pci_read_config_dword(dev, PCI_BASE_ADDRESS_0 + (pos << 2), &region);
  
        bus_region.end = region + size - 1;
        pcibios_bus_to_resource(dev->bus, res, &bus_region);
  
-       pci_info(dev, FW_BUG "%s quirk: reg 0x%x: %pR\n",
-                name, PCI_BASE_ADDRESS_0 + (pos << 2), res);
+       pci_info(dev, FW_BUG "%s %pR: %s quirk\n", res_name, res, name);
  }
  
  /*
@@@ -670,6 -671,12 +671,12 @@@ static void quirk_io_region(struct pci_
        bus_region.end = region + size - 1;
        pcibios_bus_to_resource(dev->bus, res, &bus_region);
  
+       /*
+        * "res" is typically a bridge window resource that's not being
+        * used for a bridge window, so it's just a place to stash this
+        * non-standard resource.  Printing "nr" or pci_resource_name() of
+        * it doesn't really make sense.
+        */
        if (!pci_claim_resource(dev, nr))
                pci_info(dev, "quirk: %pR claimed by %s\n", res, name);
  }
@@@ -702,10 -709,13 +709,13 @@@ static void quirk_amd_dwc_class(struct 
  {
        u32 class = pdev->class;
  
-       /* Use "USB Device (not host controller)" class */
-       pdev->class = PCI_CLASS_SERIAL_USB_DEVICE;
-       pci_info(pdev, "PCI class overridden (%#08x -> %#08x) so dwc3 driver can claim this instead of xhci\n",
-                class, pdev->class);
+       if (class != PCI_CLASS_SERIAL_USB_DEVICE) {
+               /* Use "USB Device (not host controller)" class */
+               pdev->class = PCI_CLASS_SERIAL_USB_DEVICE;
+               pci_info(pdev,
+                       "PCI class overridden (%#08x -> %#08x) so dwc3 driver can claim this instead of xhci\n",
+                       class, pdev->class);
+       }
  }
  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB,
                quirk_amd_dwc_class);
@@@ -3786,19 -3796,6 +3796,19 @@@ static void quirk_no_pm_reset(struct pc
  DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_ATI, PCI_ANY_ID,
                               PCI_CLASS_DISPLAY_VGA, 8, quirk_no_pm_reset);
  
 +/*
 + * Spectrum-{1,2,3,4} devices report that a D3hot->D0 transition causes a reset
 + * (i.e., they advertise NoSoftRst-). However, this transition does not have
 + * any effect on the device: It continues to be operational and network ports
 + * remain up. Advertising this support makes it seem as if a PM reset is viable
 + * for these devices. Mark it as unavailable to skip it when testing reset
 + * methods.
 + */
 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, 0xcb84, quirk_no_pm_reset);
 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, 0xcf6c, quirk_no_pm_reset);
 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, 0xcf70, quirk_no_pm_reset);
 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, 0xcf80, quirk_no_pm_reset);
 +
  /*
   * Thunderbolt controllers with broken MSI hotplug signaling:
   * Entire 1st generation (Light Ridge, Eagle Ridge, Light Peak) and part
@@@ -4712,17 -4709,21 +4722,21 @@@ static int pci_quirk_xgene_acs(struct p
   * But the implementation could block peer-to-peer transactions between them
   * and provide ACS-like functionality.
   */
- static int  pci_quirk_zhaoxin_pcie_ports_acs(struct pci_dev *dev, u16 acs_flags)
+ static int pci_quirk_zhaoxin_pcie_ports_acs(struct pci_dev *dev, u16 acs_flags)
  {
        if (!pci_is_pcie(dev) ||
            ((pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT) &&
             (pci_pcie_type(dev) != PCI_EXP_TYPE_DOWNSTREAM)))
                return -ENOTTY;
  
+       /*
+        * Future Zhaoxin Root Ports and Switch Downstream Ports will
+        * implement ACS capability in accordance with the PCIe Spec.
+        */
        switch (dev->device) {
        case 0x0710 ... 0x071e:
        case 0x0721:
-       case 0x0723 ... 0x0732:
+       case 0x0723 ... 0x0752:
                return pci_acs_ctrl_enabled(acs_flags,
                        PCI_ACS_SV | PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_UF);
        }
index 46e6f807d1ca7220b400a1772aceda5f87f7b377,4ac6afd3c2fe9782db7a752e4fa97b5fcf463e91..706985358c6a02f37d91698c0163f506695e22cc
@@@ -2995,9 -2995,8 +2995,9 @@@ lpfc_sli4_unreg_rpi_cmpl_clr(struct lpf
                     LPFC_SLI_INTF_IF_TYPE_2)) {
                        if (ndlp) {
                                lpfc_printf_vlog(
 -                                       vport, KERN_INFO, LOG_MBOX | LOG_SLI,
 -                                       "0010 UNREG_LOGIN vpi:%x "
 +                                       vport, KERN_INFO,
 +                                       LOG_MBOX | LOG_SLI | LOG_NODE,
 +                                       "0010 UNREG_LOGIN vpi:x%x "
                                         "rpi:%x DID:%x defer x%x flg x%x "
                                         "x%px\n",
                                         vport->vpi, ndlp->nlp_rpi,
                                    (ndlp->nlp_defer_did !=
                                    NLP_EVT_NOTHING_PENDING)) {
                                        lpfc_printf_vlog(
 -                                              vport, KERN_INFO, LOG_DISCOVERY,
 +                                              vport, KERN_INFO,
 +                                              LOG_MBOX | LOG_SLI | LOG_NODE,
                                                "4111 UNREG cmpl deferred "
                                                "clr x%x on "
                                                "NPort x%x Data: x%x x%px\n",
@@@ -3940,9 -3938,6 +3940,9 @@@ void lpfc_poll_eratt(struct timer_list 
        if (!(phba->hba_flag & HBA_SETUP))
                return;
  
 +      if (phba->pport->load_flag & FC_UNLOADING)
 +              return;
 +
        /* Here we will also keep track of interrupts per sec of the hba */
        sli_intr = phba->sli.slistat.sli_intr;
  
@@@ -4880,7 -4875,7 +4880,7 @@@ void lpfc_reset_barrier(struct lpfc_hb
        lockdep_assert_held(&phba->hbalock);
  
        pci_read_config_byte(phba->pcidev, PCI_HEADER_TYPE, &hdrtype);
-       if (hdrtype != 0x80 ||
+       if (hdrtype != PCI_HEADER_TYPE_MFD ||
            (FC_JEDEC_ID(phba->vpd.rev.biuRev) != HELIOS_JEDEC_ID &&
             FC_JEDEC_ID(phba->vpd.rev.biuRev) != THOR_JEDEC_ID))
                return;
@@@ -10146,12 -10141,11 +10146,12 @@@ lpfc_sli_issue_mbox_s4(struct lpfc_hba 
        spin_unlock_irqrestore(&phba->hbalock, iflags);
        lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI,
                        "(%d):0354 Mbox cmd issue - Enqueue Data: "
 -                      "x%x (x%x/x%x) x%x x%x x%x\n",
 +                      "x%x (x%x/x%x) x%x x%x x%x x%x\n",
                        mboxq->vport ? mboxq->vport->vpi : 0xffffff,
                        bf_get(lpfc_mqe_command, &mboxq->u.mqe),
                        lpfc_sli_config_mbox_subsys_get(phba, mboxq),
                        lpfc_sli_config_mbox_opcode_get(phba, mboxq),
 +                      mboxq->u.mb.un.varUnregLogin.rpi,
                        phba->pport->port_state,
                        psli->sli_flag, MBX_NOWAIT);
        /* Wake up worker thread to transport mailbox command from head */
@@@ -22173,12 -22167,6 +22173,12 @@@ struct lpfc_io_buf *lpfc_get_io_buf(str
   * The data will be truncated if datasz is not large enough.
   * Version 1 is not supported with Embedded mbox cmd, so we must use version 0.
   * Returns the actual bytes read from the object.
 + *
 + * This routine is hard coded to use a poll completion.  Unlike other
 + * sli4_config mailboxes, it uses lpfc_mbuf memory which is not
 + * cleaned up in lpfc_sli4_cmd_mbox_free.  If this routine is modified
 + * to use interrupt-based completions, code is needed to fully cleanup
 + * the memory.
   */
  int
  lpfc_read_object(struct lpfc_hba *phba, char *rdobject, uint32_t *datap,
diff --combined include/linux/pci.h
index 58a4c976c39bde68bb7ad522e010c3705847ed04,0f0886a61ade5cd7f68d380dc7e12d4ac01bf8aa..99a66bc69a39332dce40733e1935c7651595806f
@@@ -715,6 -715,7 +715,7 @@@ static inline bool pci_is_bridge(struc
  
  /**
   * pci_is_vga - check if the PCI device is a VGA device
+  * @pdev: PCI device
   *
   * The PCI Code and ID Assignment spec, r1.15, secs 1.4 and 1.1, define
   * VGA Base Class and Sub-Classes:
@@@ -885,7 -886,6 +886,6 @@@ struct module
  
  /**
   * struct pci_driver - PCI driver structure
-  * @node:     List of driver structures.
   * @name:     Driver name.
   * @id_table: Pointer to table of device IDs the driver is
   *            interested in.  Most drivers should export this
   *            own I/O address space.
   */
  struct pci_driver {
-       struct list_head        node;
        const char              *name;
        const struct pci_device_id *id_table;   /* Must be non-NULL for probe to be called */
        int  (*probe)(struct pci_dev *dev, const struct pci_device_id *id);     /* New device inserted */
@@@ -1073,11 -1072,13 +1072,13 @@@ enum 
        PCI_SCAN_ALL_PCIE_DEVS  = 0x00000040,   /* Scan all, not just dev 0 */
  };
  
- #define PCI_IRQ_LEGACY                (1 << 0) /* Allow legacy interrupts */
+ #define PCI_IRQ_INTX          (1 << 0) /* Allow INTx interrupts */
  #define PCI_IRQ_MSI           (1 << 1) /* Allow MSI interrupts */
  #define PCI_IRQ_MSIX          (1 << 2) /* Allow MSI-X interrupts */
  #define PCI_IRQ_AFFINITY      (1 << 3) /* Auto-assign affinity */
  
+ #define PCI_IRQ_LEGACY                PCI_IRQ_INTX /* Deprecated! Use PCI_IRQ_INTX */
  /* These external functions are only available when PCI support is enabled */
  #ifdef CONFIG_PCI
  
@@@ -1239,8 -1240,6 +1240,8 @@@ int pci_read_config_dword(const struct 
  int pci_write_config_byte(const struct pci_dev *dev, int where, u8 val);
  int pci_write_config_word(const struct pci_dev *dev, int where, u16 val);
  int pci_write_config_dword(const struct pci_dev *dev, int where, u32 val);
 +void pci_clear_and_set_config_dword(const struct pci_dev *dev, int pos,
 +                                  u32 clear, u32 set);
  
  int pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *val);
  int pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *val);
@@@ -1831,7 -1830,6 +1832,7 @@@ extern bool pcie_ports_native
  int pci_disable_link_state(struct pci_dev *pdev, int state);
  int pci_disable_link_state_locked(struct pci_dev *pdev, int state);
  int pci_enable_link_state(struct pci_dev *pdev, int state);
 +int pci_enable_link_state_locked(struct pci_dev *pdev, int state);
  void pcie_no_aspm(void);
  bool pcie_aspm_support_enabled(void);
  bool pcie_aspm_enabled(struct pci_dev *pdev);
@@@ -1842,8 -1840,6 +1843,8 @@@ static inline int pci_disable_link_stat
  { return 0; }
  static inline int pci_enable_link_state(struct pci_dev *pdev, int state)
  { return 0; }
 +static inline int pci_enable_link_state_locked(struct pci_dev *pdev, int state)
 +{ return 0; }
  static inline void pcie_no_aspm(void) { }
  static inline bool pcie_aspm_support_enabled(void) { return false; }
  static inline bool pcie_aspm_enabled(struct pci_dev *pdev) { return false; }
@@@ -2132,14 -2128,14 +2133,14 @@@ int pci_iobar_pfn(struct pci_dev *pdev
        (pci_resource_end((dev), (bar)) ?                               \
         resource_size(pci_resource_n((dev), (bar))) : 0)
  
- #define __pci_dev_for_each_res0(dev, res, ...)                                \
-       for (unsigned int __b = 0;                                      \
-            res = pci_resource_n(dev, __b), __b < PCI_NUM_RESOURCES;   \
+ #define __pci_dev_for_each_res0(dev, res, ...)                                  \
+       for (unsigned int __b = 0;                                        \
+            __b < PCI_NUM_RESOURCES && (res = pci_resource_n(dev, __b)); \
             __b++)
  
- #define __pci_dev_for_each_res1(dev, res, __b)                                \
-       for (__b = 0;                                                   \
-            res = pci_resource_n(dev, __b), __b < PCI_NUM_RESOURCES;   \
+ #define __pci_dev_for_each_res1(dev, res, __b)                                  \
+       for (__b = 0;                                                     \
+            __b < PCI_NUM_RESOURCES && (res = pci_resource_n(dev, __b)); \
             __b++)
  
  #define pci_dev_for_each_resource(dev, res, ...)                      \
This page took 0.135935 seconds and 4 git commands to generate.