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)
Mon, Nov 4, 3:53 AM
Unknown Object (File)
Sat, Nov 2, 10:41 PM
Unknown Object (File)
Oct 5 2024, 4:45 AM
Unknown Object (File)
Oct 3 2024, 3:53 PM
Unknown Object (File)
Oct 1 2024, 4:02 PM
Unknown Object (File)
Sep 30 2024, 2:24 AM
Unknown Object (File)
Sep 28 2024, 3:05 AM
Unknown Object (File)
Sep 26 2024, 3:40 PM

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.