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)
Fri, Dec 6, 7:43 PM
Unknown Object (File)
Wed, Dec 4, 6:51 PM
Unknown Object (File)
Nov 17 2024, 8:58 PM
Unknown Object (File)
Nov 17 2024, 8:19 PM
Unknown Object (File)
Nov 17 2024, 6:12 PM
Unknown Object (File)
Nov 17 2024, 5:21 PM
Unknown Object (File)
Nov 4 2024, 3:53 AM
Unknown Object (File)
Nov 2 2024, 10:41 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 54929
Build 51818: arc lint + arc unit

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
277

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

513

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.