* [PATCH] fpga: dfl-pci: Drop redundant pci_enable_pcie_error_reporting()
@ 2023-03-07 20:19 Bjorn Helgaas
2023-03-08 3:21 ` Xu Yilun
0 siblings, 1 reply; 2+ messages in thread
From: Bjorn Helgaas @ 2023-03-07 20:19 UTC (permalink / raw)
To: Wu Hao, Tom Rix, Moritz Fischer, Xu Yilun
Cc: linux-fpga, linux-kernel, Bjorn Helgaas
From: Bjorn Helgaas <bhelgaas@google.com>
pci_enable_pcie_error_reporting() enables the device to send ERR_*
Messages. Since f26e58bf6f54 ("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 <bhelgaas@google.com>
---
drivers/fpga/dfl-pci.c | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/drivers/fpga/dfl-pci.c b/drivers/fpga/dfl-pci.c
index 0914e7328b1a..1bc04378118c 100644
--- a/drivers/fpga/dfl-pci.c
+++ b/drivers/fpga/dfl-pci.c
@@ -21,7 +21,6 @@
#include <linux/module.h>
#include <linux/stddef.h>
#include <linux/errno.h>
-#include <linux/aer.h>
#include "dfl.h"
@@ -376,10 +375,6 @@ int cci_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *pcidevid)
return ret;
}
- ret = pci_enable_pcie_error_reporting(pcidev);
- if (ret && ret != -EINVAL)
- dev_info(&pcidev->dev, "PCIE AER unavailable %d.\n", ret);
-
pci_set_master(pcidev);
ret = dma_set_mask_and_coherent(&pcidev->dev, DMA_BIT_MASK(64));
@@ -387,24 +382,22 @@ int cci_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *pcidevid)
ret = dma_set_mask_and_coherent(&pcidev->dev, DMA_BIT_MASK(32));
if (ret) {
dev_err(&pcidev->dev, "No suitable DMA support available.\n");
- goto disable_error_report_exit;
+ return ret;
}
ret = cci_init_drvdata(pcidev);
if (ret) {
dev_err(&pcidev->dev, "Fail to init drvdata %d.\n", ret);
- goto disable_error_report_exit;
+ return ret;
}
ret = cci_enumerate_feature_devs(pcidev);
- if (!ret)
+ if (ret) {
+ dev_err(&pcidev->dev, "enumeration failure %d.\n", ret);
return ret;
+ }
- dev_err(&pcidev->dev, "enumeration failure %d.\n", ret);
-
-disable_error_report_exit:
- pci_disable_pcie_error_reporting(pcidev);
- return ret;
+ return 0;
}
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)
cci_pci_sriov_configure(pcidev, 0);
cci_remove_feature_devs(pcidev);
- pci_disable_pcie_error_reporting(pcidev);
}
static struct pci_driver cci_pci_driver = {
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fpga: dfl-pci: Drop redundant pci_enable_pcie_error_reporting()
2023-03-07 20:19 [PATCH] fpga: dfl-pci: Drop redundant pci_enable_pcie_error_reporting() Bjorn Helgaas
@ 2023-03-08 3:21 ` Xu Yilun
0 siblings, 0 replies; 2+ messages in thread
From: Xu Yilun @ 2023-03-08 3:21 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Wu Hao, Tom Rix, Moritz Fischer, linux-fpga, linux-kernel,
Bjorn Helgaas
On 2023-03-07 at 14:19:37 -0600, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
>
> pci_enable_pcie_error_reporting() enables the device to send ERR_*
> Messages. Since f26e58bf6f54 ("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 <bhelgaas@google.com>
Acked-by: Xu Yilun <yilun.xu@intel.com>
I see f26e58bf6f54 in v6.2, so I think it's OK to apply to for-6.3
Thanks,
Yilun
> ---
> drivers/fpga/dfl-pci.c | 20 ++++++--------------
> 1 file changed, 6 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/fpga/dfl-pci.c b/drivers/fpga/dfl-pci.c
> index 0914e7328b1a..1bc04378118c 100644
> --- a/drivers/fpga/dfl-pci.c
> +++ b/drivers/fpga/dfl-pci.c
> @@ -21,7 +21,6 @@
> #include <linux/module.h>
> #include <linux/stddef.h>
> #include <linux/errno.h>
> -#include <linux/aer.h>
>
> #include "dfl.h"
>
> @@ -376,10 +375,6 @@ int cci_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *pcidevid)
> return ret;
> }
>
> - ret = pci_enable_pcie_error_reporting(pcidev);
> - if (ret && ret != -EINVAL)
> - dev_info(&pcidev->dev, "PCIE AER unavailable %d.\n", ret);
> -
> pci_set_master(pcidev);
>
> ret = dma_set_mask_and_coherent(&pcidev->dev, DMA_BIT_MASK(64));
> @@ -387,24 +382,22 @@ int cci_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *pcidevid)
> ret = dma_set_mask_and_coherent(&pcidev->dev, DMA_BIT_MASK(32));
> if (ret) {
> dev_err(&pcidev->dev, "No suitable DMA support available.\n");
> - goto disable_error_report_exit;
> + return ret;
> }
>
> ret = cci_init_drvdata(pcidev);
> if (ret) {
> dev_err(&pcidev->dev, "Fail to init drvdata %d.\n", ret);
> - goto disable_error_report_exit;
> + return ret;
> }
>
> ret = cci_enumerate_feature_devs(pcidev);
> - if (!ret)
> + if (ret) {
> + dev_err(&pcidev->dev, "enumeration failure %d.\n", ret);
> return ret;
> + }
>
> - dev_err(&pcidev->dev, "enumeration failure %d.\n", ret);
> -
> -disable_error_report_exit:
> - pci_disable_pcie_error_reporting(pcidev);
> - return ret;
> + return 0;
> }
>
> 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)
> cci_pci_sriov_configure(pcidev, 0);
>
> cci_remove_feature_devs(pcidev);
> - pci_disable_pcie_error_reporting(pcidev);
> }
>
> static struct pci_driver cci_pci_driver = {
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-08 3:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-07 20:19 [PATCH] fpga: dfl-pci: Drop redundant pci_enable_pcie_error_reporting() Bjorn Helgaas
2023-03-08 3:21 ` Xu Yilun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).