Skip to contentSkip to conversation

pcie: Fix next function setting

PATCH Superseded Knut Omang 2 participants 2 messages Aug 20, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Knut Omang

author
#0 lore raw

PATCH 1/3 pcie: Fix next function setting

PCI_ARI_CAP_NFN is for reading next function not writing it

---
 hw/pci/pcie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci/pcie.c +1 -1
index a123c01..de0e967 100644
@@ -630,5 +630,5 @@ void pcie_ari_init(PCIDevice *dev, uint16_t offset, uint16_t nextfn)
 {
     pcie_add_capability(dev, PCI_EXT_CAP_ID_ARI, PCI_ARI_VER,
                         offset, PCI_ARI_SIZEOF);
-    pci_set_long(dev->config + offset + PCI_ARI_CAP, PCI_ARI_CAP_NFN(nextfn));
+    pci_set_long(dev->config + offset + PCI_ARI_CAP, (nextfn & 0xff) << 8);
 }
Signature · 1 line
1.9.0
#1 lore raw
Quoted 1 line · Knut Omang

PCI_ARI_CAP_NFN is for reading next function not writing it

The commit message is not so clear, maybe something like "Fix incorrect write to ari capability
or similar?

Other than that the patch looks OK to me.
Thanks,
Marcel

Quoted 17 lines
---
 hw/pci/pcie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci/pcie.c +1 -1
index a123c01..de0e967 100644
@@ -630,5 +630,5 @@ void pcie_ari_init(PCIDevice *dev, uint16_t offset, uint16_t nextfn)
 {
     pcie_add_capability(dev, PCI_EXT_CAP_ID_ARI, PCI_ARI_VER,
                         offset, PCI_ARI_SIZEOF);
-    pci_set_long(dev->config + offset + PCI_ARI_CAP, PCI_ARI_CAP_NFN(nextfn));
+    pci_set_long(dev->config + offset + PCI_ARI_CAP, (nextfn & 0xff) << 8);
 }