Skip to content

Commit 81957ac

Browse files
damien-lemoalLorenzo Pieralisi
authored andcommitted
PCI: keystone: Use INTX instead of legacy
In the Keystone controller driver, change all names using "legacy" to use "intx" instead, to match the term used in the PCI specifications. Given that the field legacy_intc_np of struct keystone_pcie is unused, this field is removed instead of being renamed. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Damien Le Moal <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent e9af480 commit 81957ac

File tree

1 file changed

+37
-40
lines changed

1 file changed

+37
-40
lines changed

drivers/pci/controller/dwc/pci-keystone.c

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,15 @@ struct keystone_pcie {
115115
struct dw_pcie *pci;
116116
/* PCI Device ID */
117117
u32 device_id;
118-
int legacy_host_irqs[PCI_NUM_INTX];
119-
struct device_node *legacy_intc_np;
118+
int intx_host_irqs[PCI_NUM_INTX];
120119

121120
int msi_host_irq;
122121
int num_lanes;
123122
u32 num_viewport;
124123
struct phy **phy;
125124
struct device_link **link;
126125
struct device_node *msi_intc_np;
127-
struct irq_domain *legacy_irq_domain;
126+
struct irq_domain *intx_irq_domain;
128127
struct device_node *np;
129128

130129
/* Application register space */
@@ -252,8 +251,8 @@ static int ks_pcie_msi_host_init(struct dw_pcie_rp *pp)
252251
return dw_pcie_allocate_domains(pp);
253252
}
254253

