From patchwork Sun May 6 15:11:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xudong Hao X-Patchwork-Id: 157085 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 368D7B6EEC for ; Mon, 7 May 2012 01:09:17 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753261Ab2EFPIz (ORCPT ); Sun, 6 May 2012 11:08:55 -0400 Received: from mga01.intel.com ([192.55.52.88]:32298 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751672Ab2EFPIz (ORCPT ); Sun, 6 May 2012 11:08:55 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 06 May 2012 08:08:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="149853857" Received: from hp-xd.sh.intel.com (HELO hp-xd) ([10.239.36.129]) by fmsmga001.fm.intel.com with ESMTP; 06 May 2012 08:08:53 -0700 Date: Sun, 6 May 2012 23:11:56 +0800 From: Xudong Hao 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 Message-ID: <20120506151156.GA13805@hp-xd.sh.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 --- drivers/pci/pci.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) -- 1.6.0.rc1 -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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++]); + } }