Commit 18b026da authored by Bjorn Helgaas's avatar Bjorn Helgaas

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
parents ec5d85e7 c7a75d07
...@@ -269,9 +269,7 @@ static void xgene_free_domains(struct xgene_msi *msi) ...@@ -269,9 +269,7 @@ static void xgene_free_domains(struct xgene_msi *msi)
static int xgene_msi_init_allocator(struct xgene_msi *xgene_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 = bitmap_zalloc(NR_MSI_VEC, GFP_KERNEL);
xgene_msi->bitmap = kzalloc(size, GFP_KERNEL);
if (!xgene_msi->bitmap) if (!xgene_msi->bitmap)
return -ENOMEM; return -ENOMEM;
...@@ -360,7 +358,7 @@ static int xgene_msi_remove(struct platform_device *pdev) ...@@ -360,7 +358,7 @@ static int xgene_msi_remove(struct platform_device *pdev)
kfree(msi->msi_groups); kfree(msi->msi_groups);
kfree(msi->bitmap); bitmap_free(msi->bitmap);
msi->bitmap = NULL; msi->bitmap = NULL;
xgene_free_domains(msi); xgene_free_domains(msi);
......
...@@ -465,7 +465,7 @@ static int xgene_pcie_select_ib_reg(u8 *ib_reg_mask, u64 size) ...@@ -465,7 +465,7 @@ static int xgene_pcie_select_ib_reg(u8 *ib_reg_mask, u64 size)
return 1; 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); *ib_reg_mask |= (1 << 0);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment