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 Passed - Unit
No Test Coverage - Build Status
Buildable 70195 Build 67078: 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 | ||
|---|---|---|
| 5964–5975 | 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 | ||
|---|---|---|
| 381 | 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 | ||
| 5964–5975 | 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); | |
Added the comment code, updated the function description in the manpage
instead of an error code.
| lib/libdevctl/devctl.3 | ||
|---|---|---|
| 381 | you are right, I have moved it to the function description instead. The reason I'd like to update it is that I was trying to deduct if that behaviour is correct from the manpage, but I wasn't sure. | |
This looks good to me modulo one style nit I can fix while merging. Is "Marcin Cieslak <saper@saper.info>" the right way to credit you as the author of the commit?