]> git.dujemihanovic.xyz Git - u-boot.git/commit
virtio: fix get_config / set_config for legacy VirtIO targets
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Mon, 12 Feb 2024 07:37:08 +0000 (09:37 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 5 Mar 2024 13:37:53 +0000 (08:37 -0500)
commit3098115155ca9226502e39c5ad3401c25dae64fd
tree2d37e835dfc185412d49eaa1d61f1ff4f9b29a0c
parent96ca3d362d3e900d687d668d9bf81ce18692d96b
virtio: fix get_config / set_config for legacy VirtIO targets

The functions virtio_pci_get_config() and virtio_pci_set_config() don't
take the offset into account when reading the config space. For example
this manifests when U-Boot tries to read the MAC address of the VirtIO
networking device. It reads 6 equa bytes instead of the proper addess.

Fix those functions by taking the offset in the config space into
account.

Fixes: 4135e10732a0 ("virtio: Add virtio over pci transport driver")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/virtio/virtio_pci_legacy.c