Page MenuHomeFreeBSD

vtscmi: Add a virtio-scmi driver
ClosedPublic

Authored by cristian.marussi_arm.com on Dec 13 2023, 6:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 14, 6:34 PM
Unknown Object (File)
Thu, Apr 11, 1:11 PM
Unknown Object (File)
Sat, Apr 6, 8:58 PM
Unknown Object (File)
Mon, Mar 25, 5:17 PM
Unknown Object (File)
Feb 27 2024, 4:19 AM
Unknown Object (File)
Feb 3 2024, 8:19 AM
Unknown Object (File)
Jan 18 2024, 1:24 PM
Unknown Object (File)
Jan 12 2024, 2:40 AM

Details

Summary

Add a new virtio backend to support SCMI VirtIO devices (type 32) as
defined by the VirtIO specification since version v1.2.

https://docs.oasis-open.org/virtio/virtio/v1.2/cs01/virtio-v1.2-cs01.pdf

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Just a few minor comments. Note though that I only have time to do a brief review of this and haven't read the relevant section of the spec.

sys/dev/virtio/scmi/virtio_scmi.c
278

Nit: M_WAITOK means this cannot fail. May be slightly clearer to use mallocarray() instead.

514

A virtqueue_poll() variant with a timeout param could be useful in general.

This revision is now accepted and ready to land.Jan 31 2024, 4:13 AM

Thanks for the review @bryanv.
Regarding:

"A virtqueue_poll() variant with a timeout param could be useful in general."

I was thinking exactly the same while doing this, but being a first time contributor to freeBSD, I was not sure how easily acceptable would have been to post a change related to some core system (like virtio) inside this series,
so I went for a custom solution at first. I can certainly post subsequently a patch to add a virtqueue_poll timeout variant to the virtio-core and make use of it in here, once this is merged/landed.

Thanks for the review @bryanv.
Regarding:

"A virtqueue_poll() variant with a timeout param could be useful in general."

I was thinking exactly the same while doing this, but being a first time contributor to freeBSD, I was not sure how easily acceptable would have been to post a change related to some core system (like virtio) inside this series,
so I went for a custom solution at first. I can certainly post subsequently a patch to add a virtqueue_poll timeout variant to the virtio-core and make use of it in here, once this is merged/landed.

Sure, a separate follow on commit is fine.

Removed needless checks on malloc, using mallocarray

Using mallocarray() and dropping the retval check since invoked as M_WAITOK

This revision now requires review to proceed.Mar 1 2024, 7:12 PM
This revision is now accepted and ready to land.Mar 5 2024, 2:36 PM
This revision was automatically updated to reflect the committed changes.

It's not very useful as a module as it provides infrastructure other devices need, e.g. their clock, or a reset line. If it was a module these drivers would fail to attach if they were built into the kernel.