Skip to content

Commit 4daa6a8

Browse files
committed
Merge tag 'irq-urgent-2022-08-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq fixes from Ingo Molnar: "Misc irqchip fixes: LoongArch driver fixes and a Hyper-V IOMMU fix" * tag 'irq-urgent-2022-08-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/loongson-liointc: Fix an error handling path in liointc_init() irqchip/loongarch: Fix irq_domain_alloc_fwnode() abuse irqchip/loongson-pch-pic: Move find_pch_pic() into CONFIG_ACPI irqchip/loongson-eiointc: Fix a build warning irqchip/loongson-eiointc: Fix irq affinity setting iommu/hyper-v: Use helper instead of directly accessing affinity
2 parents 4f61f84 + 57646d6 commit 4daa6a8

File tree

7 files changed

+34
-32
lines changed

7 files changed

+34
-32
lines changed

arch/loongarch/include/asm/irq.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ extern struct acpi_vector_group msi_group[MAX_IO_PICS];
8181
#define GSI_MIN_PCH_IRQ LOONGSON_PCH_IRQ_BASE
8282
#define GSI_MAX_PCH_IRQ (LOONGSON_PCH_IRQ_BASE + 256 - 1)
8383

84-
extern int find_pch_pic(u32 gsi);
8584
struct acpi_madt_lio_pic;
8685
struct acpi_madt_eio_pic;
8786
struct acpi_madt_ht_pic;

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
}

