diff mbox series

cxl: remove unnecessary calling of pci_enable_pcie_error_reporting()

Message ID 167632012093.4153151.5360778069735064322.stgit@djiang5-mobl3.local
State Accepted
Commit 1922a6dc0502ed3fd0786f57cc9e5f515c902009
Headers show
Series cxl: remove unnecessary calling of pci_enable_pcie_error_reporting() | expand

Commit Message

Dave Jiang Feb. 13, 2023, 8:28 p.m. UTC
With this [1] commit upstream, pci_enable_pci_error_report() is no longer
necessary for the driver to call. Remove call and related cleanups.

[1]: f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native")

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 drivers/cxl/pci.c |   11 -----------
 1 file changed, 11 deletions(-)

Comments

Dan Williams Feb. 14, 2023, 1:22 a.m. UTC | #1
Dave Jiang wrote:
> With this [1] commit upstream, pci_enable_pci_error_report() is no longer
> necessary for the driver to call. Remove call and related cleanups.
> 
> [1]: f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native")

Care to fixup the Documentation as well so others do not follow the same
pattern?

diff --git a/Documentation/PCI/pcieaer-howto.rst b/Documentation/PCI/pcieaer-howto.rst
index 0b36b9ebfa4b..a82802795a06 100644
--- a/Documentation/PCI/pcieaer-howto.rst
+++ b/Documentation/PCI/pcieaer-howto.rst
@@ -135,15 +135,6 @@ hierarchy and links. These errors do not include any device specific
 errors because device specific errors will still get sent directly to
 the device driver.
 
-Configure the AER capability structure
---------------------------------------
-
-AER aware drivers of PCI Express component need change the device
-control registers to enable AER. They also could change AER registers,
-including mask and severity registers. Helper function
-pci_enable_pcie_error_reporting could be used to enable AER. See
-section 3.3.
-
 Provide callbacks
 -----------------
 
@@ -214,15 +205,6 @@ to mmio_enabled.
 
 helper functions
 ----------------
-::
-
-  int pci_enable_pcie_error_reporting(struct pci_dev *dev);
-
-pci_enable_pcie_error_reporting enables the device to send error
-messages to root port when an error is detected. Note that devices
-don't enable the error reporting by default, so device drivers need
-call this function to enable it.
-
 ::
 
   int pci_disable_pcie_error_reporting(struct pci_dev *dev);
Dave Jiang Feb. 14, 2023, 3:59 a.m. UTC | #2
On 2/13/23 6:22 PM, Dan Williams wrote:
> Dave Jiang wrote:
>> With this [1] commit upstream, pci_enable_pci_error_report() is no longer
>> necessary for the driver to call. Remove call and related cleanups.
>>
>> [1]: f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native")
> 
> Care to fixup the Documentation as well so others do not follow the same
> pattern?

Sure I'll add the diffs below.

> 
> diff --git a/Documentation/PCI/pcieaer-howto.rst b/Documentation/PCI/pcieaer-howto.rst
> index 0b36b9ebfa4b..a82802795a06 100644
> --- a/Documentation/PCI/pcieaer-howto.rst
> +++ b/Documentation/PCI/pcieaer-howto.rst
> @@ -135,15 +135,6 @@ hierarchy and links. These errors do not include any device specific
>   errors because device specific errors will still get sent directly to
>   the device driver.
>   
> -Configure the AER capability structure
> ---------------------------------------
> -
> -AER aware drivers of PCI Express component need change the device
> -control registers to enable AER. They also could change AER registers,
> -including mask and severity registers. Helper function
> -pci_enable_pcie_error_reporting could be used to enable AER. See
> -section 3.3.
> -
>   Provide callbacks
>   -----------------
>   
> @@ -214,15 +205,6 @@ to mmio_enabled.
>   
>   helper functions
>   ----------------
> -::
> -
> -  int pci_enable_pcie_error_reporting(struct pci_dev *dev);
> -
> -pci_enable_pcie_error_reporting enables the device to send error
> -messages to root port when an error is detected. Note that devices
> -don't enable the error reporting by default, so device drivers need
> -call this function to enable it.
> -
>   ::
>   
>     int pci_disable_pcie_error_reporting(struct pci_dev *dev);
Dave Jiang Feb. 14, 2023, 4:53 p.m. UTC | #3
On 2/13/23 8:59 PM, Dave Jiang wrote:
> 
> 
> On 2/13/23 6:22 PM, Dan Williams wrote:
>> Dave Jiang wrote:
>>> With this [1] commit upstream, pci_enable_pci_error_report() is no 
>>> longer
>>> necessary for the driver to call. Remove call and related cleanups.
>>>
>>> [1]: f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native")
>>
>> Care to fixup the Documentation as well so others do not follow the same
>> pattern?
> 
> Sure I'll add the diffs below.
Sent as separate patch:
https://lore.kernel.org/linux-pci/167639333373.777843.2141436875951823865.stgit@djiang5-mobl3.local/T/#u

> 
>>
>> diff --git a/Documentation/PCI/pcieaer-howto.rst 
>> b/Documentation/PCI/pcieaer-howto.rst
>> index 0b36b9ebfa4b..a82802795a06 100644
>> --- a/Documentation/PCI/pcieaer-howto.rst
>> +++ b/Documentation/PCI/pcieaer-howto.rst
>> @@ -135,15 +135,6 @@ hierarchy and links. These errors do not include 
>> any device specific
>>   errors because device specific errors will still get sent directly to
>>   the device driver.
>> -Configure the AER capability structure
>> ---------------------------------------
>> -
>> -AER aware drivers of PCI Express component need change the device
>> -control registers to enable AER. They also could change AER registers,
>> -including mask and severity registers. Helper function
>> -pci_enable_pcie_error_reporting could be used to enable AER. See
>> -section 3.3.
>> -
>>   Provide callbacks
>>   -----------------
>> @@ -214,15 +205,6 @@ to mmio_enabled.
>>   helper functions
>>   ----------------
>> -::
>> -
>> -  int pci_enable_pcie_error_reporting(struct pci_dev *dev);
>> -
>> -pci_enable_pcie_error_reporting enables the device to send error
>> -messages to root port when an error is detected. Note that devices
>> -don't enable the error reporting by default, so device drivers need
>> -call this function to enable it.
>> -
>>   ::
>>     int pci_disable_pcie_error_reporting(struct pci_dev *dev);
diff mbox series

Patch

diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
index 4cf9a2191602..c87340095a8a 100644
--- a/drivers/cxl/pci.c
+++ b/drivers/cxl/pci.c
@@ -412,11 +412,6 @@  static bool is_cxl_restricted(struct pci_dev *pdev)
 	return pci_pcie_type(pdev) == PCI_EXP_TYPE_RC_END;
 }
 
-static void disable_aer(void *pdev)
-{
-	pci_disable_pcie_error_reporting(pdev);
-}
-
 static void free_event_buf(void *buf)
 {
 	kvfree(buf);
@@ -733,12 +728,6 @@  static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	if (rc)
 		return rc;
 
-	if (cxlds->regs.ras) {
-		pci_enable_pcie_error_reporting(pdev);
-		rc = devm_add_action_or_reset(&pdev->dev, disable_aer, pdev);
-		if (rc)
-			return rc;
-	}
 	pci_save_state(pdev);
 
 	return rc;