linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sathyanarayanan Kuppuswamy  <sathyanarayanan.kuppuswamy@linux.intel.com>
To: Bjorn Helgaas <helgaas@kernel.org>, linux-pci@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
	Stefan Roese <sr@denx.de>, Ashok Raj <ashok.raj@intel.com>,
	Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH 1/9] PCI/AER: Remove redundant Device Control Error Reporting Enable
Date: Wed, 18 Jan 2023 19:49:06 -0800	[thread overview]
Message-ID: <001efe2e-0ae8-e3fe-f872-d5401ec802c9@linux.intel.com> (raw)
In-Reply-To: <20230118234612.272916-2-helgaas@kernel.org>



On 1/18/23 3:46 PM, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
> 
> The following bits in the PCIe Device Control register enable sending of
> ERR_COR, ERR_NONFATAL, or ERR_FATAL Messages (or reporting internally in
> the case of Root Ports):
> 
>   Correctable Error Reporting Enable
>   Non-Fatal Error Reporting Enable
>   Fatal Error Reporting Enable
>   Unsupported Request Reporting Enable
> 
> These enable bits are set by pci_enable_pcie_error_reporting(), and since
> f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native"), we
> do that in this path during enumeration:
> 
>   pci_init_capabilities
>     pci_aer_init
>       pci_enable_pcie_error_reporting
> 
> Previously, the AER service driver also traversed the hierarchy when
> claiming a Root Port, enabling error reporting for downstream devices, but
> this is redundant.
> 
> Remove the code that enables this error reporting in the AER .probe() path.
> Also remove similar code that disables error reporting in the AER .remove()
> path.
> 
> Note that these Device Control Reporting Enable bits do not control
> interrupt generation.  That's done by the similarly-named bits in the AER
> Root Error Command register, which are still set by aer_probe() and cleared
> by aer_remove(), since the AER service driver handles those interrupts.
> See PCIe r6.0, sec 6.2.6.
> 
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Stefan Roese <sr@denx.de>
> Cc: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> Cc: Ashok Raj <ashok.raj@intel.com>
> Cc: Keith Busch <kbusch@kernel.org>
> ---

Looks fine to me.

Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

>  drivers/pci/pcie/aer.c | 48 ------------------------------------------
>  1 file changed, 48 deletions(-)
> 
> diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
> index 625f7b2cafe4..b7b69e0c778c 100644
> --- a/drivers/pci/pcie/aer.c
> +++ b/drivers/pci/pcie/aer.c
> @@ -1224,42 +1224,6 @@ static irqreturn_t aer_irq(int irq, void *context)
>  	return IRQ_WAKE_THREAD;
>  }
>  
> -static int set_device_error_reporting(struct pci_dev *dev, void *data)
> -{
> -	bool enable = *((bool *)data);
> -	int type = pci_pcie_type(dev);
> -
> -	if ((type == PCI_EXP_TYPE_ROOT_PORT) ||
> -	    (type == PCI_EXP_TYPE_RC_EC) ||
> -	    (type == PCI_EXP_TYPE_UPSTREAM) ||
> -	    (type == PCI_EXP_TYPE_DOWNSTREAM)) {
> -		if (enable)
> -			pci_enable_pcie_error_reporting(dev);
> -		else
> -			pci_disable_pcie_error_reporting(dev);
> -	}
> -
> -	return 0;
> -}
> -
> -/**
> - * set_downstream_devices_error_reporting - enable/disable the error reporting  bits on the root port and its downstream ports.
> - * @dev: pointer to root port's pci_dev data structure
> - * @enable: true = enable error reporting, false = disable error reporting.
> - */
> -static void set_downstream_devices_error_reporting(struct pci_dev *dev,
> -						   bool enable)
> -{
> -	set_device_error_reporting(dev, &enable);
> -
> -	if (pci_pcie_type(dev) == PCI_EXP_TYPE_RC_EC)
> -		pcie_walk_rcec(dev, set_device_error_reporting, &enable);
> -	else if (dev->subordinate)
> -		pci_walk_bus(dev->subordinate, set_device_error_reporting,
> -			     &enable);
> -
> -}
> -
>  /**
>   * aer_enable_rootport - enable Root Port's interrupts when receiving messages
>   * @rpc: pointer to a Root Port data structure
> @@ -1289,12 +1253,6 @@ static void aer_enable_rootport(struct aer_rpc *rpc)
>  	pci_read_config_dword(pdev, aer + PCI_ERR_UNCOR_STATUS, &reg32);
>  	pci_write_config_dword(pdev, aer + PCI_ERR_UNCOR_STATUS, reg32);
>  
> -	/*
> -	 * Enable error reporting for the root port device and downstream port
> -	 * devices.
> -	 */
> -	set_downstream_devices_error_reporting(pdev, true);
> -
>  	/* Enable Root Port's interrupt in response to error messages */
>  	pci_read_config_dword(pdev, aer + PCI_ERR_ROOT_COMMAND, &reg32);
>  	reg32 |= ROOT_PORT_INTR_ON_MESG_MASK;
> @@ -1313,12 +1271,6 @@ static void aer_disable_rootport(struct aer_rpc *rpc)
>  	int aer = pdev->aer_cap;
>  	u32 reg32;
>  
> -	/*
> -	 * Disable error reporting for the root port device and downstream port
> -	 * devices.
> -	 */
> -	set_downstream_devices_error_reporting(pdev, false);
> -
>  	/* Disable Root's interrupt in response to error messages */
>  	pci_read_config_dword(pdev, aer + PCI_ERR_ROOT_COMMAND, &reg32);
>  	reg32 &= ~ROOT_PORT_INTR_ON_MESG_MASK;

