The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Xudong Hao <xudong.hao@linux.intel.com>
To: bhelgaas@google.com
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, xiantao.zhang@intel.com,
	xudong.hao@intel.com
Subject: [PATCH] PCI: save/restore max Latency Value for device LTR
Date: Sun, 6 May 2012 23:11:56 +0800	[thread overview]
Message-ID: <20120506151156.GA13805@hp-xd.sh.intel.com> (raw)

LTR: Save Max snoop/no-snoop Latency Value in pci_save_pcie_state, and restore them in pci_restore_pcie_state.

Signed-off-by: Xudong Hao <xudong.hao@intel.com>

---
 drivers/pci/pci.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 111569c..c8573c3 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -875,6 +875,12 @@ static int pci_save_pcie_state(struct pci_dev *dev)
        pci_read_config_word(dev, pos + PCI_EXP_LNKCTL2, &cap[i++]);
    if (pcie_cap_has_sltctl2(dev->pcie_type, flags))
        pci_read_config_word(dev, pos + PCI_EXP_SLTCTL2, &cap[i++]);
+   if (pci_ltr_supported(dev)) {
+       pci_read_config_word(dev, pos + PCI_LTR_MAX_SNOOP_LAT,
+                           &cap[i++]);
+       pci_read_config_word(dev, pos + PCI_LTR_MAX_NOSNOOP_LAT,
+                           &cap[i++]);
+   }

    return 0;
 }
@@ -908,6 +914,12 @@ static void pci_restore_pcie_state(struct pci_dev *dev)
        pci_write_config_word(dev, pos + PCI_EXP_LNKCTL2, cap[i++]);
    if (pcie_cap_has_sltctl2(dev->pcie_type, flags))
        pci_write_config_word(dev, pos + PCI_EXP_SLTCTL2, cap[i++]);
+   if (pci_ltr_supported(dev)) {
+       pci_write_config_word(dev, pos + PCI_LTR_MAX_SNOOP_LAT,
+                           cap[i++]);
+       pci_write_config_word(dev, pos + PCI_LTR_MAX_NOSNOOP_LAT,
+                           cap[i++]);
+   }
 }


--
1.6.0.rc1


             reply	other threads:[~2012-05-06 15:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-06 15:11 Xudong Hao [this message]
2012-05-07 16:27 ` [PATCH] PCI: save/restore max Latency Value for device LTR Bjorn Helgaas
2012-05-08  9:09   ` Hao, Xudong
2012-05-19  0:27     ` 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=20120506151156.GA13805@hp-xd.sh.intel.com \
    --to=xudong.hao@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=xiantao.zhang@intel.com \
    --cc=xudong.hao@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