Commit 07854e08 authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by Bjorn Helgaas
Browse files

PCI: Indicate optional resource assignment failures

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: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Tested-by: default avatarXiaochun Lee <lixc17@lenovo.com>
parent b3281eb5
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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);
		}