Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4437656ybl; Mon, 13 Jan 2020 13:46:40 -0800 (PST) X-Google-Smtp-Source: APXvYqyK9+gFVUJ5AmTM96YwYxmZ3fjISZTvMSGgMC9zjVBAxNPqwXfthEf8iyB/6XXw0r7l6duP X-Received: by 2002:aca:1011:: with SMTP id 17mr14615346oiq.72.1578952000433; Mon, 13 Jan 2020 13:46:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578952000; cv=none; d=google.com; s=arc-20160816; b=QuTuxjq3SWc0BL1E1fC0x64FY9qpxdzhTX8stqX8MaVCfZ/wb1Csexpt0EWNumSW1c Q6t38RW5HZZcJ3tfL0TEQ+1nTjXvyo3/NtlElZSRt1LktZo1+gzGls0oYLjFE8Mbzgbw VBRnn5our2Z7e62mRxgVcsU6VyEOsfAJuUw1AhSGfsJqeHYkr8j1D0Y94+Jd80RErgAv vIv0TYRFb51rkm/WqhX9ldsrydwj99MLag0XyCyQmzXvtuUqpkNkODbMYu0Kpeniz9lx G4i5vBf0oUtIJ9mQmX1Z6Cy+gQpPWiBrD85X0hT4ij5/5GpLtXei/bqvsw7xPeoprW28 V7xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=y1gZCwT2ekTYRjyuK0vbu4r78AAQ51dURNoyMGTzfCI=; b=hDtaB8OpwjH93bOxrX49ky/eXrVJgsTuwkcOddfTfFsKBQ5UGi4jh/C7bMAx86YrdZ clBWFWeqkQoLR/KUq5OI6v+sUKlnV2ceYZh1Kab50ivkQ5cOvxOBa+oS9F4XrHVNTlXi GgvL1C8/Rc/4ImO6bYO4Ev6AoJoz5+AXjEwuq5cvSQSxsXGzaKN+lRdkD0Jw0CRLIbxc ogg5PpFoNR//3IQcevodtkusBnyihUYc9HB4uJ3paKEbbYQNxzT1WA80/UPC09COxCbj 84DoyJjVC9YLzoF8KqvL2wwygfiH8esm/1gQME4cCwJ3YFiR8dl7zDJKY4/fsiWQRXPA 7Tjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OWYviWPl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10si7070314otp.124.2020.01.13.13.46.28; Mon, 13 Jan 2020 13:46:40 -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; dkim=pass header.i=@kernel.org header.s=default header.b=OWYviWPl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728748AbgAMVpN (ORCPT + 99 others); Mon, 13 Jan 2020 16:45:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:35462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726488AbgAMVpM (ORCPT ); Mon, 13 Jan 2020 16:45:12 -0500 Received: from localhost (mobile-166-170-223-177.mycingular.net [166.170.223.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BC8FA20CC7; Mon, 13 Jan 2020 21:45:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578951912; bh=cNM+trifQppQVmWLHDIheU3838+ouIqu4KohlNVE2W8=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=OWYviWPlsbpybgnWy3g5GklkweM1lBUCM8pjfgSeXL/HKpXS2Odrs2N1yLhGZ7q0I Gvk/wcS0SZ0KR9EN771+zEkpnHodZAoo8HayesnR+fCRjRSYqTXzj/1jAg4+kR/b1+ BOxPqHsePpONqH+K4Srs266/9ZzdFSCUJC5RhD54= Date: Mon, 13 Jan 2020 15:45:10 -0600 From: Bjorn Helgaas To: Chen Yu Cc: linux-pci@vger.kernel.org, "Rafael J. Wysocki" , Len Brown , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI/PM: Print the pci config space of devices before suspend Message-ID: <20200113214510.GA119378@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200113060724.19571-1-yu.c.chen@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 13, 2020 at 02:07:24PM +0800, Chen Yu wrote: > 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 Applied to pci/pm for v5.6, thanks! > --- > 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 >