Skip to content

Commit 062c139

Browse files
superm1jwrdegoede
authored andcommitted
platform/x86/amd: pmc: Add a module parameter to disable workarounds
Some users may want to live with the bugs that exist in platform firmware and have workarounds in AMD PMC driver. To allow them to bypass these workarounds, introduce a module parameter. 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 8e60615 commit 062c139

File tree

1 file changed

+7
-3
lines changed
  • drivers/platform/x86/amd

1 file changed

+7
-3
lines changed

drivers/platform/x86/amd/pmc.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ static bool enable_stb;
161161
module_param(enable_stb, bool, 0644);
162162
MODULE_PARM_DESC(enable_stb, "Enable the STB debug mechanism");
163163

164+
static bool disable_workarounds;
165+
module_param(disable_workarounds, bool, 0644);
166+
MODULE_PARM_DESC(disable_workarounds, "Disable workarounds for platform bugs");
167+
164168
static struct amd_pmc_dev pmc;
165169
static int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool ret);
166170
static int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf);
@@ -743,8 +747,8 @@ static void amd_pmc_s2idle_prepare(void)
743747
/* Reset and Start SMU logging - to monitor the s0i3 stats */
744748
amd_pmc_setup_smu_logging(pdev);
745749

746-
/* Activate CZN specific RTC functionality */
747-
if (pdev->cpu_id == AMD_CPU_ID_CZN) {
750+
/* Activate CZN specific platform bug workarounds */
751+
if (pdev->cpu_id == AMD_CPU_ID_CZN && !disable_workarounds) {
748752
rc = amd_pmc_verify_czn_rtc(pdev, &arg);
749753
if (rc) {
750754
dev_err(pdev->dev, "failed to set RTC: %d\n", rc);
@@ -815,7 +819,7 @@ static int __maybe_unused amd_pmc_suspend_handler(struct device *dev)
815819
{
816820
struct amd_pmc_dev *pdev = dev_get_drvdata(dev);
817821

818-
if (pdev->cpu_id == AMD_CPU_ID_CZN) {
822+
if (pdev->cpu_id == AMD_CPU_ID_CZN && !disable_workarounds) {
819823
int rc = amd_pmc_czn_wa_irq1(pdev);
820824

821825
if (rc) {

0 commit comments

Comments
 (0)