[PATCH 6/9] virtio: fix support for big-endian clients

Ahmad Fatoum ahmad at a3f.at
Sun Feb 28 14:08:33 EST 2021


With virtio 1.0 everything is little endian. Add back the Version 1.0
check that got lost during porting virtio to barebox.

Signed-off-by: Ahmad Fatoum <ahmad at a3f.at>
---
 include/linux/virtio_config.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index e6fc31f627fc..f33cfdacaa2c 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -203,7 +203,8 @@ static inline bool virtio_has_dma_quirk(const struct virtio_device *vdev)
 
 static inline bool virtio_is_little_endian(struct virtio_device *vdev)
 {
-	return virtio_legacy_is_little_endian();
+	return virtio_has_feature(vdev, VIRTIO_F_VERSION_1) ||
+		virtio_legacy_is_little_endian();
 }
 
 
-- 
2.30.0




More information about the barebox mailing list