[PATCH v2 18/18] virtio: pci: Make use of dm_pci_map_bar()

Felix Yan felixonmars at archlinux.org
Sun Aug 28 19:21:23 CEST 2022


On 8/28/22 19:49, Xiang W wrote:
> Please try my patch and let me know the test results
> 
> diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c
> index 880a12cc28..cfde4007f5 100644
> --- a/drivers/virtio/virtio_pci_modern.c
> +++ b/drivers/virtio/virtio_pci_modern.c
> @@ -466,7 +466,7 @@ static void __iomem *virtio_pci_map_capability(struct udevice *udev,
>          unsigned long mask =
>                          PCI_REGION_TYPE | PCI_REGION_SYS_MEMORY | PCI_REGION_RO;
>          unsigned long flags = PCI_REGION_MEM;
> -       u8 *p = dm_pci_map_bar(udev, PCI_BASE_ADDRESS_0 + cap->bar, cap->offset,
> +       u8 *p = dm_pci_map_bar(udev, PCI_BASE_ADDRESS_0 + 4 * cap->bar, cap->offset,
>                                 cap->length, mask, flags);
>   
>          return (void __iomem *)p;

It fixes the problem for me. Tested on U-Boot master with both mmode and 
smode, also with the original libvirt use case.

Thanks!

-- 
Regards,
Felix Yan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220828/6281c1f8/attachment.sig>


More information about the U-Boot mailing list