@@ -2015,48 +2015,18 @@ union intcapxt {
2015
2015
};
2016
2016
} __attribute__ ((packed ));
2017
2017
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
- }
2030
2018
2031
2019
static struct irq_chip intcapxt_controller ;
2032
2020
2033
2021
static int intcapxt_irqdomain_activate (struct irq_domain * domain ,
2034
2022
struct irq_data * irqd , bool reserve )
2035
2023
{
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 );
2053
2024
return 0 ;
2054
2025
}
2055
2026
2056
2027
static void intcapxt_irqdomain_deactivate (struct irq_domain * domain ,
2057
2028
struct irq_data * irqd )
2058
2029
{
2059
- intcapxt_mask_irq (irqd );
2060
2030
}
2061
2031
2062
2032
@@ -2090,6 +2060,38 @@ static void intcapxt_irqdomain_free(struct irq_domain *domain, unsigned int virq
2090
2060
irq_domain_free_irqs_top (domain , virq , nr_irqs );
2091
2061
}
2092
2062
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
+
2093
2095
static int intcapxt_set_affinity (struct irq_data * irqd ,
2094
2096
const struct cpumask * mask , bool force )
2095
2097
{
@@ -2099,8 +2101,7 @@ static int intcapxt_set_affinity(struct irq_data *irqd,
2099
2101
ret = parent -> chip -> irq_set_affinity (parent , mask , force );
2100
2102
if (ret < 0 || ret == IRQ_SET_MASK_OK_DONE )
2101
2103
return ret ;
2102
-
2103
- return intcapxt_irqdomain_activate (irqd -> domain , irqd , false);
2104
+ return 0 ;
2104
2105
}
2105
2106
2106
2107
static struct irq_chip intcapxt_controller = {
0 commit comments