Skip to content

Commit 0d64787

Browse files
superm1jwrdegoede
authored andcommitted
platform/x86: amd-pmc: Drop CPU QoS workaround
A workaround was previously introduced as part of commit 646f429 ("platform/x86: amd-pmc: Set QOS during suspend on CZN w/ timer wakeup") to prevent CPUs from going into the deepest state during the execution of the `noirq` stage of `amd_pmc`. As `amd_pmc` has been pushed to the last step for suspend on AMD platforms, this workaround is no longer necessary. Signed-off-by: Mario Limonciello <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent 23f5f70 commit 0d64787

File tree

1 file changed

+3
-29
lines changed

1 file changed

+3
-29
lines changed

drivers/platform/x86/amd-pmc.c

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <linux/module.h>
2222
#include <linux/pci.h>
2323
#include <linux/platform_device.h>
24-
#include <linux/pm_qos.h>
2524
#include <linux/rtc.h>
2625
#include <linux/suspend.h>
2726
#include <linux/seq_file.h>
@@ -96,9 +95,6 @@
9695
#define PMC_MSG_DELAY_MIN_US 50
9796
#define RESPONSE_REGISTER_LOOP_MAX 20000
9897

99-
/* QoS request for letting CPUs in idle states, but not the deepest */
100-
#define AMD_PMC_MAX_IDLE_STATE_LATENCY 3
101-
10298
#define SOC_SUBSYSTEM_IP_MAX 12
10399
#define DELAY_MIN_US 2000
104100
#define DELAY_MAX_US 3000
@@ -153,7 +149,6 @@ struct amd_pmc_dev {
153149
struct device *dev;
154150
struct pci_dev *rdev;
155151
struct mutex lock; /* generic mutex lock */
156-
struct pm_qos_request amd_pmc_pm_qos_req;
157152
#if IS_ENABLED(CONFIG_DEBUG_FS)
158153
struct dentry *dbgfs_dir;
159154
#endif /* CONFIG_DEBUG_FS */
@@ -628,14 +623,6 @@ static int amd_pmc_verify_czn_rtc(struct amd_pmc_dev *pdev, u32 *arg)
628623
rc = rtc_alarm_irq_enable(rtc_device, 0);
629624
dev_dbg(pdev->dev, "wakeup timer programmed for %lld seconds\n", duration);
630625

631-
/*
632-
* Prevent CPUs from getting into deep idle states while sending OS_HINT
633-
* which is otherwise generally safe to send when at least one of the CPUs
634-
* is not in deep idle states.
635-
*/
636-
cpu_latency_qos_update_request(&pdev->amd_pmc_pm_qos_req, AMD_PMC_MAX_IDLE_STATE_LATENCY);
637-
wake_up_all_idle_cpus();
638-
639626
return rc;
640627
}
641628

@@ -655,7 +642,7 @@ static void amd_pmc_s2idle_prepare(void)
655642
rc = amd_pmc_verify_czn_rtc(pdev, &arg);
656643
if (rc) {
657644
dev_err(pdev->dev, "failed to set RTC: %d\n", rc);
658-
goto fail;
645+
return;
659646
}
660647
}
661648

@@ -665,20 +652,13 @@ static void amd_pmc_s2idle_prepare(void)
665652
rc = amd_pmc_send_cmd(pdev, arg, NULL, msg, 0);
666653
if (rc) {
667654
dev_err(pdev->dev, "suspend failed: %d\n", rc);
668-
goto fail;
655+
return;
669656
}
670657

671658
if (enable_stb)
672659
rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_PREDEF);
673-
if (rc) {
660+
if (rc)
674661
dev_err(pdev->dev, "error writing to STB: %d\n", rc);
675-
goto fail;
676-
}
677-
return;
678-
fail:
679-
if (pdev->cpu_id == AMD_CPU_ID_CZN)
680-
cpu_latency_qos_update_request(&pdev->amd_pmc_pm_qos_req,
681-
PM_QOS_DEFAULT_VALUE);
682662
}
683663

684664
static void amd_pmc_s2idle_restore(void)
@@ -704,11 +684,6 @@ static void amd_pmc_s2idle_restore(void)
704684
if (rc)
705685
dev_err(pdev->dev, "error writing to STB: %d\n", rc);
706686

707-
/* Restore the QoS request back to defaults if it was set */
708-
if (pdev->cpu_id == AMD_CPU_ID_CZN)
709-
cpu_latency_qos_update_request(&pdev->amd_pmc_pm_qos_req,
710-
PM_QOS_DEFAULT_VALUE);
711-
712687
/* Notify on failed entry */
713688
amd_pmc_validate_deepest(pdev);
714689
}
@@ -887,7 +862,6 @@ static int amd_pmc_probe(struct platform_device *pdev)
887862
dev_warn(dev->dev, "failed to register LPS0 sleep handler, expect increased power consumption\n");
888863

889864
amd_pmc_dbgfs_register(dev);
890-
cpu_latency_qos_add_request(&dev->amd_pmc_pm_qos_req, PM_QOS_DEFAULT_VALUE);
891865
return 0;
892866

893867
err_pci_dev_put:

0 commit comments

Comments
 (0)