From 88979be93fd3bc40c10a43007c4c8191637100b6 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 9 Jul 2024 11:45:44 -0400 Subject: [PATCH] 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. --- src/add-ons/kernel/bus_managers/pci/pci.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/add-ons/kernel/bus_managers/pci/pci.cpp b/src/add-ons/kernel/bus_managers/pci/pci.cpp index d6b4cdb40b..5bfe169d68 100644 --- a/src/add-ons/kernel/bus_managers/pci/pci.cpp +++ b/src/add-ons/kernel/bus_managers/pci/pci.cpp @@ -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; }