platform-drivers-x86 for v5.11-2
A small collection of bug-fixes and model-specific quirks for 5.11. The following is an automated git shortlog grouped by driver: amd-pmc: - Fix CONFIG_DEBUG_FS check hp-wmi: - Don't log a warning on HPWMI_RET_UNKNOWN_COMMAND errors i2c-multi-instantiate: - Don't create platform device for INT3515 ACPI nodes ideapad-laptop: - Disable touchpad_switch for ELAN0634 intel-vbtn: - Drop HP Stream x360 Convertible PC 11 from allow-list - Support for tablet mode on Dell Inspiron 7352 platform/surface: - SURFACE_PLATFORMS should depend on ACPI - surface_gpe: Fix non-PM_SLEEP build warnings thinkpad_acpi: - Add P53/73 firmware to fan_quirk_table for dual fan control - correct palmsensor error checking tools/power/x86/intel-speed-select: - Set higher of cpuinfo_max_freq or base_frequency - Set scaling_max_freq to base_frequency touchscreen_dmi: - Add swap-x-y quirk for Goodix touchscreen on Estar Beauty HD tablet -----BEGIN PGP SIGNATURE----- iQFIBAABCAAyFiEEuvA7XScYQRpenhd+kuxHeUQDJ9wFAmAKkwMUHGhkZWdvZWRl QHJlZGhhdC5jb20ACgkQkuxHeUQDJ9wSKQf9Gr04Nb+F50SReA+OA9nrAjvm9m1b HKl0hSXQXTDydsKyJ7WujtuiW4MocMjSkLQQpL9CEfdPdhCCVld/2lpMsE7F6VcJ wto0DZATbNwdACeiDSPcORYThpbIC+pzYHgQRJJWX31vR2aRqpi8mmzg0VBQdKco IMFoyg5HrD1ZS20Zw0Ho4bBbZFeE0J3NegcU9tloo6AS5PJeadDeHaiSjMedPecP squrCBni3hC04NTaIRX2yODVvQjopR0XV4H4YKd8UxyU3yW6UfG4rK11UHOmZHTd qdOdgUQqUn8Y2lgOZJbkoP+wpbJSYbYberQUC43PltWpf++JLhhS7GNLEA== =EU2D -----END PGP SIGNATURE----- Merge tag 'platform-drivers-x86-v5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: "A small collection of bug-fixes and model-specific quirks" * tag 'platform-drivers-x86-v5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: thinkpad_acpi: Add P53/73 firmware to fan_quirk_table for dual fan control platform/x86: hp-wmi: Don't log a warning on HPWMI_RET_UNKNOWN_COMMAND errors platform/x86: intel-vbtn: Drop HP Stream x360 Convertible PC 11 from allow-list platform/x86: ideapad-laptop: Disable touchpad_switch for ELAN0634 platform/x86: amd-pmc: Fix CONFIG_DEBUG_FS check platform/x86: thinkpad_acpi: correct palmsensor error checking platform/x86: intel-vbtn: Support for tablet mode on Dell Inspiron 7352 platform/x86: touchscreen_dmi: Add swap-x-y quirk for Goodix touchscreen on Estar Beauty HD tablet platform/x86: i2c-multi-instantiate: Don't create platform device for INT3515 ACPI nodes platform/surface: SURFACE_PLATFORMS should depend on ACPI platform/surface: surface_gpe: Fix non-PM_SLEEP build warnings tools/power/x86/intel-speed-select: Set higher of cpuinfo_max_freq or base_frequency tools/power/x86/intel-speed-select: Set scaling_max_freq to base_frequency
This commit is contained in:
commit
9887e9af2d
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
menuconfig SURFACE_PLATFORMS
|
menuconfig SURFACE_PLATFORMS
|
||||||
bool "Microsoft Surface Platform-Specific Device Drivers"
|
bool "Microsoft Surface Platform-Specific Device Drivers"
|
||||||
|
depends on ACPI
|
||||||
default y
|
default y
|
||||||
help
|
help
|
||||||
Say Y here to get to see options for platform-specific device drivers
|
Say Y here to get to see options for platform-specific device drivers
|
||||||
|
@ -29,20 +30,19 @@ config SURFACE3_WMI
|
||||||
|
|
||||||
config SURFACE_3_BUTTON
|
config SURFACE_3_BUTTON
|
||||||
tristate "Power/home/volume buttons driver for Microsoft Surface 3 tablet"
|
tristate "Power/home/volume buttons driver for Microsoft Surface 3 tablet"
|
||||||
depends on ACPI && KEYBOARD_GPIO && I2C
|
depends on KEYBOARD_GPIO && I2C
|
||||||
help
|
help
|
||||||
This driver handles the power/home/volume buttons on the Microsoft Surface 3 tablet.
|
This driver handles the power/home/volume buttons on the Microsoft Surface 3 tablet.
|
||||||
|
|
||||||
config SURFACE_3_POWER_OPREGION
|
config SURFACE_3_POWER_OPREGION
|
||||||
tristate "Surface 3 battery platform operation region support"
|
tristate "Surface 3 battery platform operation region support"
|
||||||
depends on ACPI && I2C
|
depends on I2C
|
||||||
help
|
help
|
||||||
This driver provides support for ACPI operation
|
This driver provides support for ACPI operation
|
||||||
region of the Surface 3 battery platform driver.
|
region of the Surface 3 battery platform driver.
|
||||||
|
|
||||||
config SURFACE_GPE
|
config SURFACE_GPE
|
||||||
tristate "Surface GPE/Lid Support Driver"
|
tristate "Surface GPE/Lid Support Driver"
|
||||||
depends on ACPI
|
|
||||||
depends on DMI
|
depends on DMI
|
||||||
help
|
help
|
||||||
This driver marks the GPEs related to the ACPI lid device found on
|
This driver marks the GPEs related to the ACPI lid device found on
|
||||||
|
@ -52,7 +52,7 @@ config SURFACE_GPE
|
||||||
|
|
||||||
config SURFACE_PRO3_BUTTON
|
config SURFACE_PRO3_BUTTON
|
||||||
tristate "Power/home/volume buttons driver for Microsoft Surface Pro 3/4 tablet"
|
tristate "Power/home/volume buttons driver for Microsoft Surface Pro 3/4 tablet"
|
||||||
depends on ACPI && INPUT
|
depends on INPUT
|
||||||
help
|
help
|
||||||
This driver handles the power/home/volume buttons on the Microsoft Surface Pro 3/4 tablet.
|
This driver handles the power/home/volume buttons on the Microsoft Surface Pro 3/4 tablet.
|
||||||
|
|
||||||
|
|
|
@ -181,12 +181,12 @@ static int surface_lid_enable_wakeup(struct device *dev, bool enable)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int surface_gpe_suspend(struct device *dev)
|
static int __maybe_unused surface_gpe_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
return surface_lid_enable_wakeup(dev, true);
|
return surface_lid_enable_wakeup(dev, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int surface_gpe_resume(struct device *dev)
|
static int __maybe_unused surface_gpe_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
return surface_lid_enable_wakeup(dev, false);
|
return surface_lid_enable_wakeup(dev, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ static inline void amd_pmc_reg_write(struct amd_pmc_dev *dev, int reg_offset, u3
|
||||||
iowrite32(val, dev->regbase + reg_offset);
|
iowrite32(val, dev->regbase + reg_offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
static int smu_fw_info_show(struct seq_file *s, void *unused)
|
static int smu_fw_info_show(struct seq_file *s, void *unused)
|
||||||
{
|
{
|
||||||
struct amd_pmc_dev *dev = s->private;
|
struct amd_pmc_dev *dev = s->private;
|
||||||
|
|
|
@ -247,7 +247,8 @@ static int hp_wmi_perform_query(int query, enum hp_wmi_command command,
|
||||||
ret = bios_return->return_code;
|
ret = bios_return->return_code;
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
if (ret != HPWMI_RET_UNKNOWN_CMDTYPE)
|
if (ret != HPWMI_RET_UNKNOWN_COMMAND &&
|
||||||
|
ret != HPWMI_RET_UNKNOWN_CMDTYPE)
|
||||||
pr_warn("query 0x%x returned error 0x%x\n", query, ret);
|
pr_warn("query 0x%x returned error 0x%x\n", query, ret);
|
||||||
goto out_free;
|
goto out_free;
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,13 +164,29 @@ static const struct i2c_inst_data bsg2150_data[] = {
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct i2c_inst_data int3515_data[] = {
|
/*
|
||||||
{ "tps6598x", IRQ_RESOURCE_APIC, 0 },
|
* Device with _HID INT3515 (TI PD controllers) has some unresolved interrupt
|
||||||
{ "tps6598x", IRQ_RESOURCE_APIC, 1 },
|
* issues. The most common problem seen is interrupt flood.
|
||||||
{ "tps6598x", IRQ_RESOURCE_APIC, 2 },
|
*
|
||||||
{ "tps6598x", IRQ_RESOURCE_APIC, 3 },
|
* There are at least two known causes. Firstly, on some boards, the
|
||||||
{}
|
* I2CSerialBus resource index does not match the Interrupt resource, i.e. they
|
||||||
};
|
* are not one-to-one mapped like in the array below. Secondly, on some boards
|
||||||
|
* the IRQ line from the PD controller is not actually connected at all. But the
|
||||||
|
* interrupt flood is also seen on some boards where those are not a problem, so
|
||||||
|
* there are some other problems as well.
|
||||||
|
*
|
||||||
|
* Because of the issues with the interrupt, the device is disabled for now. If
|
||||||
|
* you wish to debug the issues, uncomment the below, and add an entry for the
|
||||||
|
* INT3515 device to the i2c_multi_instance_ids table.
|
||||||
|
*
|
||||||
|
* static const struct i2c_inst_data int3515_data[] = {
|
||||||
|
* { "tps6598x", IRQ_RESOURCE_APIC, 0 },
|
||||||
|
* { "tps6598x", IRQ_RESOURCE_APIC, 1 },
|
||||||
|
* { "tps6598x", IRQ_RESOURCE_APIC, 2 },
|
||||||
|
* { "tps6598x", IRQ_RESOURCE_APIC, 3 },
|
||||||
|
* { }
|
||||||
|
* };
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note new device-ids must also be added to i2c_multi_instantiate_ids in
|
* Note new device-ids must also be added to i2c_multi_instantiate_ids in
|
||||||
|
@ -179,7 +195,6 @@ static const struct i2c_inst_data int3515_data[] = {
|
||||||
static const struct acpi_device_id i2c_multi_inst_acpi_ids[] = {
|
static const struct acpi_device_id i2c_multi_inst_acpi_ids[] = {
|
||||||
{ "BSG1160", (unsigned long)bsg1160_data },
|
{ "BSG1160", (unsigned long)bsg1160_data },
|
||||||
{ "BSG2150", (unsigned long)bsg2150_data },
|
{ "BSG2150", (unsigned long)bsg2150_data },
|
||||||
{ "INT3515", (unsigned long)int3515_data },
|
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(acpi, i2c_multi_inst_acpi_ids);
|
MODULE_DEVICE_TABLE(acpi, i2c_multi_inst_acpi_ids);
|
||||||
|
|
|
@ -92,6 +92,7 @@ struct ideapad_private {
|
||||||
struct dentry *debug;
|
struct dentry *debug;
|
||||||
unsigned long cfg;
|
unsigned long cfg;
|
||||||
bool has_hw_rfkill_switch;
|
bool has_hw_rfkill_switch;
|
||||||
|
bool has_touchpad_switch;
|
||||||
const char *fnesc_guid;
|
const char *fnesc_guid;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -535,7 +536,9 @@ static umode_t ideapad_is_visible(struct kobject *kobj,
|
||||||
} else if (attr == &dev_attr_fn_lock.attr) {
|
} else if (attr == &dev_attr_fn_lock.attr) {
|
||||||
supported = acpi_has_method(priv->adev->handle, "HALS") &&
|
supported = acpi_has_method(priv->adev->handle, "HALS") &&
|
||||||
acpi_has_method(priv->adev->handle, "SALS");
|
acpi_has_method(priv->adev->handle, "SALS");
|
||||||
} else
|
} else if (attr == &dev_attr_touchpad.attr)
|
||||||
|
supported = priv->has_touchpad_switch;
|
||||||
|
else
|
||||||
supported = true;
|
supported = true;
|
||||||
|
|
||||||
return supported ? attr->mode : 0;
|
return supported ? attr->mode : 0;
|
||||||
|
@ -867,6 +870,9 @@ static void ideapad_sync_touchpad_state(struct ideapad_private *priv)
|
||||||
{
|
{
|
||||||
unsigned long value;
|
unsigned long value;
|
||||||
|
|
||||||
|
if (!priv->has_touchpad_switch)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Without reading from EC touchpad LED doesn't switch state */
|
/* Without reading from EC touchpad LED doesn't switch state */
|
||||||
if (!read_ec_data(priv->adev->handle, VPCCMD_R_TOUCHPAD, &value)) {
|
if (!read_ec_data(priv->adev->handle, VPCCMD_R_TOUCHPAD, &value)) {
|
||||||
/* Some IdeaPads don't really turn off touchpad - they only
|
/* Some IdeaPads don't really turn off touchpad - they only
|
||||||
|
@ -989,6 +995,9 @@ static int ideapad_acpi_add(struct platform_device *pdev)
|
||||||
priv->platform_device = pdev;
|
priv->platform_device = pdev;
|
||||||
priv->has_hw_rfkill_switch = dmi_check_system(hw_rfkill_list);
|
priv->has_hw_rfkill_switch = dmi_check_system(hw_rfkill_list);
|
||||||
|
|
||||||
|
/* Most ideapads with ELAN0634 touchpad don't use EC touchpad switch */
|
||||||
|
priv->has_touchpad_switch = !acpi_dev_present("ELAN0634", NULL, -1);
|
||||||
|
|
||||||
ret = ideapad_sysfs_init(priv);
|
ret = ideapad_sysfs_init(priv);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1006,6 +1015,10 @@ static int ideapad_acpi_add(struct platform_device *pdev)
|
||||||
if (!priv->has_hw_rfkill_switch)
|
if (!priv->has_hw_rfkill_switch)
|
||||||
write_ec_cmd(priv->adev->handle, VPCCMD_W_RF, 1);
|
write_ec_cmd(priv->adev->handle, VPCCMD_W_RF, 1);
|
||||||
|
|
||||||
|
/* The same for Touchpad */
|
||||||
|
if (!priv->has_touchpad_switch)
|
||||||
|
write_ec_cmd(priv->adev->handle, VPCCMD_W_TOUCHPAD, 1);
|
||||||
|
|
||||||
for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++)
|
for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++)
|
||||||
if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg))
|
if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg))
|
||||||
ideapad_register_rfkill(priv, i);
|
ideapad_register_rfkill(priv, i);
|
||||||
|
|
|
@ -204,12 +204,6 @@ static const struct dmi_system_id dmi_switches_allow_list[] = {
|
||||||
DMI_MATCH(DMI_PRODUCT_NAME, "Venue 11 Pro 7130"),
|
DMI_MATCH(DMI_PRODUCT_NAME, "Venue 11 Pro 7130"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
.matches = {
|
|
||||||
DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
|
|
||||||
DMI_MATCH(DMI_PRODUCT_NAME, "HP Stream x360 Convertible PC 11"),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
.matches = {
|
.matches = {
|
||||||
DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
|
DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
|
||||||
|
@ -222,6 +216,12 @@ static const struct dmi_system_id dmi_switches_allow_list[] = {
|
||||||
DMI_MATCH(DMI_PRODUCT_NAME, "Switch SA5-271"),
|
DMI_MATCH(DMI_PRODUCT_NAME, "Switch SA5-271"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.matches = {
|
||||||
|
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
|
||||||
|
DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7352"),
|
||||||
|
},
|
||||||
|
},
|
||||||
{} /* Array terminator */
|
{} /* Array terminator */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -8783,6 +8783,7 @@ static const struct tpacpi_quirk fan_quirk_table[] __initconst = {
|
||||||
TPACPI_Q_LNV3('N', '1', 'T', TPACPI_FAN_2CTL), /* P71 */
|
TPACPI_Q_LNV3('N', '1', 'T', TPACPI_FAN_2CTL), /* P71 */
|
||||||
TPACPI_Q_LNV3('N', '1', 'U', TPACPI_FAN_2CTL), /* P51 */
|
TPACPI_Q_LNV3('N', '1', 'U', TPACPI_FAN_2CTL), /* P51 */
|
||||||
TPACPI_Q_LNV3('N', '2', 'C', TPACPI_FAN_2CTL), /* P52 / P72 */
|
TPACPI_Q_LNV3('N', '2', 'C', TPACPI_FAN_2CTL), /* P52 / P72 */
|
||||||
|
TPACPI_Q_LNV3('N', '2', 'N', TPACPI_FAN_2CTL), /* P53 / P73 */
|
||||||
TPACPI_Q_LNV3('N', '2', 'E', TPACPI_FAN_2CTL), /* P1 / X1 Extreme (1st gen) */
|
TPACPI_Q_LNV3('N', '2', 'E', TPACPI_FAN_2CTL), /* P1 / X1 Extreme (1st gen) */
|
||||||
TPACPI_Q_LNV3('N', '2', 'O', TPACPI_FAN_2CTL), /* P1 / X1 Extreme (2nd gen) */
|
TPACPI_Q_LNV3('N', '2', 'O', TPACPI_FAN_2CTL), /* P1 / X1 Extreme (2nd gen) */
|
||||||
TPACPI_Q_LNV3('N', '2', 'V', TPACPI_FAN_2CTL), /* P1 / X1 Extreme (3nd gen) */
|
TPACPI_Q_LNV3('N', '2', 'V', TPACPI_FAN_2CTL), /* P1 / X1 Extreme (3nd gen) */
|
||||||
|
@ -9951,9 +9952,9 @@ static int tpacpi_proxsensor_init(struct ibm_init_struct *iibm)
|
||||||
if ((palm_err == -ENODEV) && (lap_err == -ENODEV))
|
if ((palm_err == -ENODEV) && (lap_err == -ENODEV))
|
||||||
return 0;
|
return 0;
|
||||||
/* Otherwise, if there was an error return it */
|
/* Otherwise, if there was an error return it */
|
||||||
if (palm_err && (palm_err != ENODEV))
|
if (palm_err && (palm_err != -ENODEV))
|
||||||
return palm_err;
|
return palm_err;
|
||||||
if (lap_err && (lap_err != ENODEV))
|
if (lap_err && (lap_err != -ENODEV))
|
||||||
return lap_err;
|
return lap_err;
|
||||||
|
|
||||||
if (has_palmsensor) {
|
if (has_palmsensor) {
|
||||||
|
|
|
@ -263,6 +263,16 @@ static const struct ts_dmi_data digma_citi_e200_data = {
|
||||||
.properties = digma_citi_e200_props,
|
.properties = digma_citi_e200_props,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct property_entry estar_beauty_hd_props[] = {
|
||||||
|
PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
|
||||||
|
{ }
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct ts_dmi_data estar_beauty_hd_data = {
|
||||||
|
.acpi_name = "GDIX1001:00",
|
||||||
|
.properties = estar_beauty_hd_props,
|
||||||
|
};
|
||||||
|
|
||||||
static const struct property_entry gp_electronic_t701_props[] = {
|
static const struct property_entry gp_electronic_t701_props[] = {
|
||||||
PROPERTY_ENTRY_U32("touchscreen-size-x", 960),
|
PROPERTY_ENTRY_U32("touchscreen-size-x", 960),
|
||||||
PROPERTY_ENTRY_U32("touchscreen-size-y", 640),
|
PROPERTY_ENTRY_U32("touchscreen-size-y", 640),
|
||||||
|
@ -942,6 +952,14 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
|
||||||
DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
|
DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
/* Estar Beauty HD (MID 7316R) */
|
||||||
|
.driver_data = (void *)&estar_beauty_hd_data,
|
||||||
|
.matches = {
|
||||||
|
DMI_MATCH(DMI_SYS_VENDOR, "Estar"),
|
||||||
|
DMI_MATCH(DMI_PRODUCT_NAME, "eSTAR BEAUTY HD Intel Quad core"),
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
/* GP-electronic T701 */
|
/* GP-electronic T701 */
|
||||||
.driver_data = (void *)&gp_electronic_t701_data,
|
.driver_data = (void *)&gp_electronic_t701_data,
|
||||||
|
|
|
@ -1249,6 +1249,8 @@ static void dump_isst_config(int arg)
|
||||||
isst_ctdp_display_information_end(outf);
|
isst_ctdp_display_information_end(outf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void adjust_scaling_max_from_base_freq(int cpu);
|
||||||
|
|
||||||
static void set_tdp_level_for_cpu(int cpu, void *arg1, void *arg2, void *arg3,
|
static void set_tdp_level_for_cpu(int cpu, void *arg1, void *arg2, void *arg3,
|
||||||
void *arg4)
|
void *arg4)
|
||||||
{
|
{
|
||||||
|
@ -1267,6 +1269,9 @@ static void set_tdp_level_for_cpu(int cpu, void *arg1, void *arg2, void *arg3,
|
||||||
int pkg_id = get_physical_package_id(cpu);
|
int pkg_id = get_physical_package_id(cpu);
|
||||||
int die_id = get_physical_die_id(cpu);
|
int die_id = get_physical_die_id(cpu);
|
||||||
|
|
||||||
|
/* Wait for updated base frequencies */
|
||||||
|
usleep(2000);
|
||||||
|
|
||||||
fprintf(stderr, "Option is set to online/offline\n");
|
fprintf(stderr, "Option is set to online/offline\n");
|
||||||
ctdp_level.core_cpumask_size =
|
ctdp_level.core_cpumask_size =
|
||||||
alloc_cpu_set(&ctdp_level.core_cpumask);
|
alloc_cpu_set(&ctdp_level.core_cpumask);
|
||||||
|
@ -1283,6 +1288,7 @@ static void set_tdp_level_for_cpu(int cpu, void *arg1, void *arg2, void *arg3,
|
||||||
if (CPU_ISSET_S(i, ctdp_level.core_cpumask_size, ctdp_level.core_cpumask)) {
|
if (CPU_ISSET_S(i, ctdp_level.core_cpumask_size, ctdp_level.core_cpumask)) {
|
||||||
fprintf(stderr, "online cpu %d\n", i);
|
fprintf(stderr, "online cpu %d\n", i);
|
||||||
set_cpu_online_offline(i, 1);
|
set_cpu_online_offline(i, 1);
|
||||||
|
adjust_scaling_max_from_base_freq(i);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "offline cpu %d\n", i);
|
fprintf(stderr, "offline cpu %d\n", i);
|
||||||
set_cpu_online_offline(i, 0);
|
set_cpu_online_offline(i, 0);
|
||||||
|
@ -1440,6 +1446,31 @@ static int set_cpufreq_scaling_min_max(int cpu, int max, int freq)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int no_turbo(void)
|
||||||
|
{
|
||||||
|
return parse_int_file(0, "/sys/devices/system/cpu/intel_pstate/no_turbo");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void adjust_scaling_max_from_base_freq(int cpu)
|
||||||
|
{
|
||||||
|
int base_freq, scaling_max_freq;
|
||||||
|
|
||||||
|
scaling_max_freq = parse_int_file(0, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_max_freq", cpu);
|
||||||
|
base_freq = get_cpufreq_base_freq(cpu);
|
||||||
|
if (scaling_max_freq < base_freq || no_turbo())
|
||||||
|
set_cpufreq_scaling_min_max(cpu, 1, base_freq);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void adjust_scaling_min_from_base_freq(int cpu)
|
||||||
|
{
|
||||||
|
int base_freq, scaling_min_freq;
|
||||||
|
|
||||||
|
scaling_min_freq = parse_int_file(0, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_min_freq", cpu);
|
||||||
|
base_freq = get_cpufreq_base_freq(cpu);
|
||||||
|
if (scaling_min_freq < base_freq)
|
||||||
|
set_cpufreq_scaling_min_max(cpu, 0, base_freq);
|
||||||
|
}
|
||||||
|
|
||||||
static int set_clx_pbf_cpufreq_scaling_min_max(int cpu)
|
static int set_clx_pbf_cpufreq_scaling_min_max(int cpu)
|
||||||
{
|
{
|
||||||
struct isst_pkg_ctdp_level_info *ctdp_level;
|
struct isst_pkg_ctdp_level_info *ctdp_level;
|
||||||
|
@ -1537,6 +1568,7 @@ static void set_scaling_min_to_cpuinfo_max(int cpu)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
set_cpufreq_scaling_min_max_from_cpuinfo(i, 1, 0);
|
set_cpufreq_scaling_min_max_from_cpuinfo(i, 1, 0);
|
||||||
|
adjust_scaling_min_from_base_freq(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue