]> git.baikalelectronics.ru Git - kernel.git/commit
firmware: arm_scmi: Add proper barriers to scmi virtio device
authorCristian Marussi <cristian.marussi@arm.com>
Thu, 16 Sep 2021 10:33:36 +0000 (11:33 +0100)
committerSudeep Holla <sudeep.holla@arm.com>
Wed, 6 Oct 2021 10:12:45 +0000 (11:12 +0100)
commite8b4b5d7b06e1f5f899a0b102ac24a98c5229d75
treea1fd86d6981a6b301a6a4cdb2db4877df9a49bb3
parent0395bb42a32b59e682bd67174c9fc17a576cce40
firmware: arm_scmi: Add proper barriers to scmi virtio device

Only one single SCMI Virtio device is currently supported by this driver
and it is referenced using a static global variable which is initialized
once for all during probing and nullified at virtio device removal.

Add proper SMP barriers to protect accesses to such device reference to
ensure that the initialzation state of such device is correctly observed by
all PEs at any time.

Return -EBUSY, instead of -EINVAL, and a descriptive error message if more
than one SCMI Virtio device is ever found and probed.

Link: https://lore.kernel.org/r/20210916103336.7243-3-cristian.marussi@arm.com
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_scmi/virtio.c