Skip to content

Commit ed98286

Browse files
Marc ZyngierMani-Sadhasivam
authored andcommitted
PCI: apple: Dynamically allocate RID-to_SID bitmap
As we move towards supporting SoCs with varying RID-to-SID mapping capabilities, turn the static SID tracking bitmap into a dynamically allocated one. The current allocation size is still the same, but that's about to change. Signed-off-by: Marc Zyngier <[email protected]> Signed-off-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Rob Herring (Arm) <[email protected]> Tested-by: Janne Grunau <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 4785591 commit ed98286

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/pci/controller/pcie-apple.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ struct apple_pcie_port {
147147
void __iomem *base;
148148
struct irq_domain *domain;
149149
struct list_head entry;
150-
DECLARE_BITMAP(sid_map, MAX_RID2SID);
150+
unsigned long *sid_map;
151151
int sid_map_sz;
152152
int idx;
153153
};
@@ -524,6 +524,10 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie,
524524
if (!port)
525525
return -ENOMEM;
526526

527+
port->sid_map = devm_bitmap_zalloc(pcie->dev, MAX_RID2SID, GFP_KERNEL);
528+
if (!port->sid_map)
529+
return -ENOMEM;
530+
527531
ret = of_property_read_u32_index(np, "reg", 0, &idx);
528532
if (ret)
529533
return ret;

0 commit comments

Comments
 (0)