-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer

  reply	other threads:[~2023-01-19  3:56 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 23:46 [PATCH 0/9] PCI/AER: Remove redundant Device Control Error Reporting Enable Bjorn Helgaas
2023-01-18 23:46 ` [PATCH 1/9] " Bjorn Helgaas
2023-01-19  3:49   ` Sathyanarayanan Kuppuswamy [this message]
2023-01-24  7:22   ` Stefan Roese
2023-01-18 23:46 ` [PATCH 2/9] e1000e: Remove redundant pci_enable_pcie_error_reporting() Bjorn Helgaas
2023-01-19 18:28   ` Tony Nguyen
2023-01-19 18:40     ` [Intel-wired-lan] " Bjorn Helgaas
2023-01-19 21:31       ` Tony Nguyen
2023-01-20  5:35         ` Jakub Kicinski
2023-01-20  3:17   ` Jakub Kicinski
2023-01-20 13:14     ` [Intel-wired-lan] " Bjorn Helgaas
2023-01-18 23:46 ` [PATCH 3/9] fm10k: " Bjorn Helgaas
2023-01-19 18:28   ` Tony Nguyen
2023-01-18 23:46 ` [PATCH 4/9] i40e: " Bjorn Helgaas
2023-01-19 18:28   ` Tony Nguyen
2023-01-25 10:34   ` [Intel-wired-lan] " G, GurucharanX
2023-01-18 23:46 ` [PATCH 5/9] iavf: " Bjorn Helgaas
2023-01-19 18:28   ` Tony Nguyen
2023-01-18 23:46 ` [PATCH 6/9] ice: " Bjorn Helgaas
2023-01-19 18:28   ` Tony Nguyen
2023-01-25  9:08   ` [Intel-wired-lan] " G, GurucharanX
2023-01-18 23:46 ` [PATCH 7/9] igb: " Bjorn Helgaas
2023-01-19 18:28   ` Tony Nguyen
2023-01-25  9:09   ` [Intel-wired-lan] " G, GurucharanX
2023-01-18 23:46 ` [PATCH 8/9] igc: " Bjorn Helgaas
2023-01-19 18:28   ` Tony Nguyen
2023-01-24 11:33   ` [Intel-wired-lan] " naamax.meir
2023-01-18 23:46 ` [PATCH 9/9] ixgbe: " Bjorn Helgaas
2023-01-19 18:28   ` Tony Nguyen
2023-01-25  9:09   ` [Intel-wired-lan] " G, GurucharanX
2023-01-19  3:55 ` [PATCH 0/9] PCI/AER: Remove redundant Device Control Error Reporting Enable Sathyanarayanan Kuppuswamy
2023-01-19  4:26   ` Bjorn Helgaas
2023-01-26 23:15 ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=001efe2e-0ae8-e3fe-f872-d5401ec802c9@linux.intel.com \
    --to=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=ashok.raj@intel.com \
    --cc=bhelgaas@google.com \
    --cc=helgaas@kernel.org \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sr@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).