Skip to contentSkip to conversation

platform/x86: thinkpad_acpi: do not use PSC mode on Intel platforms

PATCH Superseded Mark Pearson 2 participants 4 messages Jun 22, 2022 – Jun 27, 2022 x86 platform drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: thinkpad_acpi: do not use PSC mode on Intel platforms

PSC platform profile mode is only supported on Linux for AMD platforms.

Some older Intel platforms (e.g T490) are advertising it's capability as Windows uses it - but on Linux we should only be using MMC profile for Intel systems.

Add a check to prevent it being enabled incorrectly.

---
 drivers/platform/x86/thinkpad_acpi.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/platform/x86/thinkpad_acpi.c +5 -0
index e6cb4a14cdd4..be194be43663 100644
@@ -10548,6 +10548,11 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
 				dytc_mmc_get_available = true;
 		}
 	} else if (output & BIT(DYTC_FC_PSC)) { /* PSC MODE */
+		/* Support for this only works on AMD platforms */
+		if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) {
+			dbg_printk(TPACPI_DBG_INIT, "PSC not support on Intel platforms\n");
+			return -ENODEV;
+		}
 		dytc_profile_available = DYTC_FUNCMODE_PSC;
 	} else {
 		dbg_printk(TPACPI_DBG_INIT, "No DYTC support available\n");
Signature · 1 line
2.35.1
#1 lore raw

Hi,

Quoted 18 lines · Mark Pearson

PSC platform profile mode is only supported on Linux for AMD platforms.

Some older Intel platforms (e.g T490) are advertising it's capability as Windows uses it - but on Linux we should only be using MMC profile for Intel systems.

Add a check to prevent it being enabled incorrectly.

---
 drivers/platform/x86/thinkpad_acpi.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/platform/x86/thinkpad_acpi.c +0 -0
index e6cb4a14cdd4..be194be43663 100644

drivers/platform/x86/thinkpad_acpi.c static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm) · line 10550

Quoted 3 lines
drivers/platform/x86/thinkpad_acpi.c +0 -0
@@ -10548,6 +10548,11 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
 				dytc_mmc_get_available = true;
 		}
 	} else if (output & BIT(DYTC_FC_PSC)) { /* PSC MODE */

After your recent patch series this now reads:

        } else if (dytc_capabilities & BIT(DYTC_FC_PSC)) { /* PSC MODE */

Please rebase on pdx86/for-next and send a new version.

drivers/platform/x86/thinkpad_acpi.c static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm) · line 10555

Quoted 5 lines
drivers/platform/x86/thinkpad_acpi.c +5 -0
+		/* Support for this only works on AMD platforms */
+		if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) {
+			dbg_printk(TPACPI_DBG_INIT, "PSC not support on Intel platforms\n");
+			return -ENODEV;
+		}

So I assume that e.g. the T490 does advertise MMC capability so this path is not actually hit there ?

IOW this is just a sanity check. Or is this path being hit on actual hw? The reason I'm asking is because if the path is being hit on actual hw then the patch should go to my fixes branch too.

Regards,

Hans

Quoted 3 lines
drivers/platform/x86/thinkpad_acpi.c +0 -0
 		dytc_profile_available = DYTC_FUNCMODE_PSC;
 	} else {
 		dbg_printk(TPACPI_DBG_INIT, "No DYTC support available\n");
#2 lore raw

Hi Hans

Quoted 27 lines · Hans de Goede

Hi,

Quoted 18 lines · Mark Pearson

PSC platform profile mode is only supported on Linux for AMD platforms.

Some older Intel platforms (e.g T490) are advertising it's capability as Windows uses it - but on Linux we should only be using MMC profile for Intel systems.

Add a check to prevent it being enabled incorrectly.

---
 drivers/platform/x86/thinkpad_acpi.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/platform/x86/thinkpad_acpi.c +0 -0
index e6cb4a14cdd4..be194be43663 100644

drivers/platform/x86/thinkpad_acpi.c static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm) · line 10550

Quoted 3 lines
drivers/platform/x86/thinkpad_acpi.c +0 -0
@@ -10548,6 +10548,11 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
 				dytc_mmc_get_available = true;
 		}
 	} else if (output & BIT(DYTC_FC_PSC)) { /* PSC MODE */

After your recent patch series this now reads:

Quoted 3 lines
        } else if (dytc_capabilities & BIT(DYTC_FC_PSC)) { /* PSC MODE */

Please rebase on pdx86/for-next and send a new version.

Ack - will do.

Quoted 11 lines

drivers/platform/x86/thinkpad_acpi.c static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm) · line 10555

Quoted 8 lines
drivers/platform/x86/thinkpad_acpi.c +5 -0
+		/* Support for this only works on AMD platforms */
+		if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) {
+			dbg_printk(TPACPI_DBG_INIT, "PSC not support on Intel platforms\n");
+			return -ENODEV;
+		}

So I assume that e.g. the T490 does advertise MMC capability so this path is not actually hit there ?

No - they don't have MMC so this path is hit.

Quoted 5 lines

IOW this is just a sanity check. Or is this path being hit on actual hw? The reason I'm asking is because if the path is being hit on actual hw then the patch should go to my fixes branch too.

This is being hit on a few of the Intel platforms of that generation. It seems they don't have MMC mode support, but do have PSC mode - but that only works on Windows for Intel (needs driver changes we don't have).

Thanks
Mark

#3 lore raw

Hi,

Quoted 50 lines · Mark Pearson

Hi Hans

Quoted 27 lines · Hans de Goede

Hi,

Quoted 18 lines · Mark Pearson

PSC platform profile mode is only supported on Linux for AMD platforms.

Some older Intel platforms (e.g T490) are advertising it's capability as Windows uses it - but on Linux we should only be using MMC profile for Intel systems.

Add a check to prevent it being enabled incorrectly.

---
 drivers/platform/x86/thinkpad_acpi.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/platform/x86/thinkpad_acpi.c +0 -0
index e6cb4a14cdd4..be194be43663 100644

drivers/platform/x86/thinkpad_acpi.c static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm) · line 10550

Quoted 3 lines
drivers/platform/x86/thinkpad_acpi.c +0 -0
@@ -10548,6 +10548,11 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
 				dytc_mmc_get_available = true;
 		}
 	} else if (output & BIT(DYTC_FC_PSC)) { /* PSC MODE */

After your recent patch series this now reads:

Quoted 3 lines
        } else if (dytc_capabilities & BIT(DYTC_FC_PSC)) { /* PSC MODE */

Please rebase on pdx86/for-next and send a new version.

Ack - will do.

Quoted 11 lines

drivers/platform/x86/thinkpad_acpi.c static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm) · line 10555

Quoted 8 lines
drivers/platform/x86/thinkpad_acpi.c +5 -0
+		/* Support for this only works on AMD platforms */
+		if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) {
+			dbg_printk(TPACPI_DBG_INIT, "PSC not support on Intel platforms\n");
+			return -ENODEV;
+		}

So I assume that e.g. the T490 does advertise MMC capability so this path is not actually hit there ?

No - they don't have MMC so this path is hit.

Quoted 1 line
Quoted 7 lines
Quoted 4 lines

IOW this is just a sanity check. Or is this path being hit on actual hw? The reason I'm asking is because if the path is being hit on actual hw then the patch should go to my fixes branch too.

This is being hit on a few of the Intel platforms of that generation. It seems they don't have MMC mode support, but do have PSC mode - but that only works on Windows for Intel (needs driver changes we don't have).

Ok, once I have a new version of this, I'll add it to my fixes branch then.

Regards,

Hans