@@ -283,8 +283,8 @@ Description:
device will never be put into D3Cold state. If it is set, the
device may be put into D3Cold state if other requirements are
satisfied too. Reading this attribute will show the current
- value of d3cold_allowed bit. Writing this attribute will set
- the value of d3cold_allowed bit.
+ value of no_d3cold bit.
+ Writing to this attribute is deprecated and will do nothing.
What: /sys/bus/pci/devices/.../sriov_totalvfs
Date: November 2012
@@ -911,7 +911,7 @@ pci_power_t acpi_pci_choose_state(struct pci_dev *pdev)
{
int acpi_state, d_max;
- if (pdev->no_d3cold || !pdev->d3cold_allowed)
+ if (pdev->no_d3cold)
d_max = ACPI_STATE_D3_HOT;
else
d_max = ACPI_STATE_D3_COLD;
@@ -522,17 +522,7 @@ static ssize_t d3cold_allowed_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
- struct pci_dev *pdev = to_pci_dev(dev);
- unsigned long val;
-
- if (kstrtoul(buf, 0, &val) < 0)
- return -EINVAL;
-
- pdev->d3cold_allowed = !!val;
- pci_bridge_d3_update(pdev);
-
- pm_runtime_resume(dev);
-
+ dev_warn_once(dev, "pci: writing to d3cold_allowed is deprecated\n");
return count;
}
@@ -540,7 +530,7 @@ static ssize_t d3cold_allowed_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct pci_dev *pdev = to_pci_dev(dev);
- return sysfs_emit(buf, "%u\n", pdev->d3cold_allowed);
+ return sysfs_emit(buf, "%u\n", !pdev->no_d3cold);
}
static DEVICE_ATTR_RW(d3cold_allowed);
#endif
@@ -3069,7 +3069,7 @@ static int pci_dev_check_d3cold(struct pci_dev *dev, void *data)
bool *d3cold_ok = data;
if (/* The device needs to be allowed to go D3cold ... */
- dev->no_d3cold || !dev->d3cold_allowed ||
+ dev->no_d3cold ||
/* ... and if it is wakeup capable to do so from D3cold. */
(device_may_wakeup(&dev->dev) &&
@@ -3206,7 +3206,6 @@ void pci_pm_init(struct pci_dev *dev)
dev->d3hot_delay = PCI_PM_D3HOT_WAIT;
dev->d3cold_delay = PCI_PM_D3COLD_WAIT;
dev->bridge_d3 = pci_bridge_d3_possible(dev);
- dev->d3cold_allowed = true;
dev->d1_support = false;
dev->d2_support = false;
@@ -376,7 +376,6 @@ struct pci_dev {
unsigned int no_d1d2:1; /* D1 and D2 are forbidden */
unsigned int no_d3cold:1; /* D3cold is forbidden */
unsigned int bridge_d3:1; /* Allow D3 for bridge */
- unsigned int d3cold_allowed:1; /* D3cold is allowed by user */
unsigned int mmio_always_on:1; /* Disallow turning off io/mem
decoding during BAR sizing */
unsigned int wakeup_prepared:1;