PCI: Indicate optional resource assignment failures
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 16 Dec 2024 17:56:28 +0000 (19:56 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 18 Feb 2025 21:40:54 +0000 (15:40 -0600)
Add pci_dbg() to note that an assignment failure was for an optional
resource and reword existing message about resource resize to say the
change was optional.

Link: https://lore.kernel.org/r/20241216175632.4175-22-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Xiaochun Lee <lixc17@lenovo.com>
drivers/pci/setup-bus.c

index aa092644808b28d035493547174e0038f655c74d..c80162d6aefd052146273e7ad2583344f1ecd385 100644 (file)
@@ -273,13 +273,17 @@ static void reassign_resources_sorted(struct list_head *realloc_head,
                align = add_res->min_align;
                if (!resource_size(res)) {
                        resource_set_range(res, align, add_size);
-                       if (pci_assign_resource(dev, idx))
+                       if (pci_assign_resource(dev, idx)) {
+                               pci_dbg(dev,
+                                       "%s %pR: ignoring failure in optional allocation\n",
+                                       res_name, res);
                                reset_resource(res);
+                       }
                } else {
                        res->flags |= add_res->flags &
                                 (IORESOURCE_STARTALIGN|IORESOURCE_SIZEALIGN);
                        if (pci_reassign_resource(dev, idx, add_size, align))
-                               pci_info(dev, "%s %pR: failed to add %llx\n",
+                               pci_info(dev, "%s %pR: failed to add optional %llx\n",
                                         res_name, res,
                                         (unsigned long long) add_size);
                }