summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-01 07:43:12 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-01 07:43:12 -0400
commit5ae79a735bb9c76e66a9fec3622fd410232f5dd0 (patch)
tree36d6274272ef1fd143a99b51c93edf0757051b63
parent84ae1cff969c3ee72661ca85cf4ea2d23d9ac7ea (diff)
downloadopen-iov-5ae79a735bb9c76e66a9fec3622fd410232f5dd0.tar.gz
open-iov-5ae79a735bb9c76e66a9fec3622fd410232f5dd0.zip
gsp-phys: set PCI bus-master for the claimed GPU (bootloader host DMA)
-rw-r--r--kernel/gsp_phys_gpu.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/kernel/gsp_phys_gpu.c b/kernel/gsp_phys_gpu.c
index 0936cf4..a507793 100644
--- a/kernel/gsp_phys_gpu.c
+++ b/kernel/gsp_phys_gpu.c
@@ -369,13 +369,17 @@ static int gsp_phys_probe(struct pci_dev *pdev, const struct pci_device_id *id)
phys.enabled = true;
/*
- * Read-only observability for the host->GPU DMA path: the previous
- * driver's remove clears PCI_COMMAND_MASTER and this probe does not
- * set it (no pci_set_master here on purpose yet), so any GPU-initiated
- * sysmem DMA (the FWSEC generic-BL code/data fetch) would never
- * complete. Log the command register at claim so the state is
- * provable from the cycle log.
+ * The bootloader fetches its code/data over host-sysmem DMA before
+ * FWSEC runs, so the claimed GPU needs bus-master. The previous
+ * driver's remove path clears PCI_COMMAND_MASTER through
+ * pci_disable_device(), and pci_enable_device() alone does not
+ * restore it; without master the first bootloader DMA never
+ * completes. Set it and log the resulting command register at claim
+ * so the state is provable from the cycle log. The probe error path
+ * and remove both go through gsp_phys_unmap(), whose
+ * pci_disable_device() clears master again.
*/
+ pci_set_master(pdev);
pci_read_config_word(pdev, PCI_COMMAND, &pci_cmd);
pr_info("gsp-phys: claim PCI_COMMAND=0x%04x [bus_master=%s mem=%s io=%s] dev->is_busmaster=%u\n",
pci_cmd, pci_cmd & PCI_COMMAND_MASTER ? "on" : "OFF",