Skip to contentSkip to conversation

linux-2.6.18/MSI: also reject resource with flags all clear

PATCH New Jan Beulich 1 participant 1 message Jan 29, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-2.6.18/MSI: also reject resource with flags all clear

When resource assignment fails, things may end up this way, and we want to avoid using the resource in that case.

Derived from an upstream patch by Yijing Wang <[email protected]>.

drivers/pci/msi-xen.c +3 -1
@@ -204,7 +204,9 @@ static u64 find_table_base(struct pci_de
 	bar = reg & PCI_MSIX_FLAGS_BIRMASK;
 
 	flags = pci_resource_flags(dev, bar);
-	if (flags & (IORESOURCE_DISABLED | IORESOURCE_UNSET | IORESOURCE_BUSY))
+	if (!flags ||
+	     (flags & (IORESOURCE_DISABLED | IORESOURCE_UNSET |
+		       IORESOURCE_BUSY)))
 		return 0;
 
 	return pci_resource_start(dev, bar);

MSI: also reject resource with flags all clear

When resource assignment fails, things may end up this way, and we want to avoid using the resource in that case.

Derived from an upstream patch by Yijing Wang <[email protected]>.

drivers/pci/msi-xen.c +3 -1
@@ -204,7 +204,9 @@ static u64 find_table_base(struct pci_de
 	bar = reg & PCI_MSIX_FLAGS_BIRMASK;
 
 	flags = pci_resource_flags(dev, bar);
-	if (flags & (IORESOURCE_DISABLED | IORESOURCE_UNSET | IORESOURCE_BUSY))
+	if (!flags ||
+	     (flags & (IORESOURCE_DISABLED | IORESOURCE_UNSET |
+		       IORESOURCE_BUSY)))
 		return 0;
 
 	return pci_resource_start(dev, bar);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel