Skip to content

Commit 7dd20bf

Browse files
Marc ZyngierKAGA-KOKO
authored andcommitted
irqchip/gic-v3-its: Use allocation size from the prepare call
Now that .msi_prepare() gets called at the right time and not with semi-random parameters, remove the ugly hack that tried to fix up the number of allocated vectors. It is now correct by construction. Signed-off-by: Marc Zyngier <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 03c2987 commit 7dd20bf

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

drivers/irqchip/irq-gic-v3-its-msi-parent.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,6 @@ static int its_pci_msi_prepare(struct irq_domain *domain, struct device *dev,
6767
/* ITS specific DeviceID, as the core ITS ignores dev. */
6868
info->scratchpad[0].ul = pci_msi_domain_get_msi_rid(domain->parent, pdev);
6969

70-
/*
71-
* @domain->msi_domain_info->hwsize contains the size of the
72-
* MSI[-X] domain, but vector allocation happens one by one. This
73-
* needs some thought when MSI comes into play as the size of MSI
74-
* might be unknown at domain creation time and therefore set to
75-
* MSI_MAX_INDEX.
76-
*/
77-
msi_info = msi_get_domain_info(domain);
78-
if (msi_info->hwsize > nvec)
79-
nvec = msi_info->hwsize;
80-
8170
/*
8271
* Always allocate a power of 2, and special case device 0 for
8372
* broken systems where the DevID is not wired (and all devices
@@ -151,14 +140,6 @@ static int its_pmsi_prepare(struct irq_domain *domain, struct device *dev,
151140
/* ITS specific DeviceID, as the core ITS ignores dev. */
152141
info->scratchpad[0].ul = dev_id;
153142

154-
/*
155-
* @domain->msi_domain_info->hwsize contains the size of the device
156-
* domain, but vector allocation happens one by one.
157-
*/
158-
msi_info = msi_get_domain_info(domain);
159-
if (msi_info->hwsize > nvec)
160-
nvec = msi_info->hwsize;
161-
162143
/* Allocate at least 32 MSIs, and always as a power of 2 */
163144
nvec = max_t(int, 32, roundup_pow_of_two(nvec));
164145

0 commit comments

Comments
 (0)