From: Chen Yu <yu.chen.surf@gmail.com>
To: linux-pci@vger.kernel.org
Cc: Bjorn Helgaas <bhelgaas@google.com>, Len Brown <lenb@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Zhang Rui <rui.zhang@intel.com>,
Andy Shevchenko <andriy.shevchenko@intel.com>,
Chen Yu <yu.c.chen@intel.com>
Subject: [RFC][pci/pm] pci config space save restore issues during suspend/resume
Date: Tue, 11 Feb 2020 13:57:06 +0800 [thread overview]
Message-ID: <CADjb_WR1tBHAuP9wZFnx1bJu3ZKAK8BDPMzDwc1-8nX_WVHLvA@mail.gmail.com> (raw)
Hi,
We found two issues in the code during suspend:
1. Andy Shevchenko found that, the save restore of pci config space
might cause potential issue. Current code uses
pci_read_config_dword() to read pci config header. However
hardware is not obliged to react correctly when trying to read
two/three 'adjacent' pci config registers with one dword read.
Q1: Should we save/restore the pci config space header according
to the PCI spec strictly(pci_read_config_dword() for 32bit, while
pci_read_config_word()
for 16bits, etc)?
2. The pci config space of some problematic devices(or due to firmware
bug) might become inaccessible after resumed from S3(suspend to mem)
on VM.
Q2: Should we do sanity check on pci config space before saving them?
Say, invoke pci_dev_is_present() before suspend, if the pci config space is
not sane, bypass the config space saving process, because there's no need
to save invalid pci config space.
Comments would be appreciated.
--
thanks,
Chenyu
next reply other threads:[~2020-02-11 5:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-11 5:57 Chen Yu [this message]
2020-02-11 13:50 ` [RFC][pci/pm] pci config space save restore issues during suspend/resume Bjorn Helgaas
2020-02-12 6:29 ` Chen Yu
2020-02-12 14:16 ` 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=CADjb_WR1tBHAuP9wZFnx1bJu3ZKAK8BDPMzDwc1-8nX_WVHLvA@mail.gmail.com \
--to=yu.chen.surf@gmail.com \
--cc=andriy.shevchenko@intel.com \
--cc=bhelgaas@google.com \
--cc=lenb@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
--cc=yu.c.chen@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;
as well as URLs for NNTP newsgroup(s).