drivers/irqchip/irq-loongarch-cpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static int __init cpuintc_acpi_init(union acpi_subtable_headers *header,
129129
clear_csr_ecfg(ECFG0_IM);
130130
clear_csr_estat(ESTATF_IP);
131131

132-
cpuintc_handle = irq_domain_alloc_fwnode(NULL);
132+
cpuintc_handle = irq_domain_alloc_named_fwnode("CPUINTC");
133133
irq_domain = irq_domain_create_linear(cpuintc_handle, EXCCODE_INT_NUM,
134134
&loongarch_cpu_intc_irq_domain_ops, NULL);
135135

drivers/irqchip/irq-loongson-eiointc.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,15 @@ static int eiointc_set_irq_affinity(struct irq_data *d, const struct cpumask *af
111111
regaddr = EIOINTC_REG_ENABLE + ((vector >> 5) << 2);
112112

113113
/* Mask target vector */
114-
csr_any_send(regaddr, EIOINTC_ALL_ENABLE & (~BIT(vector & 0x1F)), 0x0, 0);
114+
csr_any_send(regaddr, EIOINTC_ALL_ENABLE & (~BIT(vector & 0x1F)),
115+
0x0, priv->node * CORES_PER_EIO_NODE);
116+
115117
/* Set route for target vector */
116118
eiointc_set_irq_route(vector, cpu, priv->node, &priv->node_map);
119+
117120
/* Unmask target vector */
118-
csr_any_send(regaddr, EIOINTC_ALL_ENABLE, 0x0, 0);
121+
csr_any_send(regaddr, EIOINTC_ALL_ENABLE,
122+
0x0, priv->node * CORES_PER_EIO_NODE);
119123

120124
irq_data_update_effective_affinity(d, cpumask_of(cpu));
121125

@@ -286,7 +290,7 @@ static void acpi_set_vec_parent(int node, struct irq_domain *parent, struct acpi
286290
}
287291
}
288292

289-
struct irq_domain *acpi_get_vec_parent(int node, struct acpi_vector_group *vec_group)
293+
static struct irq_domain *acpi_get_vec_parent(int node, struct acpi_vector_group *vec_group)
290294
{
291295
int i;
292296

@@ -344,7 +348,8 @@ int __init eiointc_acpi_init(struct irq_domain *parent,
344348
if (!priv)
345349
return -ENOMEM;
346350

347-
priv->domain_handle = irq_domain_alloc_fwnode((phys_addr_t *)acpi_eiointc);
351+
priv->domain_handle = irq_domain_alloc_named_id_fwnode("EIOPIC",
352+
acpi_eiointc->node);
348353
if (!priv->domain_handle) {
349354
pr_err("Unable to allocate domain handle\n");
350355
goto out_free_priv;

drivers/irqchip/irq-loongson-liointc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static int liointc_init(phys_addr_t addr, unsigned long size, int revision,
207207
"reg-names", core_reg_names[i]);
208208

209209
if (index < 0)
210-
return -EINVAL;
210+
goto out_iounmap;
211211

212212
priv->core_isr[i] = of_iomap(node, index);
213213
}
@@ -360,7 +360,7 @@ int __init liointc_acpi_init(struct irq_domain *parent, struct acpi_madt_lio_pic
360360
parent_irq[0] = irq_create_mapping(parent, acpi_liointc->cascade[0]);
361361
parent_irq[1] = irq_create_mapping(parent, acpi_liointc->cascade[1]);
362362

363-
domain_handle = irq_domain_alloc_fwnode((phys_addr_t *)acpi_liointc);
363+
domain_handle = irq_domain_alloc_fwnode(&acpi_liointc->address);
364364
if (!domain_handle) {
365365
pr_err("Unable to allocate domain handle\n");
366366
return -ENOMEM;

drivers/irqchip/irq-loongson-pch-msi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ int __init pch_msi_acpi_init(struct irq_domain *parent,
282282
int ret;
283283
struct fwnode_handle *domain_handle;
284284

285-
domain_handle = irq_domain_alloc_fwnode((phys_addr_t *)acpi_pchmsi);
285+
domain_handle = irq_domain_alloc_fwnode(&acpi_pchmsi->msg_address);
286286
ret = pch_msi_init(acpi_pchmsi->msg_address, acpi_pchmsi->start,
287287
acpi_pchmsi->count, parent, domain_handle);
288288
if (ret < 0)

drivers/irqchip/irq-loongson-pch-pic.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,6 @@ static struct pch_pic *pch_pic_priv[MAX_IO_PICS];
4848

4949
struct fwnode_handle *pch_pic_handle[MAX_IO_PICS];
5050

51-
int find_pch_pic(u32 gsi)
52-
{
53-
int i;
54-
55-
/* Find the PCH_PIC that manages this GSI. */
56-
for (i = 0; i < MAX_IO_PICS; i++) {
57-
struct pch_pic *priv = pch_pic_priv[i];
58-
59-
if (!priv)
60-
return -1;
61-
62-
if (gsi >= priv->gsi_base && gsi < (priv->gsi_base + priv->vec_count))
63-
return i;
64-
}
65-
66-
pr_err("ERROR: Unable to locate PCH_PIC for GSI %d\n", gsi);
67-
return -1;
68-
}
69-
7051
static void pch_pic_bitset(struct pch_pic *priv, int offset, int bit)
7152
{
7253
u32 reg;
@@ -325,6 +306,25 @@ IRQCHIP_DECLARE(pch_pic, "loongson,pch-pic-1.0", pch_pic_of_init);
325306
#endif
326307

327308
#ifdef CONFIG_ACPI
309+
int find_pch_pic(u32 gsi)
310+
{
311+
int i;
312+
313+
/* Find the PCH_PIC that manages this GSI. */
314+
for (i = 0; i < MAX_IO_PICS; i++) {
315+
struct pch_pic *priv = pch_pic_priv[i];
316+
317+
if (!priv)
318+
return -1;
319+
320+
if (gsi >= priv->gsi_base && gsi < (priv->gsi_base + priv->vec_count))
321+
return i;
322+
}
323+
324+
pr_err("ERROR: Unable to locate PCH_PIC for GSI %d\n", gsi);
325+
return -1;
326+
}
327+
328328
static int __init
329329
pch_lpc_parse_madt(union acpi_subtable_headers *header,
330330
const unsigned long end)
@@ -349,7 +349,7 @@ int __init pch_pic_acpi_init(struct irq_domain *parent,
349349

350350
vec_base = acpi_pchpic->gsi_base - GSI_MIN_PCH_IRQ;
351351

352-
domain_handle = irq_domain_alloc_fwnode((phys_addr_t *)acpi_pchpic);
352+
domain_handle = irq_domain_alloc_fwnode(&acpi_pchpic->address);
353353
if (!domain_handle) {
354354
pr_err("Unable to allocate domain handle\n");
355355
return -ENOMEM;

0 commit comments

Comments
 (0)