From: Keith Busch <kbusch@kernel.org>
To: "Patel, Mayurkumar" <mayurkumar.patel@intel.com>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
sathyanarayanan kuppuswamy
<sathyanarayanan.kuppuswamy@linux.intel.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"mika.westerberg@linux.intel.com"
<mika.westerberg@linux.intel.com>,
'Andy Shevchenko' <andriy.shevchenko@linux.intel.com>,
"Busch, Keith" <keith.busch@intel.com>,
Oza Pawandeep <poza@codeaurora.org>
Subject: Re: [PATCH] PCI/AER: save/restore AER registers during suspend/resume
Date: Fri, 26 Jul 2019 10:15:24 -0600 [thread overview]
Message-ID: <20190726161524.GA8437@localhost.localdomain> (raw)
In-Reply-To: <92EBB4272BF81E4089A7126EC1E7B28479A8704C@IRSMSX101.ger.corp.intel.com>
On Fri, Jul 26, 2019 at 02:00:05AM -0700, Patel, Mayurkumar wrote:
> > The call to pci_save_state most likely occurs long before a user has an
> > opportunity to alter these regsiters, though. Won't this just restore
> > what was previously there, and not the state you changed it to?
>
>
> There were two things (not sure to call them issues),
> 1. PCI_ERR_ROOT_COMMAND resets to 0 during S3 entry/exit, which disables AER interrupt trigger
> if AER happens on Endpoint after resume.
>
> Also specified in spec. NCB-PCI_Express_Base_4.0r1.0_September-27-2017-c.pdf in
> chapter 7.8.4.9 Root Error Command Register (Offset 2Ch) - in bitfields descriptions.
> i.e. Correctable Error Reporting Enable – When Set, this bit enables the generation of an interrupt when
> a correctable error is reported by any of the Functions in the Hierarchy Domain associated with this Root Port.
>
> 2. Root port resets to its default configuration of UNCOR_MASK/SEVER/COR_MASK register bits after system resume.
> This influences user configurations, how errors shall be treated if AER happens on root port itself due to Device (for example
> Endpoint not answering which results in completion timeouts on root ports).
>
> Following is one example scenario which can handled with this patch.
> - user configures AER registers using setpci certain masks and severity based on debug requirements. This can be applied on Root port of EP.
> - triggers system test which includes S3 entry/exit cycles.
> - system enters s3 -> AER registers settings are saved which has been configured by users.
> - system exits s3 -> AER registers settings are restored which has been configured by users.
Right, I was just more curious *where* the aer state was being saved
during suspend since pci port driver only saves state during probe. This
patch must be relying on the generic pci-driver's power management. I
think that works, but I just didn't realize initially that we're relying
on that path.
> > You are allocating the capability save buffer in aer_probe(), so this
> > save/restore applies only to root ports. But you mention above that you
> > want to restore end devices, right?
>
> That’s correct. I agree that my commit message was not so explicit.
> But Since I included PCI_ERR_ROOT_COMMAND register for save/restore which is specific to Root ports only & I thought
> endpoint drivers can handle to save/restore (UNCOR_MASK/SEVER/COR_MASK) themselves with its suspend/resume functions.
>
> However I am fine to move pci_add_ext_cap_save_buffer() to some other function so
> that it also save/restores UNCOR_MASK/SEVER/COR_MASK registers for endpoints and
> if it's not useful to save/restore MASK & SEVER registers then also fine to remove them
> and just restore PCI_ERR_ROOT_COMMAND & ECRC settings. Please let me know.
If users are changing default settings that you want to preserve, that
reason should apply to bridges and endpoints too, so I think you ought
to allocate the save buffer for this capability for all devices that
support it in in pci_aer_init(). Just make sure to check the device type
in save/restore so you're not accessing root port specific registers.
next prev parent reply other threads:[~2019-07-26 16:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-09 8:00 [PATCH] PCI/AER: save/restore AER registers during suspend/resume Patel, Mayurkumar
2019-07-09 18:31 ` sathyanarayanan kuppuswamy
2019-07-10 17:22 ` Patel, Mayurkumar
2019-07-10 17:36 ` sathyanarayanan kuppuswamy
2019-07-24 18:45 ` Bjorn Helgaas
2019-07-25 16:08 ` Keith Busch
2019-07-26 9:00 ` Patel, Mayurkumar
2019-07-26 16:15 ` Keith Busch [this message]
2019-07-30 13:57 ` Bjorn Helgaas
2019-08-01 13:09 ` Patel, Mayurkumar
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=20190726161524.GA8437@localhost.localdomain \
--to=kbusch@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=helgaas@kernel.org \
--cc=keith.busch@intel.com \
--cc=linux-pci@vger.kernel.org \
--cc=mayurkumar.patel@intel.com \
--cc=mika.westerberg@linux.intel.com \
--cc=poza@codeaurora.org \
--cc=sathyanarayanan.kuppuswamy@linux.intel.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