1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-21 23:18:00 -08:00
openbsd-src/sys/dev
sf 77d0f8231d virtio: Refactor attach logic
virtio 1.x requires that all queue setup, including the queue interrupt
vector, is done before setting the queue_enable register to 1. This
conflicts with how we do things right now:

* We implicitly make queue setup in virtio_alloc_vq(), which is called
  from the child driver attach functions. This also sets queue_enable=1.

* Later, we allocate the interrupts and set the queue interrupt vectors
  in the second half of the virtio transport attach functions.

This is a violation of a MUST from the standard and causes problems with
some hypervisors, in particular those that have no virtio 0.9 support,
which has no such ordering requirements.

To fix this:

* Move the interrupt allocation to a new virtio_attach_finish() function.
  This does all queue setup, including the interrupt vectors.

* Don't call virtio_setup_queue() in virtio_alloc_vq() anymore.

* We can also move the setting of the DRIVER_OK flag into this function.
  virtio_attach_finish() must be called before using any virtqueue or
  writing any virtio config register.

While there,

* also streamline the attach error handling in all drivers.

* skip initially setting sc_config_change to NULL, the softc is
  initialized to 0.

ok jan@
tested by bluhm@
2024-12-20 22:18:27 +00:00
..
acpi directly use dev_t for swdevt[], remove struct swdevt 2024-10-30 06:16:27 +00:00
adb
ata Fix some spelling. 2024-09-04 07:54:51 +00:00
atapiscsi remove space between function names and argument list 2024-06-22 10:22:29 +00:00
cardbus Fix some spelling. 2024-09-04 07:54:51 +00:00
dec
dt Disallow enabling the same probe multiple times. 2024-12-04 09:37:33 +00:00
efi put opening { on same line as struct name 2024-10-22 21:50:02 +00:00
eisa
fdt virtio: Refactor attach logic 2024-12-20 22:18:27 +00:00
gpio
hid Correctly report print screen key in raw mode (i.e. under X); problem 2024-10-21 19:05:31 +00:00
hil
i2c Instead of always following up "power on" with a "reset", only 2024-10-18 12:53:49 +00:00
ic Rework and fill in the device specific handling for WCN7850. 2024-12-11 04:53:17 +00:00
isa put opening { on same line as struct name 2024-10-22 21:50:02 +00:00
microcode
mii spelling; ok mglocker@ 2024-09-06 10:54:08 +00:00
ofw Move sparc64-specific ofw prototypes out of the MI header. 2024-11-08 12:48:00 +00:00
onewire
pci virtio: Refactor attach logic 2024-12-20 22:18:27 +00:00
pckbc Driver was not calling the child activate functions in the correct way. 2024-08-18 15:09:49 +00:00
pcmcia remove unneeded includes 2024-05-26 08:46:28 +00:00
puc
pv virtio: Refactor attach logic 2024-12-20 22:18:27 +00:00
rasops Add optimized character rendering case for 6 pixels wide fonts in 2024-07-21 13:18:15 +00:00
sbus put opening { on same line as struct name 2024-10-22 21:50:02 +00:00
sdmmc Change sdhc_bus_power() behavior to return success and not perform a 2024-10-19 21:10:03 +00:00
spi
sun
tc
usb regen 2024-12-14 10:04:51 +00:00
videomode Regen 2024-11-06 09:34:43 +00:00
vmm Enable AMD SEV support in vmm(4). 2024-08-27 09:16:03 +00:00
wscons The ability to attach a wsdisplay without a terminal emulator has been 2024-11-05 16:53:30 +00:00
wsfont
x86emu Fix some spelling. 2024-09-04 07:54:51 +00:00
audio_if.h
audio.c put opening { on same line as struct name 2024-10-22 21:50:02 +00:00
bio.c
biovar.h
clock_subr.h
cninit.c
cons.c
cons.h
diskmap.c
firmload.c
hotplug.c
ipmi.c
ipmi.h
ipmivar.h
kcov.c all archs now have ci_idepth, remove ifdefs 2024-11-10 10:04:33 +00:00
kstat.c Fix some spelling. 2024-09-04 07:54:51 +00:00
ksyms.c
midi_if.h
midi.c
midivar.h remove unneeded proc.h include 2024-10-14 00:47:36 +00:00
mulaw.c
mulaw.h
radio_if.h
radio.c
radiovar.h
rd.c
rnd.c getentropy(2) is in POSIX-2024, so adjust the #include visibility, 2024-08-02 01:53:21 +00:00
rndis.h
softraid_concat.c
softraid_crypto.c
softraid_raid0.c
softraid_raid1.c
softraid_raid1c.c
softraid_raid5.c
softraid_raid6.c
softraid.c unregister softraid sensors when the volumes are removed 2024-08-18 19:44:10 +00:00
softraidvar.h
spdmem.c
spdmemvar.h
video_if.h
video.c Unlock sysctl_video(). 2024-12-16 21:22:51 +00:00
vnd.c
vndioctl.h
vscsi.c
vscsivar.h