diff options
author | 2022-01-13 09:57:51 -0600 | |
---|---|---|
committer | 2022-01-13 09:57:51 -0600 | |
commit | 18b026da34c6b4b01742572d334d17919d6b5bc0 (patch) | |
tree | ba16850769c690946e672f4658e92405261e890c | |
parent | Merge branch 'remotes/lorenzo/pci/vmd' (diff) | |
parent | PCI: xgene: Fix IB window setup (diff) | |
download | wireguard-linux-18b026da34c6b4b01742572d334d17919d6b5bc0.tar.xz wireguard-linux-18b026da34c6b4b01742572d334d17919d6b5bc0.zip |
Merge branch 'remotes/lorenzo/pci/xgene'
- Use bitmap ops for MSI allocator (Christophe JAILLET)
- Fix IB window setup, which was broken by the fact that IB resources are
now sorted in address order instead of DT dma-ranges order (Rob Herring)
* remotes/lorenzo/pci/xgene:
PCI: xgene: Fix IB window setup
PCI: xgene-msi: Use bitmap_zalloc() when applicable
-rw-r--r-- | drivers/pci/controller/pci-xgene-msi.c | 6 | ||||
-rw-r--r-- | drivers/pci/controller/pci-xgene.c | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/drivers/pci/controller/pci-xgene-msi.c b/drivers/pci/controller/pci-xgene-msi.c index c50ff279903c..bfa259781b69 100644 --- a/drivers/pci/controller/pci-xgene-msi.c +++ b/drivers/pci/controller/pci-xgene-msi.c @@ -269,9 +269,7 @@ static void xgene_free_domains(struct xgene_msi *msi) static int xgene_msi_init_allocator(struct xgene_msi *xgene_msi) { - int size = BITS_TO_LONGS(NR_MSI_VEC) * sizeof(long); - - xgene_msi->bitmap = kzalloc(size, GFP_KERNEL); + xgene_msi->bitmap = bitmap_zalloc(NR_MSI_VEC, GFP_KERNEL); if (!xgene_msi->bitmap) return -ENOMEM; @@ -360,7 +358,7 @@ static int xgene_msi_remove(struct platform_device *pdev) kfree(msi->msi_groups); - kfree(msi->bitmap); + bitmap_free(msi->bitmap); msi->bitmap = NULL; xgene_free_domains(msi); diff --git a/drivers/pci/controller/pci-xgene.c b/drivers/pci/controller/pci-xgene.c index 56d0d50338c8..d83dbd977418 100644 --- a/drivers/pci/controller/pci-xgene.c +++ b/drivers/pci/controller/pci-xgene.c @@ -465,7 +465,7 @@ static int xgene_pcie_select_ib_reg(u8 *ib_reg_mask, u64 size) return 1; } - if ((size > SZ_1K) && (size < SZ_1T) && !(*ib_reg_mask & (1 << 0))) { + if ((size > SZ_1K) && (size < SZ_4G) && !(*ib_reg_mask & (1 << 0))) { *ib_reg_mask |= (1 << 0); return 0; } |