Skip to content

Commit f26502c

Browse files
committed
Merge branch 'pci/endpoint'
- Check for errors returned from pci_epc_get(), which returns IS_ERR(), not NULL on error (Dan Carpenter) - Fix pci_endpoint_test_ioctl() array underflow (Dan Carpenter) - Document sysfs interface for BAR assignment of vNTB endpoint functions (Jerome Brunet) - Drop superfluous pci_epc_features initialization for unsupported features; we only have to mention features that *are* supported (Niklas Cassel) - Skip IRQ tests if the IRQ is out of range (Christian Bruel) - Fix pci-epf-test for controllers with fixed-size BARs smaller than requested by the test (Marek Vasut) - Restore inbound translation when disabling doorbell so the doorbell test case can be run more than once (Niklas Cassel) - Check for NULL before releasing DMA channels to avoid a NULL pointer dereference (Shin'ichiro Kawasaki) - Convert tegra194 interrupt number to MSI vector to fix endpoint Kselftest MSI_TEST test case (Niklas Cassel) - Set tegra_pcie_epc_features.msi_capable so the pci_endpoint_test can use the optimal IRQ type (Niklas Cassel) - Reset tegra194 BARs when running in endpoint mode so the BAR tests don't overwrite the ATU settings in BAR4 (Niklas Cassel) - Handle errors in tegra194 BPMP transactions so we don't mistakenly skip future PERST# assertion (Vidya Sagar) * pci/endpoint: PCI: tegra194: Handle errors in BPMP response PCI: tegra194: Reset BARs when running in PCIe endpoint mode PCI: tegra194: Set pci_epc_features::msi_capable to true PCI: tegra194: Fix broken tegra_pcie_ep_raise_msi_irq() PCI: endpoint: pci-epf-test: Add NULL check for DMA channels before release PCI: endpoint: pci-epf-test: Fix doorbell test support PCI: endpoint: pci-epf-test: Limit PCIe BAR size for fixed BARs selftests: pci_endpoint: Skip IRQ test if IRQ is out of range. misc: pci_endpoint_test: Cleanup extra 0 initialization misc: pci_endpoint_test: Skip IRQ tests if irq is out of range PCI: endpoint: Drop superfluous pci_epc_features initialization Documentation: PCI: endpoint: Document BAR assignment misc: pci_endpoint_test: Fix array underflow in pci_endpoint_test_ioctl() PCI: endpoint: pci-ep-msi: Fix NULL vs IS_ERR() check in pci_epf_write_msi_msg()
2 parents 9440106 + f8c9ad4 commit f26502c

File tree

18 files changed

+78
-46
lines changed

18 files changed

+78
-46
lines changed

Documentation/PCI/endpoint/pci-vntb-howto.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ of the function device and is populated with the following NTB specific
9090
attributes that can be configured by the user::
9191

9292
# ls functions/pci_epf_vntb/func1/pci_epf_vntb.0/
93-
db_count mw1 mw2 mw3 mw4 num_mws
94-
spad_count
93+
ctrl_bar db_count mw1_bar mw2_bar mw3_bar mw4_bar spad_count
94+
db_bar mw1 mw2 mw3 mw4 num_mws vbus_number
95+
vntb_vid vntb_pid
9596

9697
A sample configuration for NTB function is given below::
9798

@@ -100,6 +101,10 @@ A sample configuration for NTB function is given below::
100101
# echo 1 > functions/pci_epf_vntb/func1/pci_epf_vntb.0/num_mws
101102
# echo 0x100000 > functions/pci_epf_vntb/func1/pci_epf_vntb.0/mw1
102103

104+
By default, each construct is assigned a BAR, as needed and in order.
105+
Should a specific BAR setup be required by the platform, BAR may be assigned
106+
to each construct using the related ``XYZ_bar`` entry.
107+
103108
A sample configuration for virtual NTB driver for virtual PCI bus::
104109

105110
# echo 0x1957 > functions/pci_epf_vntb/func1/pci_epf_vntb.0/vntb_vid

drivers/misc/pci_endpoint_test.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,11 @@ static int pci_endpoint_test_msi_irq(struct pci_endpoint_test *test,
436436
{
437437
struct pci_dev *pdev = test->pdev;
438438
u32 val;
439-
int ret;
439+
int irq;
440+
441+
irq = pci_irq_vector(pdev, msi_num - 1);
442+
if (irq < 0)
443+
return irq;
440444

441445
pci_endpoint_test_writel(test, PCI_ENDPOINT_TEST_IRQ_TYPE,
442446
msix ? PCITEST_IRQ_TYPE_MSIX :
@@ -450,11 +454,7 @@ static int pci_endpoint_test_msi_irq(struct pci_endpoint_test *test,
450454
if (!val)
451455
return -ETIMEDOUT;
452456

453-
ret = pci_irq_vector(pdev, msi_num - 1);
454-
if (ret < 0)
455-
return ret;
456-
457-
if (ret != test->last_irq)
457+
if (irq != test->last_irq)
458458
return -EIO;
459459

460460
return 0;
@@ -937,7 +937,7 @@ static long pci_endpoint_test_ioctl(struct file *file, unsigned int cmd,
937937
switch (cmd) {
938938
case PCITEST_BAR:
939939
bar = arg;
940-
if (bar > BAR_5)
940+
if (bar <= NO_BAR || bar > BAR_5)
941941
goto ret;
942942
if (is_am654_pci_dev(pdev) && bar == BAR_0)
943943
goto ret;
@@ -1020,8 +1020,6 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev,
10201020
if (!test)
10211021
return -ENOMEM;
10221022

1023-
test->test_reg_bar = 0;
1024-
test->alignment = 0;
10251023
test->pdev = pdev;
10261024
test->irq_type = PCITEST_IRQ_TYPE_UNDEFINED;
10271025

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,14 +614,12 @@ static int cdns_pcie_ep_start(struct pci_epc *epc)
614614
}
615615

616616
static const struct pci_epc_features cdns_pcie_epc_vf_features = {
617-
.linkup_notifier = false,
618617
.msi_capable = true,
619618
.msix_capable = true,
620619
.align = 65536,
621620
};
622621

623622
static const struct pci_epc_features cdns_pcie_epc_features = {
624-
.linkup_notifier = false,
625623
.msi_capable = true,
626624
.msix_capable = true,
627625
.align = 256,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,6 @@ static int dra7xx_pcie_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
426426
static const struct pci_epc_features dra7xx_pcie_epc_features = {
427427
.linkup_notifier = true,
428428
.msi_capable = true,
429-
.msix_capable = false,
430429
};
431430

432431
static const struct pci_epc_features*

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,9 +1387,7 @@ static int imx_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
13871387
}
13881388

13891389
static const struct pci_epc_features imx8m_pcie_epc_features = {
1390-
.linkup_notifier = false,
13911390
.msi_capable = true,
1392-
.msix_capable = false,
13931391
.bar[BAR_1] = { .type = BAR_RESERVED, },
13941392
.bar[BAR_3] = { .type = BAR_RESERVED, },
13951393
.bar[BAR_4] = { .type = BAR_FIXED, .fixed_size = SZ_256, },
@@ -1398,9 +1396,7 @@ static const struct pci_epc_features imx8m_pcie_epc_features = {
13981396
};
13991397

14001398
static const struct pci_epc_features imx8q_pcie_epc_features = {
1401-
.linkup_notifier = false,
14021399
.msi_capable = true,
1403-
.msix_capable = false,
14041400
.bar[BAR_1] = { .type = BAR_RESERVED, },
14051401
.bar[BAR_3] = { .type = BAR_RESERVED, },
14061402
.bar[BAR_5] = { .type = BAR_RESERVED, },

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,6 @@ static int ks_pcie_am654_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
960960
}
961961

962962
static const struct pci_epc_features ks_pcie_am654_epc_features = {
963-
.linkup_notifier = false,
964963
.msi_capable = true,
965964
.msix_capable = true,
966965
.bar[BAR_0] = { .type = BAR_RESERVED, },

drivers/pci/controller/dwc/pcie-artpec6.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,7 @@ static int artpec6_pcie_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
370370
}
371371

372372
static const struct pci_epc_features artpec6_pcie_epc_features = {
373-
.linkup_notifier = false,
374373
.msi_capable = true,
375-
.msix_capable = false,
376374
};
377375

378376
static const struct pci_epc_features *

drivers/pci/controller/dwc/pcie-designware-plat.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ static int dw_plat_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
6161
}
6262

6363
static const struct pci_epc_features dw_plat_pcie_epc_features = {
64-
.linkup_notifier = false,
6564
.msi_capable = true,
6665
.msix_capable = true,
6766
};

drivers/pci/controller/dwc/pcie-dw-rockchip.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@ static const struct pci_epc_features rockchip_pcie_epc_features_rk3568 = {
325325
.linkup_notifier = true,
326326
.msi_capable = true,
327327
.msix_capable = true,
328-
.intx_capable = false,
329328
.align = SZ_64K,
330329
.bar[BAR_0] = { .type = BAR_RESIZABLE, },
331330
.bar[BAR_1] = { .type = BAR_RESIZABLE, },
@@ -346,7 +345,6 @@ static const struct pci_epc_features rockchip_pcie_epc_features_rk3588 = {
346345
.linkup_notifier = true,
347346
.msi_capable = true,
348347
.msix_capable = true,
349-
.intx_capable = false,
350348
.align = SZ_64K,
351349
.bar[BAR_0] = { .type = BAR_RESIZABLE, },
352350
.bar[BAR_1] = { .type = BAR_RESIZABLE, },

drivers/pci/controller/dwc/pcie-keembay.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ static int keembay_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
309309
}
310310

311311
static const struct pci_epc_features keembay_pcie_epc_features = {
312-
.linkup_notifier = false,
313312
.msi_capable = true,
314313
.msix_capable = true,
315314
.bar[BAR_0] = { .only_64bit = true, },

0 commit comments

Comments
 (0)