Skip to content

Commit b0a4ab7

Browse files
kelleymhMarc Zyngier
authored andcommitted
iommu/hyper-v: Use helper instead of directly accessing affinity
Recent changes to solve inconsistencies in handling IRQ masks #ifdef out the affinity field in irq_common_data for non-SMP configurations. The current code in hyperv_irq_remapping_alloc() gets a compiler error in that case. Fix this by using the new irq_data_update_affinity() helper, which handles the non-SMP case correctly. Signed-off-by: Michael Kelley <mikelley@microsoft.com> Reported-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Marc Zyngier <maz@kernel.org> Fixes: aa08135 ("genirq: Provide an IRQ affinity mask in non-SMP configs") Link: https://lore.kernel.org/r/1658796820-2261-1-git-send-email-mikelley@microsoft.com
1 parent 2bd1753 commit b0a4ab7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/iommu/hyperv-iommu.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ static int hyperv_irq_remapping_alloc(struct irq_domain *domain,
6868
{
6969
struct irq_alloc_info *info = arg;
7070
struct irq_data *irq_data;
71-
struct irq_desc *desc;
7271
int ret = 0;
7372

7473
if (!info || info->type != X86_IRQ_ALLOC_TYPE_IOAPIC || nr_irqs > 1)
@@ -90,8 +89,7 @@ static int hyperv_irq_remapping_alloc(struct irq_domain *domain,
9089
* Hypver-V IO APIC irq affinity should be in the scope of
9190
* ioapic_max_cpumask because no irq remapping support.
9291
*/
93-
desc = irq_data_to_desc(irq_data);
94-
cpumask_copy(desc->irq_common_data.affinity, &ioapic_max_cpumask);
92+
irq_data_update_affinity(irq_data, &ioapic_max_cpumask);
9593

9694
return 0;
9795
}

0 commit comments

Comments
 (0)