virtio-pci: fix set virtio device features error

Should assgin back the feature to the vdev->features

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
This commit is contained in:
wangyongrong 2024-06-03 14:02:16 +08:00 committed by Xiang Xiao
parent b0d70b76cb
commit 639843ade3
2 changed files with 2 additions and 0 deletions

View File

@ -375,6 +375,7 @@ static void virtio_pci_legacy_set_features(FAR struct virtio_device *vdev,
pci_write_io_dword(vpdev->dev, vpdev->ioaddr + VIRTIO_PCI_GUEST_FEATURES, pci_write_io_dword(vpdev->dev, vpdev->ioaddr + VIRTIO_PCI_GUEST_FEATURES,
vdev->features); vdev->features);
vdev->features = features;
} }
/**************************************************************************** /****************************************************************************

View File

@ -572,6 +572,7 @@ static void virtio_pci_modern_set_features(FAR struct virtio_device *vdev,
pci_write_io_dword(vpdev->dev, &cfg->driver_feature, features); pci_write_io_dword(vpdev->dev, &cfg->driver_feature, features);
pci_write_io_dword(vpdev->dev, &cfg->driver_feature_select, 1); pci_write_io_dword(vpdev->dev, &cfg->driver_feature_select, 1);
pci_write_io_dword(vpdev->dev, &cfg->driver_feature, 0); pci_write_io_dword(vpdev->dev, &cfg->driver_feature, 0);
vdev->features = features;
} }
/**************************************************************************** /****************************************************************************