@@ -2015,48 +2015,18 @@ union intcapxt {
20152015 };
20162016} __attribute__ ((packed ));
20172017
2018- /*
2019- * There isn't really any need to mask/unmask at the irqchip level because
2020- * the 64-bit INTCAPXT registers can be updated atomically without tearing
2021- * when the affinity is being updated.
2022- */
2023- static void intcapxt_unmask_irq (struct irq_data * data )
2024- {
2025- }
2026-
2027- static void intcapxt_mask_irq (struct irq_data * data )
2028- {
2029- }
20302018
20312019static struct irq_chip intcapxt_controller ;
20322020
20332021static int intcapxt_irqdomain_activate (struct irq_domain * domain ,
20342022 struct irq_data * irqd , bool reserve )
20352023{
2036- struct amd_iommu * iommu = irqd -> chip_data ;
2037- struct irq_cfg * cfg = irqd_cfg (irqd );
2038- union intcapxt xt ;
2039-
2040- xt .capxt = 0ULL ;
2041- xt .dest_mode_logical = apic -> dest_mode_logical ;
2042- xt .vector = cfg -> vector ;
2043- xt .destid_0_23 = cfg -> dest_apicid & GENMASK (23 , 0 );
2044- xt .destid_24_31 = cfg -> dest_apicid >> 24 ;
2045-
2046- /**
2047- * Current IOMMU implemtation uses the same IRQ for all
2048- * 3 IOMMU interrupts.
2049- */
2050- writeq (xt .capxt , iommu -> mmio_base + MMIO_INTCAPXT_EVT_OFFSET );
2051- writeq (xt .capxt , iommu -> mmio_base + MMIO_INTCAPXT_PPR_OFFSET );
2052- writeq (xt .capxt , iommu -> mmio_base + MMIO_INTCAPXT_GALOG_OFFSET );
20532024 return 0 ;
20542025}
20552026
20562027static void intcapxt_irqdomain_deactivate (struct irq_domain * domain ,
20572028 struct irq_data * irqd )
20582029{
2059- intcapxt_mask_irq (irqd );
20602030}
20612031
20622032
@@ -2090,6 +2060,38 @@ static void intcapxt_irqdomain_free(struct irq_domain *domain, unsigned int virq
20902060 irq_domain_free_irqs_top (domain , virq , nr_irqs );
20912061}
20922062
2063+
2064+ static void intcapxt_unmask_irq (struct irq_data * irqd )
2065+ {
2066+ struct amd_iommu * iommu = irqd -> chip_data ;
2067+ struct irq_cfg * cfg = irqd_cfg (irqd );
2068+ union intcapxt xt ;
2069+
2070+ xt .capxt = 0ULL ;
2071+ xt .dest_mode_logical = apic -> dest_mode_logical ;
2072+ xt .vector = cfg -> vector ;
2073+ xt .destid_0_23 = cfg -> dest_apicid & GENMASK (23 , 0 );
2074+ xt .destid_24_31 = cfg -> dest_apicid >> 24 ;
2075+
2076+ /**
2077+ * Current IOMMU implementation uses the same IRQ for all
2078+ * 3 IOMMU interrupts.
2079+ */
2080+ writeq (xt .capxt , iommu -> mmio_base + MMIO_INTCAPXT_EVT_OFFSET );
2081+ writeq (xt .capxt , iommu -> mmio_base + MMIO_INTCAPXT_PPR_OFFSET );
2082+ writeq (xt .capxt , iommu -> mmio_base + MMIO_INTCAPXT_GALOG_OFFSET );
2083+ }
2084+
2085+ static void intcapxt_mask_irq (struct irq_data * irqd )
2086+ {
2087+ struct amd_iommu * iommu = irqd -> chip_data ;
2088+
2089+ writeq (0 , iommu -> mmio_base + MMIO_INTCAPXT_EVT_OFFSET );
2090+ writeq (0 , iommu -> mmio_base + MMIO_INTCAPXT_PPR_OFFSET );
2091+ writeq (0 , iommu -> mmio_base + MMIO_INTCAPXT_GALOG_OFFSET );
2092+ }
2093+
2094+
20932095static int intcapxt_set_affinity (struct irq_data * irqd ,
20942096 const struct cpumask * mask , bool force )
20952097{
@@ -2099,8 +2101,7 @@ static int intcapxt_set_affinity(struct irq_data *irqd,
20992101 ret = parent -> chip -> irq_set_affinity (parent , mask , force );
21002102 if (ret < 0 || ret == IRQ_SET_MASK_OK_DONE )
21012103 return ret ;
2102-
2103- return intcapxt_irqdomain_activate (irqd -> domain , irqd , false);
2104+ return 0 ;
21042105}
21052106
21062107static struct irq_chip intcapxt_controller = {
0 commit comments