Skip to content

Commit 83a458e

Browse files
bjorn-helgaasyilunxu1984
authored andcommitted
fpga: dfl-pci: Drop redundant pci_enable_pcie_error_reporting()
pci_enable_pcie_error_reporting() enables the device to send ERR_* Messages. Since f26e58b ("PCI/AER: Enable error reporting when AER is native"), the PCI core does this for all devices during enumeration, so the driver doesn't need to do it itself. Remove the redundant pci_enable_pcie_error_reporting() call from the driver. Also remove the corresponding pci_disable_pcie_error_reporting() from the driver .remove() path. Note that this only controls ERR_* Messages from the device. An ERR_* Message may cause the Root Port to generate an interrupt, depending on the AER Root Error Command register managed by the AER service driver. Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Xu Yilun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Xu Yilun <[email protected]>
1 parent c3d79fd commit 83a458e

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

drivers/fpga/dfl-pci.c

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <linux/module.h>
2222
#include <linux/stddef.h>
2323
#include <linux/errno.h>
24-
#include <linux/aer.h>
2524

2625
#include "dfl.h"
2726

@@ -376,35 +375,29 @@ int cci_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *pcidevid)
376375
return ret;
377376
}
378377

379-
ret = pci_enable_pcie_error_reporting(pcidev);
380-
if (ret && ret != -EINVAL)
381-
dev_info(&pcidev->dev, "PCIE AER unavailable %d.\n", ret);
382-
383378
pci_set_master(pcidev);
384379

385380
ret = dma_set_mask_and_coherent(&pcidev->dev, DMA_BIT_MASK(64));
386381
if (ret)
387382
ret = dma_set_mask_and_coherent(&pcidev->dev, DMA_BIT_MASK(32));
388383
if (ret) {
389384
dev_err(&pcidev->dev, "No suitable DMA support available.\n");
390-
goto disable_error_report_exit;
385+
return ret;
391386
}
392387

393388
ret = cci_init_drvdata(pcidev);
394389
if (ret) {
395390
dev_err(&pcidev->dev, "Fail to init drvdata %d.\n", ret);
396-
goto disable_error_report_exit;
391+
return ret;
397392
}
398393

399394
ret = cci_enumerate_feature_devs(pcidev);
400-
if (!ret)
395+
if (ret) {
396+
dev_err(&pcidev->dev, "enumeration failure %d.\n", ret);
401397
return ret;
398+
}
402399

403-
dev_err(&pcidev->dev, "enumeration failure %d.\n", ret);
404-
405-
disable_error_report_exit:
406-
pci_disable_pcie_error_reporting(pcidev);
407-
return ret;
400+
return 0;
408401
}
409402

410403
static int cci_pci_sriov_configure(struct pci_dev *pcidev, int num_vfs)
@@ -448,7 +441,6 @@ static void cci_pci_remove(struct pci_dev *pcidev)
448441
cci_pci_sriov_configure(pcidev, 0);
449442

450443
cci_remove_feature_devs(pcidev);
451-
pci_disable_pcie_error_reporting(pcidev);
452444
}
453445

454446
static struct pci_driver cci_pci_driver = {

0 commit comments

Comments
 (0)