255-
static void ks_pcie_handle_legacy_irq(struct keystone_pcie *ks_pcie,
256-
int offset)
254+
static void ks_pcie_handle_intx_irq(struct keystone_pcie *ks_pcie,
255+
int offset)
257256
{
258257
struct dw_pcie *pci = ks_pcie->pci;
259258
struct device *dev = pci->dev;
@@ -263,7 +262,7 @@ static void ks_pcie_handle_legacy_irq(struct keystone_pcie *ks_pcie,
263262

264263
if (BIT(0) & pending) {
265264
dev_dbg(dev, ": irq: irq_offset %d", offset);
266-
generic_handle_domain_irq(ks_pcie->legacy_irq_domain, offset);
265+
generic_handle_domain_irq(ks_pcie->intx_irq_domain, offset);
267266
}
268267

269268
/* EOI the INTx interrupt */
@@ -307,38 +306,37 @@ static irqreturn_t ks_pcie_handle_error_irq(struct keystone_pcie *ks_pcie)
307306
return IRQ_HANDLED;
308307
}
309308

310-
static void ks_pcie_ack_legacy_irq(struct irq_data *d)
309+
static void ks_pcie_ack_intx_irq(struct irq_data *d)
311310
{
312311
}
313312

314-
static void ks_pcie_mask_legacy_irq(struct irq_data *d)
313+
static void ks_pcie_mask_intx_irq(struct irq_data *d)
315314
{
316315
}
317316

318-
static void ks_pcie_unmask_legacy_irq(struct irq_data *d)
317+
static void ks_pcie_unmask_intx_irq(struct irq_data *d)
319318
{
320319
}
321320

322-
static struct irq_chip ks_pcie_legacy_irq_chip = {
323-
.name = "Keystone-PCI-Legacy-IRQ",
324-
.irq_ack = ks_pcie_ack_legacy_irq,
325-
.irq_mask = ks_pcie_mask_legacy_irq,
326-
.irq_unmask = ks_pcie_unmask_legacy_irq,
321+
static struct irq_chip ks_pcie_intx_irq_chip = {
322+
.name = "Keystone-PCI-INTX-IRQ",
323+
.irq_ack = ks_pcie_ack_intx_irq,
324+
.irq_mask = ks_pcie_mask_intx_irq,
325+
.irq_unmask = ks_pcie_unmask_intx_irq,
327326
};
328327

329-
static int ks_pcie_init_legacy_irq_map(struct irq_domain *d,
330-
unsigned int irq,
331-
irq_hw_number_t hw_irq)
328+
static int ks_pcie_init_intx_irq_map(struct irq_domain *d,
329+
unsigned int irq, irq_hw_number_t hw_irq)
332330
{
333-
irq_set_chip_and_handler(irq, &ks_pcie_legacy_irq_chip,
331+
irq_set_chip_and_handler(irq, &ks_pcie_intx_irq_chip,
334332
handle_level_irq);
335333
irq_set_chip_data(irq, d->host_data);
336334

337335
return 0;
338336
}
339337

340-
static const struct irq_domain_ops ks_pcie_legacy_irq_domain_ops = {
341-
.map = ks_pcie_init_legacy_irq_map,
338+
static const struct irq_domain_ops ks_pcie_intx_irq_domain_ops = {
339+
.map = ks_pcie_init_intx_irq_map,
342340
.xlate = irq_domain_xlate_onetwocell,
343341
};
344342

@@ -605,30 +603,30 @@ static void ks_pcie_msi_irq_handler(struct irq_desc *desc)
605603
}
606604

607605
/**
608-
* ks_pcie_legacy_irq_handler() - Handle legacy interrupt
606+
* ks_pcie_intx_irq_handler() - Handle INTX interrupt
609607
* @desc: Pointer to irq descriptor
610608
*
611-
* Traverse through pending legacy interrupts and invoke handler for each. Also
609+
* Traverse through pending INTX interrupts and invoke handler for each. Also
612610
* takes care of interrupt controller level mask/ack operation.
613611
*/
614-
static void ks_pcie_legacy_irq_handler(struct irq_desc *desc)
612+
static void ks_pcie_intx_irq_handler(struct irq_desc *desc)
615613
{
616614
unsigned int irq = irq_desc_get_irq(desc);
617615
struct keystone_pcie *ks_pcie = irq_desc_get_handler_data(desc);
618616
struct dw_pcie *pci = ks_pcie->pci;
619617
struct device *dev = pci->dev;
620-
u32 irq_offset = irq - ks_pcie->legacy_host_irqs[0];
618+
u32 irq_offset = irq - ks_pcie->intx_host_irqs[0];
621619
struct irq_chip *chip = irq_desc_get_chip(desc);
622620

623-
dev_dbg(dev, ": Handling legacy irq %d\n", irq);
621+
dev_dbg(dev, ": Handling INTX irq %d\n", irq);
624622

625623
/*
626624
* The chained irq handler installation would have replaced normal
627625
* interrupt driver handler so we need to take care of mask/unmask and
628626
* ack operation.
629627
*/
630628
chained_irq_enter(chip, desc);
631-
ks_pcie_handle_legacy_irq(ks_pcie, irq_offset);
629+
ks_pcie_handle_intx_irq(ks_pcie, irq_offset);
632630
chained_irq_exit(chip, desc);
633631
}
634632

@@ -686,18 +684,18 @@ static int ks_pcie_config_msi_irq(struct keystone_pcie *ks_pcie)
686684
return ret;
687685
}
688686

689-
static int ks_pcie_config_legacy_irq(struct keystone_pcie *ks_pcie)
687+
static int ks_pcie_config_intx_irq(struct keystone_pcie *ks_pcie)
690688
{
691689
struct device *dev = ks_pcie->pci->dev;
692-
struct irq_domain *legacy_irq_domain;
690+
struct irq_domain *intx_irq_domain;
693691
struct device_node *np = ks_pcie->np;
694692
struct device_node *intc_np;
695693
int irq_count, irq, ret = 0, i;
696694

697695
intc_np = of_get_child_by_name(np, "legacy-interrupt-controller");
698696
if (!intc_np) {
699697
/*
700-
* Since legacy interrupts are modeled as edge-interrupts in
698+
* Since INTX interrupts are modeled as edge-interrupts in
701699
* AM6, keep it disabled for now.
702700
*/
703701
if (ks_pcie->is_am6)
@@ -719,22 +717,21 @@ static int ks_pcie_config_legacy_irq(struct keystone_pcie *ks_pcie)
719717
ret = -EINVAL;
720718
goto err;
721719
}
722-
ks_pcie->legacy_host_irqs[i] = irq;
720+
ks_pcie->intx_host_irqs[i] = irq;
723721

724722
irq_set_chained_handler_and_data(irq,
725-
ks_pcie_legacy_irq_handler,
723+
ks_pcie_intx_irq_handler,
726724
ks_pcie);
727725
}
728726

729-
legacy_irq_domain =
730-
irq_domain_add_linear(intc_np, PCI_NUM_INTX,
731-
&ks_pcie_legacy_irq_domain_ops, NULL);
732-
if (!legacy_irq_domain) {
733-
dev_err(dev, "Failed to add irq domain for legacy irqs\n");
727+
intx_irq_domain = irq_domain_add_linear(intc_np, PCI_NUM_INTX,
728+
&ks_pcie_intx_irq_domain_ops, NULL);
729+
if (!intx_irq_domain) {
730+
dev_err(dev, "Failed to add irq domain for INTX irqs\n");
734731
ret = -EINVAL;
735732
goto err;
736733
}
737-
ks_pcie->legacy_irq_domain = legacy_irq_domain;
734+
ks_pcie->intx_irq_domain = intx_irq_domain;
738735

739736
for (i = 0; i < PCI_NUM_INTX; i++)
740737
ks_pcie_app_writel(ks_pcie, IRQ_ENABLE_SET(i), INTx_EN);
@@ -808,7 +805,7 @@ static int __init ks_pcie_host_init(struct dw_pcie_rp *pp)
808805
if (!ks_pcie->is_am6)
809806
pp->bridge->child_ops = &ks_child_pcie_ops;
810807

811-
ret = ks_pcie_config_legacy_irq(ks_pcie);
808+
ret = ks_pcie_config_intx_irq(ks_pcie);
812809
if (ret)
813810
return ret;
814811

@@ -881,7 +878,7 @@ static void ks_pcie_am654_ep_init(struct dw_pcie_ep *ep)
881878
dw_pcie_writel_dbi(pci, PCI_BASE_ADDRESS_0, flags);
882879
}
883880

884-
static void ks_pcie_am654_raise_legacy_irq(struct keystone_pcie *ks_pcie)
881+
static void ks_pcie_am654_raise_intx_irq(struct keystone_pcie *ks_pcie)
885882
{
886883
struct dw_pcie *pci = ks_pcie->pci;
887884
u8 int_pin;
@@ -907,7 +904,7 @@ static int ks_pcie_am654_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
907904

908905
switch (type) {
909906
case PCI_IRQ_INTX:
910-
ks_pcie_am654_raise_legacy_irq(ks_pcie);
907+
ks_pcie_am654_raise_intx_irq(ks_pcie);
911908
break;
912909
case PCI_IRQ_MSI:
913910
dw_pcie_ep_raise_msi_irq(ep, func_no, interrupt_num);

0 commit comments

Comments
 (0)