mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] PCI: Tidy save/restore config messages
@ 2023-08-23 19:18 Bjorn Helgaas
  2023-08-23 19:22 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Bjorn Helgaas @ 2023-08-23 19:18 UTC (permalink / raw)
  To: linux-pci; +Cc: linux-pm, linux-kernel, Bjorn Helgaas

From: Bjorn Helgaas <bhelgaas@google.com>

Update config space save/restore debug messages so they line up better.
Previously:

  nvme 0000:05:00.0: saving config space at offset 0x4 (reading 0x20100006)
  nvme 0000:05:00.0: saving config space at offset 0x8 (reading 0x1080200)
  nvme 0000:05:00.0: saving config space at offset 0xc (reading 0x0)

  nvme 0000:05:00.0: restoring config space at offset 0x4 (was 0x0, writing 0x20100006)

Now:

  nvme 0000:05:00.0: save config 0x04: 0x20100006
  nvme 0000:05:00.0: save config 0x08: 0x01080200
  nvme 0000:05:00.0: save config 0x0c: 0x00000000

  nvme 0000:05:00.0: restore config 0x04: 0x00000000 -> 0x20100006

No functional change intended.  Enable these messages by setting
CONFIG_DYNAMIC_DEBUG=y and adding 'dyndbg="file drivers/pci/* +p"'
to kernel parameters.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/pci/pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 60230da957e0..920c161575d4 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1681,7 +1681,7 @@ int pci_save_state(struct pci_dev *dev)
 	/* XXX: 100% dword access ok here? */
 	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",
+		pci_dbg(dev, "save config %#04x: %#010x\n",
 			i * 4, dev->saved_config_space[i]);
 	}
 	dev->state_saved = true;
@@ -1712,7 +1712,7 @@ static void pci_restore_config_dword(struct pci_dev *pdev, int offset,
 		return;
 
 	for (;;) {
-		pci_dbg(pdev, "restoring config space at offset %#x (was %#x, writing %#x)\n",
+		pci_dbg(pdev, "restore config %#04x: %#010x -> %#010x\n",
 			offset, val, saved_val);
 		pci_write_config_dword(pdev, offset, saved_val);
 		if (retry-- <= 0)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] PCI: Tidy save/restore config messages
  2023-08-23 19:18 [PATCH] PCI: Tidy save/restore config messages Bjorn Helgaas
@ 2023-08-23 19:22 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2023-08-23 19:22 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, linux-pm, linux-kernel, Bjorn Helgaas

On Wed, Aug 23, 2023 at 9:19 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> From: Bjorn Helgaas <bhelgaas@google.com>
>
> Update config space save/restore debug messages so they line up better.
> Previously:
>
>   nvme 0000:05:00.0: saving config space at offset 0x4 (reading 0x20100006)
>   nvme 0000:05:00.0: saving config space at offset 0x8 (reading 0x1080200)
>   nvme 0000:05:00.0: saving config space at offset 0xc (reading 0x0)
>
>   nvme 0000:05:00.0: restoring config space at offset 0x4 (was 0x0, writing 0x20100006)
>
> Now:
>
>   nvme 0000:05:00.0: save config 0x04: 0x20100006
>   nvme 0000:05:00.0: save config 0x08: 0x01080200
>   nvme 0000:05:00.0: save config 0x0c: 0x00000000
>
>   nvme 0000:05:00.0: restore config 0x04: 0x00000000 -> 0x20100006
>
> No functional change intended.  Enable these messages by setting
> CONFIG_DYNAMIC_DEBUG=y and adding 'dyndbg="file drivers/pci/* +p"'
> to kernel parameters.
>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

Acked-by: Rafael J. Wysocki <rafael@kernel.org>

> ---
>  drivers/pci/pci.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 60230da957e0..920c161575d4 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -1681,7 +1681,7 @@ int pci_save_state(struct pci_dev *dev)
>         /* XXX: 100% dword access ok here? */
>         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",
> +               pci_dbg(dev, "save config %#04x: %#010x\n",
>                         i * 4, dev->saved_config_space[i]);
>         }
>         dev->state_saved = true;
> @@ -1712,7 +1712,7 @@ static void pci_restore_config_dword(struct pci_dev *pdev, int offset,
>                 return;
>
>         for (;;) {
> -               pci_dbg(pdev, "restoring config space at offset %#x (was %#x, writing %#x)\n",
> +               pci_dbg(pdev, "restore config %#04x: %#010x -> %#010x\n",
>                         offset, val, saved_val);
>                 pci_write_config_dword(pdev, offset, saved_val);
>                 if (retry-- <= 0)
> --
> 2.34.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-23 19:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-23 19:18 [PATCH] PCI: Tidy save/restore config messages Bjorn Helgaas
2023-08-23 19:22 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®