Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI/PM: Stop needlessly clearing state_saved on enumeration and thaw

The state_saved flag tells the PCI core whether a driver assumes
responsibility to save Config Space and put the device into a low power
state on suspend.

The flag is currently initialized to false on enumeration, even though it
already is false (because struct pci_dev is zeroed by kzalloc()) and even
though it is set to false before commencing the suspend sequence (the only
code path where it's relevant).

The flag is also set to false in pci_pm_thaw(), i.e. on resume, when it's
no longer relevant.

Drop these two superfluous flag assignments for simplicity.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
Link: https://patch.msgid.link/fd167945bd7852e1ca08cd4b202130659eea2c2f.1763483367.git.lukas@wunner.de

authored by

Lukas Wunner and committed by
Bjorn Helgaas
be9edde4 894f475f

-4
-2
drivers/pci/pci-driver.c
··· 1133 1133 pci_pm_reenable_device(pci_dev); 1134 1134 } 1135 1135 1136 - pci_dev->state_saved = false; 1137 - 1138 1136 return error; 1139 1137 } 1140 1138
-2
drivers/pci/probe.c
··· 2747 2747 2748 2748 pci_reassigndev_resource_alignment(dev); 2749 2749 2750 - dev->state_saved = false; 2751 - 2752 2750 pci_init_capabilities(dev); 2753 2751 2754 2752 /*