Skip to content

Commit dc14155

Browse files
committed
Merge branch 'pci/irq-clean-up'
- Rename PCI_IRQ_LEGACY to PCI_IRQ_INTX to be more explicit and match spec terminology (Bjorn Helgaas) - Use existing PCI_IRQ_INTX, PCI_IRQ_MSI, PCI_IRQ_MSIX in artpec6, cadence, designware, designware-plat, dra7xx, imx6, keembay, keystone, layerscape, mhi, ntb, qcom, rcar, rcar-gen4, rockchip, tegra194, uniphier, vntb; drop the redundant pci_epc_irq_type enum with the same values (Damien Le Moal) - Use "intx" instead of "leg" or "legacy" when describing INTx interrupts in endpoint core, endpoint tests, cadence, dra7xx, designware, dw-rockchip, dwc core, imx6, keystone, layerscape, qcom, rcar-gen4, rockchip, tegra194, uniphier, xilinx-nwl (Damien Le Moal) * pci/irq-clean-up: PCI: xilinx-nwl: Use INTX instead of legacy PCI: rockchip-host: Rename rockchip_pcie_legacy_int_handler() PCI: rockchip-ep: Use INTX instead of legacy PCI: uniphier: Use INTX instead of legacy PCI: tegra194: Use INTX instead of legacy PCI: dw-rockchip: Rename rockchip_pcie_legacy_int_handler() PCI: keystone: Use INTX instead of legacy PCI: dwc: Rename dw_pcie_ep_raise_legacy_irq() PCI: cadence: Use INTX instead of legacy PCI: dra7xx: Rename dra7xx_pcie_raise_legacy_irq() misc: pci_endpoint_test: Use INTX instead of LEGACY PCI: endpoint: Rename LEGACY to INTX in test function driver PCI: endpoint: Use INTX instead of legacy PCI: endpoint: Drop PCI_EPC_IRQ_XXX definitions PCI: Rename PCI_IRQ_LEGACY to PCI_IRQ_INTX
2 parents eb30ad4 + 354b2bd commit dc14155

30 files changed

+202
-222
lines changed

drivers/misc/pci_endpoint_test.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
#define DRV_MODULE_NAME "pci-endpoint-test"
2929

3030
#define IRQ_TYPE_UNDEFINED -1
31-
#define IRQ_TYPE_LEGACY 0
31+
#define IRQ_TYPE_INTX 0
3232
#define IRQ_TYPE_MSI 1
3333
#define IRQ_TYPE_MSIX 2
3434

3535
#define PCI_ENDPOINT_TEST_MAGIC 0x0
3636

3737
#define PCI_ENDPOINT_TEST_COMMAND 0x4
38-
#define COMMAND_RAISE_LEGACY_IRQ BIT(0)
38+
#define COMMAND_RAISE_INTX_IRQ BIT(0)
3939
#define COMMAND_RAISE_MSI_IRQ BIT(1)
4040
#define COMMAND_RAISE_MSIX_IRQ BIT(2)
4141
#define COMMAND_READ BIT(3)
@@ -183,8 +183,8 @@ static bool pci_endpoint_test_alloc_irq_vectors(struct pci_endpoint_test *test,
183183
bool res = true;
184184

185185
switch (type) {
186-
case IRQ_TYPE_LEGACY:
187-
irq = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_LEGACY);
186+
case IRQ_TYPE_INTX:
187+
irq = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_INTX);
188188
if (irq < 0)
189189
dev_err(dev, "Failed to get Legacy interrupt\n");
190190
break;
@@ -244,7 +244,7 @@ static bool pci_endpoint_test_request_irq(struct pci_endpoint_test *test)
244244

