PCI: Log failed config reads.

We already log "can't read config" in this method, so let's
also log lower-level failures.

May help with investigating #18536.
This commit is contained in:
Augustin Cavalier
2024-07-09 11:45:44 -04:00
parent 1342073197
commit 88979be93f
+8 -3
View File
@@ -1566,13 +1566,18 @@ PCI::ReadConfig(uint8 domain, uint8 bus, uint8 device, uint8 function,
|| (size != 1 && size != 2 && size != 4)
|| (size == 2 && (offset & 3) == 3)
|| (size == 4 && (offset & 3) != 0)) {
dprintf("PCI: can't read config for domain %d, bus %u, device %u, function %u, offset %u, size %u\n",
dprintf("PCI: can't read config for domain %d, %u:%u:%u, offset %u, size %u\n",
domain, bus, device, function, offset, size);
return B_ERROR;
}
return (*info->controller->read_pci_config)(info->controller_cookie, bus,
device, function, offset, size, value);
status_t status = (*info->controller->read_pci_config)(info->controller_cookie,
bus, device, function, offset, size, value);
if (status != B_OK) {
dprintf("PCI: failed to read config for domain %d, %u:%u:%u, offset %u, size %u\n",
domain, bus, device, function, offset, size);
}
return status;
}