linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Stefan Roese <sr@denx.de>
Cc: linux-pci@vger.kernel.org, Bjorn Helgaas <helgaas@kernel.org>,
	Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>,
	Michal Simek <michal.simek@xilinx.com>,
	Yao Hongbo <yaohongbo@linux.alibaba.com>,
	Naveen Naidu <naveennaidu479@gmail.com>
Subject: Re: [PATCH v3 2/2] PCI/AER: Enable AER on all PCIe devices supporting it
Date: Wed, 19 Jan 2022 11:37:11 +0100	[thread overview]
Message-ID: <20220119103711.hadtvpxklfnxmqth@pali> (raw)
In-Reply-To: <20220119092200.35823-3-sr@denx.de>

On Wednesday 19 January 2022 10:22:00 Stefan Roese wrote:
> With this change, AER is now enabled on all PCIe devices, also when the
> PCIe device is hot-plugged.
> 
> Please note that this change is quite invasive, as with this patch
> applied, AER now will be enabled in the Device Control registers of all
> available PCIe Endpoints, which currently is not the case.
> 
> When "pci=noaer" is selected, AER stays disabled of course.

Hello Stefan! I was thinking more about this change and I'm not sure
what happens if AER-capable PCIe device is hotplugged into some PCIe
switch connected in the PCIe hierarchy where Root Port is not
AER-capable (e.g. current linux implementation of pci-aardvark.c and
pci-mvebu.c). My feeling is that in this case AER should not be enabled
as there is nobody who can deliver AER interrupt to the OS. But I really
do not know what is supposed from kernel AER driver, so lets wait for
Bjorn reply.

And when you opened this issue with hotplugging, another thing for
followup changes in future is calling pcie_set_ecrc_checking() function
to align ECRC state of newly hotplugged device with "pci=ecrc=..."
cmdline option. As currently it is done only at that function
set_device_error_reporting().

> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Bjorn Helgaas <helgaas@kernel.org>
> Cc: Pali Rohár <pali@kernel.org>
> Cc: Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
> Cc: Michal Simek <michal.simek@xilinx.com>
> Cc: Yao Hongbo <yaohongbo@linux.alibaba.com>
> Cc: Naveen Naidu <naveennaidu479@gmail.com>
> ---
> v3:
> - New patch, replacing the "old" 2/2 patch
>   Now enabling of AER for each PCIe device is done in pci_aer_init(),
>   which also makes sure that AER is enabled in each PCIe device even when
>   it's hot-plugged.
> 
>  drivers/pci/pcie/aer.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
> index 9fa1f97e5b27..01a25e4a5168 100644
> --- a/drivers/pci/pcie/aer.c
> +++ b/drivers/pci/pcie/aer.c
> @@ -387,6 +387,10 @@ void pci_aer_init(struct pci_dev *dev)
>  	pci_add_ext_cap_save_buffer(dev, PCI_EXT_CAP_ID_ERR, sizeof(u32) * n);
>  
>  	pci_aer_clear_status(dev);
> +
> +	/* Enable AER if requested */
> +	if (pci_aer_available())
> +		pci_enable_pcie_error_reporting(dev);
>  }
>  
>  void pci_aer_exit(struct pci_dev *dev)
> -- 
> 2.34.1
> 

  reply	other threads:[~2022-01-19 10:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19  9:21 [PATCH v3 0/2] Fully enable AER Stefan Roese
2022-01-19  9:21 ` [PATCH v3 1/2] PCI/portdrv: Don't disable AER reporting in get_port_device_capability() Stefan Roese
2022-01-19  9:22 ` [PATCH v3 2/2] PCI/AER: Enable AER on all PCIe devices supporting it Stefan Roese
2022-01-19 10:37   ` Pali Rohár [this message]
2022-01-20  7:31     ` Stefan Roese
2022-01-20 13:23       ` Pali Rohár
2022-01-20 15:46       ` Bjorn Helgaas
2022-01-20 16:59         ` Stefan Roese
2022-01-20 17:54           ` Bjorn Helgaas
2022-01-19 18:25   ` Keith Busch
2022-01-19 21:00     ` Bjorn Helgaas
2022-01-19 21:18       ` Keith Busch
2022-01-20  7:32         ` Stefan Roese

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=20220119103711.hadtvpxklfnxmqth@pali \
    --to=pali@kernel.org \
    --cc=bharat.kumar.gogada@xilinx.com \
    --cc=helgaas@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=naveennaidu479@gmail.com \
    --cc=sr@denx.de \
    --cc=yaohongbo@linux.alibaba.com \
    /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).