PCI: For d3_delay and d3cold_delay, zero means zero
PATCH 1/1 PCI: For d3_delay and d3cold_delay, zero means zero
Do not sleep at all for the respective cases of d3_delay is zero or d3cold_delay is zero.
--- drivers/pci/pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/pci/pci.c +4 -2
@@ -66,7 +66,8 @@ static void pci_dev_d3_sleep(struct pci_dev *dev)if (delay < pci_pm_d3_delay) delay = pci_pm_d3_delay; -msleep (delay); +if (delay) +msleep (delay); }#ifdef CONFIG_PCI_DOMAINS
@@ -827,7 +828,8 @@ static void __pci_start_power_transition(struct pci_dev *dev, pci_power_t state)* because have already delayed for the bridge. */ if (dev->runtime_d3cold) { -msleep (dev->d3cold_delay); +if (dev->d3cold_delay) +msleep (dev->d3cold_delay);/* * When powering on a bridge from D3cold, the * whole hierarchy may be powered on into
Signature · 1 line
1.9.1
Hi Adrian,
Quoted 2 lines · Adrian Hunter
Do not sleep at all for the respective cases of
d3_delayis zero ord3cold_delayis zero.
Can you please include a hint here about (1) what msleep() does with an argument of zero, and (2) why this change is desirable, e.g., maybe it makes suspend/resume faster or something?
Quoted 32 lines
Signed-off-by Adrian Hunter <[email protected]>--- drivers/pci/pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/pci/pci.c +4
-2@@ -66,7 +66,8 @@ static void pci_dev_d3_sleep(struct pci_dev *dev)if (delay < pci_pm_d3_delay) delay = pci_pm_d3_delay; -msleep (delay); +if (delay) +msleep (delay); }#ifdef CONFIG_PCI_DOMAINS @@ -827,7 +828,8 @@ static void __pci_start_power_transition(struct pci_dev *dev, pci_power_t state)* because have already delayed for the bridge. */ if (dev->runtime_d3cold) { -msleep (dev->d3cold_delay); +if (dev->d3cold_delay) +msleep (dev->d3cold_delay);/* * When powering on a bridge from D3cold, the * whole hierarchy may be powered on into Signature · 1 line
1.9.1
PATCH 1/1 PCI: For d3_delay and d3cold_delay, zero means zero
msleep() still sleeps 1 jiffy even when told to sleep for zero milliseconds. That can end up being 1-2 milliseconds or more. In the cases of d3_delay and d3cold_delay, that unnecessarily increases suspend and/or resume latencies.
So, do not sleep at all for the respective cases of d3_delay is zero or d3cold_delay is zero.
--- drivers/pci/pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/pci/pci.c +4 -2
@@ -66,7 +66,8 @@ static void pci_dev_d3_sleep(struct pci_dev *dev)if (delay < pci_pm_d3_delay) delay = pci_pm_d3_delay; -msleep (delay); +if (delay) +msleep (delay); }#ifdef CONFIG_PCI_DOMAINS
@@ -827,7 +828,8 @@ static void __pci_start_power_transition(struct pci_dev *dev, pci_power_t state)* because have already delayed for the bridge. */ if (dev->runtime_d3cold) { -msleep (dev->d3cold_delay); +if (dev->d3cold_delay) +msleep (dev->d3cold_delay);/* * When powering on a bridge from D3cold, the * whole hierarchy may be powered on into
Signature · 1 line
1.9.1
Forgot to put this is V2, sorry. It has changes to the commit message as requested.
Quoted 38 lines · Adrian Hunter
msleep()still sleeps 1 jiffy even when told to sleep for zero milliseconds. That can end up being 1-2 milliseconds or more. In the cases ofd3_delayandd3cold_delay, that unnecessarily increases suspend and/or resume latencies.So, do not sleep at all for the respective cases of
d3_delayis zero ord3cold_delayis zero.Signed-off-by Adrian Hunter <[email protected]>--- drivers/pci/pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/pci/pci.c +4
-2@@ -66,7 +66,8 @@ static void pci_dev_d3_sleep(struct pci_dev *dev)if (delay < pci_pm_d3_delay) delay = pci_pm_d3_delay; -msleep (delay); +if (delay) +msleep (delay); }#ifdef CONFIG_PCI_DOMAINS @@ -827,7 +828,8 @@ static void __pci_start_power_transition(struct pci_dev *dev, pci_power_t state)* because have already delayed for the bridge. */ if (dev->runtime_d3cold) { -msleep (dev->d3cold_delay); +if (dev->d3cold_delay) +msleep (dev->d3cold_delay);/* * When powering on a bridge from D3cold, the * whole hierarchy may be powered on into
Quoted 9 lines · Adrian Hunter
msleep()still sleeps 1 jiffy even when told to sleep for zero milliseconds. That can end up being 1-2 milliseconds or more. In the cases ofd3_delayandd3cold_delay, that unnecessarily increases suspend and/or resume latencies.So, do not sleep at all for the respective cases of
d3_delayis zero ord3cold_delayis zero.Signed-off-by Adrian Hunter <[email protected]>
Quoted 35 lines
--- drivers/pci/pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/pci/pci.c +4
-3@@ -66,7 +66,8 @@ static void pci_dev_d3_sleep(struct pci_dev *dev)if (delay < pci_pm_d3_delay) delay = pci_pm_d3_delay; -msleep (delay); +if (delay) +msleep (delay); }#ifdef CONFIG_PCI_DOMAINS @@ -827,7 +828,8 @@ static void __pci_start_power_transition(struct pci_dev *dev, pci_power_t state)* because have already delayed for the bridge. */ if (dev->runtime_d3cold) { -msleep (dev->d3cold_delay); +if (dev->d3cold_delay) +msleep (dev->d3cold_delay);/* * When powering on a bridge from D3cold, the * whole hierarchy may be powered on into -- 1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 9 lines · Adrian Hunter
msleep()still sleeps 1 jiffy even when told to sleep for zero milliseconds. That can end up being 1-2 milliseconds or more. In the cases ofd3_delayandd3cold_delay, that unnecessarily increases suspend and/or resume latencies.So, do not sleep at all for the respective cases of
d3_delayis zero ord3cold_delayis zero.Signed-off-by Adrian Hunter <[email protected]>
Applied with Rafael's ack to pci/pm for v4.12, thanks!
Quoted 31 lines
--- drivers/pci/pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/pci/pci.c +4
-2@@ -66,7 +66,8 @@ static void pci_dev_d3_sleep(struct pci_dev *dev)if (delay < pci_pm_d3_delay) delay = pci_pm_d3_delay; -msleep (delay); +if (delay) +msleep (delay); }#ifdef CONFIG_PCI_DOMAINS @@ -827,7 +828,8 @@ static void __pci_start_power_transition(struct pci_dev *dev, pci_power_t state)* because have already delayed for the bridge. */ if (dev->runtime_d3cold) { -msleep (dev->d3cold_delay); +if (dev->d3cold_delay) +msleep (dev->d3cold_delay);/* * When powering on a bridge from D3cold, the * whole hierarchy may be powered on into Signature · 1 line
1.9.1