Detaching bhyve(4) ppt driver from the unsupported PCI device shall
not cause "Device not configured" error. We do not expect
that a new driver must take the device over in this case.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 66384 Build 63267: arc lint + arc unit
Event Timeline
I was really confused by the wifibox messages like this
2025-08-04T11:35:14+0200 WARN PPT device pci2:0:0 could not be destroyed 2025-08-04T11:35:20+0200 WARN PPT device pci2:0:0 could not be destroyed 2025-08-04T11:35:27+0200 WARN PPT device pci2:0:0 could not be destroyed 2025-08-04T11:35:34+0200 WARN PPT device pci2:0:0 could not be destroyed 2025-08-04T11:35:40+0200 WARN PPT device pci2:0:0 could not be destroyed 2025-08-04T11:35:47+0200 WARN PPT device pci2:0:0 could not be destroyed 2025-08-04T11:35:54+0200 WARN PPT device pci2:0:0 could not be destroyed 2025-08-04T11:36:00+0200 WARN PPT device pci2:0:0 could not be destroyed
https://lists.freebsd.org/archives/freebsd-current/2025-August/008456.html
sys/kern/subr_bus.c | ||
---|---|---|
5937–5944 | yea, device_probe() is weird. It returns -1 in two cases, only one of which is relevant here (the DS_ALIVE one). I guess neither could happen getting here though, assuming that device_detach does the right thing. |
Silence ENXIO from device_probe()
device_probe() will return ENXIO when no driver could be found.
As it turns out, we get ENXIO from device_probe() when no driver has been found.
With this change wifibox does not report any error anymore and it can be stopped and started multiple times.
I wonder how to test this with some other device, or whether devmatch works/does not work with this
lib/libdevctl/devctl.3 | ||
---|---|---|
380 | This I think already covers the behavior you are fixing as it says the error is only if attach fails, not if probe doesn't find a driver, so I would probably leave off the manpage update. | |
sys/kern/subr_bus.c | ||
5937 | I think this needs a comment, something like: devclass_delete_device(...); /* * Don't use device_probe_and_attach so that failing to find a new driver * isn't reported as an error. */ error = device_probe(dev); |