Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3588915ybl; Sun, 12 Jan 2020 22:09:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwpeu3Xg3Qqsn3X0zvrf9cvmn8UtQhYu/2iTB7nEBR468jMkGabpTtBqYHjETu91wUvz9KH X-Received: by 2002:aca:af54:: with SMTP id y81mr11824527oie.21.1578895791347; Sun, 12 Jan 2020 22:09:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578895791; cv=none; d=google.com; s=arc-20160816; b=F+LclyTtM1w4okjCPngODwDOUeeCHaF5TP0qW0CYE+R0b8APwGOcLq3BKEMBRX11hJ zzQI3h0jHWJLRznE5smCJwNHFB6vpEXwRhsaEg6HEHwqDbqKXBWudAnYhIlvCuEh3CuM psOnw0vtSFUBmYwZJqNlQJ7BcYqVQ3Q8jhZZg5Y8daCdBwoCF6RbpdhIzi1K6qSE7Se8 v7IcIt91vIW45Tt81cBtYQYEMkN+37X8RE2eOnQ71QCfB5qE7ojrQYAORDvLKWQ1VQR8 ADVRolGnTy7ut/VgCAQDau8fSpfjINuxpOPiKPi7XP76yLsyWMjA6lXG2LxoZcdz1ON6 LNEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=agFsPFZC/7Ckbx5F1Mo2paHlGu+4kdZMnCxiUG6VoGI=; b=Ih7fqJREAwAOhu8q+mz3W+k7O0KktSPOPL7+yxDATo0w5UV9nZNII6H+KWlpGFHBYZ EzuY1wpFKcxfeITvU+wERroIemqp+Ayco0VarEq9PiMEyBDt6cpOydP8fFbzje7CagPM sul0onAs32wNxuissmd7fK4ofJnzlCZdWyMyrT1w0+/OO1NoEjWmJu2kFkHFoEPJevSb VWLpK/5azecvQY4glFfPjNtW0sKsC14df9j8hY+XBehdMglp2BOxyBRRX1ayVhlgJXlu GpJfu+bpILUnRpBtbWdQc4rELlp4kotzMOhUNDQa4D2inbjBY+94e2aciNqutfZRCd5Y m4Sw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y205si5437108oig.137.2020.01.12.22.09.37; Sun, 12 Jan 2020 22:09:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732888AbgAMGIk (ORCPT + 99 others); Mon, 13 Jan 2020 01:08:40 -0500 Received: from mga05.intel.com ([192.55.52.43]:47086 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725909AbgAMGIk (ORCPT ); Mon, 13 Jan 2020 01:08:40 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jan 2020 22:08:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,427,1571727600"; d="scan'208";a="304750793" Received: from chenyu-office.sh.intel.com ([10.239.158.173]) by orsmga001.jf.intel.com with ESMTP; 12 Jan 2020 22:08:38 -0800 From: Chen Yu To: linux-pci@vger.kernel.org Cc: Chen Yu , Bjorn Helgaas , "Rafael J. Wysocki" , Len Brown , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PCI/PM: Print the pci config space of devices before suspend Date: Mon, 13 Jan 2020 14:07:24 +0800 Message-Id: <20200113060724.19571-1-yu.c.chen@intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The pci config space was found to be insane during resume from hibernation(S4, or suspend to disk) on a VM: serial 0000:00:16.3: restoring config space at offset 0x14 (was 0x9104e000, writing 0xffffffff) Either the snapshot on the disk has been scribbled or the pci config space becomes invalid before suspend. To narrow down and benefit future debugging, print the pci config space being saved before suspend, which is symmetric to the log in pci_restore_config_dword(). Cc: Bjorn Helgaas Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: linux-pci@vger.kernel.org Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Chen Yu --- drivers/pci/pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index e87196cc1a7f..34cde70440c3 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1372,8 +1372,11 @@ int pci_save_state(struct pci_dev *dev) { int i; /* XXX: 100% dword access ok here? */ - for (i = 0; i < 16; i++) + for (i = 0; i < 16; i++) { pci_read_config_dword(dev, i * 4, &dev->saved_config_space[i]); + pci_dbg(dev, "saving config space at offset %#x (reading %#x)\n", + i * 4, dev->saved_config_space[i]); + } dev->state_saved = true; i = pci_save_pcie_state(dev); -- 2.17.1