245245
fail:
246246
switch (irq_type) {
247-
case IRQ_TYPE_LEGACY:
247+
case IRQ_TYPE_INTX:
248248
dev_err(dev, "Failed to request IRQ %d for Legacy\n",
249249
pci_irq_vector(pdev, i));
250250
break;
@@ -291,15 +291,15 @@ static bool pci_endpoint_test_bar(struct pci_endpoint_test *test,
291291
return true;
292292
}
293293

294-
static bool pci_endpoint_test_legacy_irq(struct pci_endpoint_test *test)
294+
static bool pci_endpoint_test_intx_irq(struct pci_endpoint_test *test)
295295
{
296296
u32 val;
297297

298298
pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_IRQ_TYPE,
299-
IRQ_TYPE_LEGACY);
299+
IRQ_TYPE_INTX);
300300
pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_IRQ_NUMBER, 0);
301301
pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_COMMAND,
302-
COMMAND_RAISE_LEGACY_IRQ);
302+
COMMAND_RAISE_INTX_IRQ);
303303
val = wait_for_completion_timeout(&test->irq_raised,
304304
msecs_to_jiffies(1000));
305305
if (!val)
@@ -385,7 +385,7 @@ static bool pci_endpoint_test_copy(struct pci_endpoint_test *test,
385385
if (use_dma)
386386
flags |= FLAG_USE_DMA;
387387

388-
if (irq_type < IRQ_TYPE_LEGACY || irq_type > IRQ_TYPE_MSIX) {
388+
if (irq_type < IRQ_TYPE_INTX || irq_type > IRQ_TYPE_MSIX) {
389389
dev_err(dev, "Invalid IRQ type option\n");
390390
goto err;
391391
}
@@ -521,7 +521,7 @@ static bool pci_endpoint_test_write(struct pci_endpoint_test *test,
521521
if (use_dma)
522522
flags |= FLAG_USE_DMA;
523523

524-
if (irq_type < IRQ_TYPE_LEGACY || irq_type > IRQ_TYPE_MSIX) {
524+
if (irq_type < IRQ_TYPE_INTX || irq_type > IRQ_TYPE_MSIX) {
525525
dev_err(dev, "Invalid IRQ type option\n");
526526
goto err;
527527
}
@@ -621,7 +621,7 @@ static bool pci_endpoint_test_read(struct pci_endpoint_test *test,
621621
if (use_dma)
622622
flags |= FLAG_USE_DMA;
623623

624-
if (irq_type < IRQ_TYPE_LEGACY || irq_type > IRQ_TYPE_MSIX) {
624+
if (irq_type < IRQ_TYPE_INTX || irq_type > IRQ_TYPE_MSIX) {
625625
dev_err(dev, "Invalid IRQ type option\n");
626626
goto err;
627627
}
@@ -691,7 +691,7 @@ static bool pci_endpoint_test_set_irq(struct pci_endpoint_test *test,
691691
struct pci_dev *pdev = test->pdev;
692692
struct device *dev = &pdev->dev;
693693

694-
if (req_irq_type < IRQ_TYPE_LEGACY || req_irq_type > IRQ_TYPE_MSIX) {
694+
if (req_irq_type < IRQ_TYPE_INTX || req_irq_type > IRQ_TYPE_MSIX) {
695695
dev_err(dev, "Invalid IRQ type option\n");
696696
return false;
697697
}
@@ -737,8 +737,8 @@ static long pci_endpoint_test_ioctl(struct file *file, unsigned int cmd,
737737
goto ret;
738738
ret = pci_endpoint_test_bar(test, bar);
739739
break;
740-
case PCITEST_LEGACY_IRQ:
741-
ret = pci_endpoint_test_legacy_irq(test);
740+
case PCITEST_INTX_IRQ:
741+
ret = pci_endpoint_test_intx_irq(test);
742742
break;
743743
case PCITEST_MSI:
744744
case PCITEST_MSIX:
@@ -801,7 +801,7 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev,
801801
test->irq_type = IRQ_TYPE_UNDEFINED;
802802

803803
if (no_msi)
804-
irq_type = IRQ_TYPE_LEGACY;
804+
irq_type = IRQ_TYPE_INTX;
805805

806806
data = (struct pci_endpoint_test_data *)ent->driver_data;
807807
if (data) {

drivers/pci/controller/cadence/pcie-cadence-ep.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,8 @@ static void cdns_pcie_ep_assert_intx(struct cdns_pcie_ep *ep, u8 fn, u8 intx,
360360
writel(0, ep->irq_cpu_addr + offset);
361361
}
362362

363-
static int cdns_pcie_ep_send_legacy_irq(struct cdns_pcie_ep *ep, u8 fn, u8 vfn,
364-
u8 intx)
363+
static int cdns_pcie_ep_send_intx_irq(struct cdns_pcie_ep *ep, u8 fn, u8 vfn,
364+
u8 intx)
365365
{
366366
u16 cmd;
367367

@@ -371,7 +371,7 @@ static int cdns_pcie_ep_send_legacy_irq(struct cdns_pcie_ep *ep, u8 fn, u8 vfn,
371371

372372
cdns_pcie_ep_assert_intx(ep, fn, intx, true);
373373
/*
374-
* The mdelay() value was taken from dra7xx_pcie_raise_legacy_irq()
374+
* The mdelay() value was taken from dra7xx_pcie_raise_intx_irq()
375375
*/
376376
mdelay(1);
377377
cdns_pcie_ep_assert_intx(ep, fn, intx, false);
@@ -532,25 +532,24 @@ static int cdns_pcie_ep_send_msix_irq(struct cdns_pcie_ep *ep, u8 fn, u8 vfn,
532532
}
533533

534534
static int cdns_pcie_ep_raise_irq(struct pci_epc *epc, u8 fn, u8 vfn,
535-
enum pci_epc_irq_type type,
536-
u16 interrupt_num)
535+
unsigned int type, u16 interrupt_num)
537536
{
538537
struct cdns_pcie_ep *ep = epc_get_drvdata(epc);
539538
struct cdns_pcie *pcie = &ep->pcie;
540539
struct device *dev = pcie->dev;
541540

542541
switch (type) {
543-
case PCI_EPC_IRQ_LEGACY:
542+
case PCI_IRQ_INTX:
544543
if (vfn > 0) {
545-
dev_err(dev, "Cannot raise legacy interrupts for VF\n");
544+
dev_err(dev, "Cannot raise INTX interrupts for VF\n");
546545
return -EINVAL;
547546
}
548-
return cdns_pcie_ep_send_legacy_irq(ep, fn, vfn, 0);
547+
return cdns_pcie_ep_send_intx_irq(ep, fn, vfn, 0);
549548

550-
case PCI_EPC_IRQ_MSI:
549+
case PCI_IRQ_MSI:
551550
return cdns_pcie_ep_send_msi_irq(ep, fn, vfn, interrupt_num);
552551

553-
case PCI_EPC_IRQ_MSIX:
552+
case PCI_IRQ_MSIX:
554553
return cdns_pcie_ep_send_msix_irq(ep, fn, vfn, interrupt_num);
555554

556555
default:

drivers/pci/controller/cadence/pcie-cadence.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,16 +347,16 @@ struct cdns_pcie_epf {
347347
* @max_regions: maximum number of regions supported by hardware
348348
* @ob_region_map: bitmask of mapped outbound regions
349349
* @ob_addr: base addresses in the AXI bus where the outbound regions start
350-
* @irq_phys_addr: base address on the AXI bus where the MSI/legacy IRQ
350+
* @irq_phys_addr: base address on the AXI bus where the MSI/INTX IRQ
351351
* dedicated outbound regions is mapped.
352352
* @irq_cpu_addr: base address in the CPU space where a write access triggers
353-
* the sending of a memory write (MSI) / normal message (legacy
353+
* the sending of a memory write (MSI) / normal message (INTX
354354
* IRQ) TLP through the PCIe bus.
355-
* @irq_pci_addr: used to save the current mapping of the MSI/legacy IRQ
355+
* @irq_pci_addr: used to save the current mapping of the MSI/INTX IRQ
356356
* dedicated outbound region.
357357
* @irq_pci_fn: the latest PCI function that has updated the mapping of
358-
* the MSI/legacy IRQ dedicated outbound region.
359-
* @irq_pending: bitmask of asserted legacy IRQs.
358+
* the MSI/INTX IRQ dedicated outbound region.
359+
* @irq_pending: bitmask of asserted INTX IRQs.
360360
* @lock: spin lock to disable interrupts while modifying PCIe controller
361361
* registers fields (RMW) accessible by both remote RC and EP to
362362
* minimize time between read and write
@@ -374,7 +374,7 @@ struct cdns_pcie_ep {
374374
u64 irq_pci_addr;
375375
u8 irq_pci_fn;
376376
u8 irq_pending;
377-
/* protect writing to PCI_STATUS while raising legacy interrupts */
377+
/* protect writing to PCI_STATUS while raising INTX interrupts */
378378
spinlock_t lock;
379379
struct cdns_pcie_epf *epf;
380380
unsigned int quirk_detect_quiet_flag:1;

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ static void dra7xx_pcie_ep_init(struct dw_pcie_ep *ep)
386386
dra7xx_pcie_enable_wrapper_interrupts(dra7xx);
387387
}
388388

389-
static void dra7xx_pcie_raise_legacy_irq(struct dra7xx_pcie *dra7xx)
389+
static void dra7xx_pcie_raise_intx_irq(struct dra7xx_pcie *dra7xx)
390390
{
391391
dra7xx_pcie_writel(dra7xx, PCIECTRL_TI_CONF_INTX_ASSERT, 0x1);
392392
mdelay(1);
@@ -404,16 +404,16 @@ static void dra7xx_pcie_raise_msi_irq(struct dra7xx_pcie *dra7xx,
404404
}
405405

406406
static int dra7xx_pcie_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
407-
enum pci_epc_irq_type type, u16 interrupt_num)
407+
unsigned int type, u16 interrupt_num)
408408
{
409409
struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
410410
struct dra7xx_pcie *dra7xx = to_dra7xx_pcie(pci);
411411

412412
switch (type) {
413-
case PCI_EPC_IRQ_LEGACY:
414-
dra7xx_pcie_raise_legacy_irq(dra7xx);
413+
case PCI_IRQ_INTX:
414+
dra7xx_pcie_raise_intx_irq(dra7xx);
415415
break;
416-
case PCI_EPC_IRQ_MSI:
416+
case PCI_IRQ_MSI:
417417
dra7xx_pcie_raise_msi_irq(dra7xx, interrupt_num);
418418
break;
419419
default:

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,17 +1058,16 @@ static void imx6_pcie_ep_init(struct dw_pcie_ep *ep)
10581058
}
10591059

10601060
static int imx6_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
1061-
enum pci_epc_irq_type type,
1062-
u16 interrupt_num)
1061+
unsigned int type, u16 interrupt_num)
10631062
{
10641063
struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
10651064

10661065
switch (type) {
1067-
case PCI_EPC_IRQ_LEGACY:
1068-
return dw_pcie_ep_raise_legacy_irq(ep, func_no);
1069-
case PCI_EPC_IRQ_MSI:
1066+
case PCI_IRQ_INTX:
1067+
return dw_pcie_ep_raise_intx_irq(ep, func_no);
1068+
case PCI_IRQ_MSI:
10701069
return dw_pcie_ep_raise_msi_irq(ep, func_no, interrupt_num);
1071-
case PCI_EPC_IRQ_MSIX:
1070+
case PCI_IRQ_MSIX:
10721071
return dw_pcie_ep_raise_msix_irq(ep, func_no, interrupt_num);
10731072
default:
10741073
dev_err(pci->dev, "UNKNOWN IRQ type\n");

0 commit comments

Comments
 (0)