linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Stefan Roese <sr@denx.de>
Cc: "Pali Rohár" <pali@kernel.org>,
	linux-pci@vger.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: Thu, 20 Jan 2022 11:54:19 -0600	[thread overview]
Message-ID: <20220120175419.GA1053838@bhelgaas> (raw)
In-Reply-To: <3dcb1639-3234-8c3c-28b4-3be0f66dc29e@denx.de>

On Thu, Jan 20, 2022 at 05:59:22PM +0100, Stefan Roese wrote:
> On 1/20/22 16:46, Bjorn Helgaas wrote:
> > On Thu, Jan 20, 2022 at 08:31:31AM +0100, Stefan Roese wrote:
> > > On 1/19/22 11:37, Pali Rohár wrote:
> > 
> > > > 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().
> > > 
> > > Agreed, this is another area to look into. Not sure if it's okay to
> > > address this, once this patch-set has been accepted (if it will be).
> > 
> > ECRC might be something that could be peeled off first to reduce the
> > complexity of AER itself.
> > 
> > The ECRC capability and enable bits are in the AER Capability, so I
> > think it should be moved to pci_aer_init() so it happens for every
> > device as we enumerate it.
> 
> Just that there is no misunderstanding: You are thinking about something
> like this:
> 
> diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
> index 9fa1f97e5b27..5585fefc4d0e 100644
> --- a/drivers/pci/pcie/aer.c
> +++ b/drivers/pci/pcie/aer.c
> @@ -387,6 +387,9 @@ 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 ECRC checking if enabled and configured */
> +       pcie_set_ecrc_checking(dev);
>  }
> 
>  void pci_aer_exit(struct pci_dev *dev)
> @@ -1223,9 +1226,6 @@ static int set_device_error_reporting(struct pci_dev
> *dev, void *data)
>                         pci_disable_pcie_error_reporting(dev);
>         }
> 
> -       if (enable)
> -               pcie_set_ecrc_checking(dev);
> -
>         return 0;
>  }
> 
> Perhaps as patch 1/3 in this patch series? Or as some completely
> separate patch?

Yes.  Probably as 1/3, since subsequent patches may depend on this
one, or at least may not apply cleanly without this one.

Bjorn

  reply	other threads:[~2022-01-20 17:54 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
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 [this message]
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=20220120175419.GA1053838@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=bharat.kumar.gogada@xilinx.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=naveennaidu479@gmail.com \
    --cc=pali@kernel.org \
    --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).