virtio/virtio-pci: improve debug logging and fix comments

- Replace pciXXX() debug calls with vrtXXX() for consistency
- Add additional debug logging for better traceability
- Fix minor comment typos

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
Bowen Wang
2025-05-11 16:24:52 +08:00
committed by Alan C. Assis
parent effdb88710
commit 5c835881b2
3 changed files with 11 additions and 12 deletions
+5 -4
View File
@@ -177,7 +177,7 @@ virtio_pci_legacy_get_queue_len(FAR struct virtio_pci_device_s *vpdev,
(uintptr_t)(vpdev->ioaddr + VIRTIO_PCI_QUEUE_NUM), &num);
if (num == 0)
{
pcierr("Queue is not available num=%d\n", num);
vrterr("Queue is not available num=%d\n", num);
}
return num;
@@ -430,7 +430,7 @@ virtio_pci_legacy_init_device(FAR struct virtio_pci_device_s *vpdev)
if (dev->revision != VIRTIO_PCI_ABI_VERSION)
{
pcierr("Virtio_pci: expected ABI version %d, got %u\n",
vrterr("Virtio_pci: expected ABI version %d, got %u\n",
VIRTIO_PCI_ABI_VERSION, dev->revision);
return -ENODEV;
}
@@ -458,10 +458,11 @@ int virtio_pci_legacy_probe(FAR struct pci_device_s *dev)
FAR struct virtio_device *vdev = &vpdev->vdev;
int ret;
/* We only own devices >= 0x1000 and <= 0x107f: leave the rest. */
/* We only own devices >= 0x1000 and <= 0x103f: leave the rest. */
if (dev->device < 0x1000 || dev->device > 0x103f)
{
vrtwarn("Device id 0x%04x not supported\n", dev->device);
return -ENODEV;
}
@@ -472,7 +473,7 @@ int virtio_pci_legacy_probe(FAR struct pci_device_s *dev)
ret = virtio_pci_legacy_init_device(vpdev);
if (ret < 0)
{
pcierr("Virtio pci legacy device init failed, ret=%d\n", ret);
vrterr("Virtio pci legacy device init failed, ret=%d\n", ret);
}
return ret;
+3 -5
View File
@@ -714,6 +714,7 @@ int virtio_pci_modern_probe(FAR struct pci_device_s *dev)
if (dev->device < 0x1000 || dev->device > 0x107f)
{
vrtwarn("Device id 0x%04x not supported\n", dev->device);
return -ENODEV;
}
@@ -722,12 +723,9 @@ int virtio_pci_modern_probe(FAR struct pci_device_s *dev)
vdev->role = VIRTIO_DEV_DRIVER;
ret = virtio_pci_init_device(vpdev);
if (ret < 0)
if (ret < 0 && ret != -ENODEV)
{
if (ret != -ENODEV)
{
pcierr("Virtio pci modern device init failed, ret=%d\n", ret);
}
vrterr("Virtio pci modern device init failed, ret=%d\n", ret);
}
return ret;
+3 -3
View File
@@ -182,7 +182,7 @@ static int virtio_pci_probe(FAR struct pci_device_s *dev)
if (dev->device < 0x1000 || dev->device > 0x107f)
{
pcierr("Pci device id err, id=%d\n", dev->device);
vrterr("Pci device id err, id=%d\n", dev->device);
return -ENODEV;
}
@@ -217,7 +217,7 @@ static int virtio_pci_probe(FAR struct pci_device_s *dev)
ret = virtio_pci_legacy_probe(dev);
if (ret < 0)
{
vrterr("Virtio pci legacy probe failed\n");
vrterr("Virtio pci legacy probe failed %d\n", ret);
goto err_with_enable;
}
}
@@ -421,7 +421,7 @@ int virtio_pci_create_virtqueues(FAR struct virtio_device *vdev,
(wdparm_t)vpdev);
if (ret < 0)
{
pcierr("Wd_start failed: %d\n", ret);
vrterr("Wd_start failed: %d\n", ret);
goto err;
}
#endif