/* Amount of time for each cooling delay, 100ms by default for now */ staticunsignedint delay_timeout = 100;
module_param(delay_timeout, int, 0644);
MODULE_PARM_DESC(delay_timeout, "amount of time delay for each iteration.");
/* Number of iterations for cooling delay, 600 counts by default for now */ staticunsignedint delay_cnt = 600;
module_param(delay_cnt, int, 0644);
MODULE_PARM_DESC(delay_cnt, "total number of iterations for time delay.");
#ifdef CONFIG_ACPI /* * On some platforms, there is a companion ACPI device, which adds * passive trip temperature using _PSV method. There is no specific * passive temperature setting in MMIO interface of this PCI device.
*/ staticint pch_wpt_add_acpi_psv_trip(struct pch_thermal_device *ptd, struct thermal_trip *trip)
{ struct acpi_device *adev; int temp;
adev = ACPI_COMPANION(&ptd->pdev->dev); if (!adev) return 0;
if (thermal_acpi_passive_trip_temp(adev, &temp) || temp <= 0) return 0;
/* Shutdown the thermal sensor if it is not enabled by BIOS */ if (!ptd->bios_enabled) {
tsel = readb(ptd->hw_base + WPT_TSEL);
writeb(tsel & 0xFE, ptd->hw_base + WPT_TSEL); return 0;
}
/* Do not check temperature if it is not s2idle */ if (pm_suspend_via_firmware()) return 0;
/* Get the PCH temperature threshold value */
pch_thr_temp = GET_PCH_TEMP(WPT_TEMP_TSR & readw(ptd->hw_base + WPT_TSPM));
/* Get the PCH current temperature value */
pch_cur_temp = GET_PCH_TEMP(WPT_TEMP_TSR & readw(ptd->hw_base + WPT_TEMP));
if (pch_cur_temp >= pch_thr_temp)
dev_warn(&ptd->pdev->dev, "CPU-PCH current temp [%dC] higher than the threshold temp [%dC], S0ix might fail. Start cooling...\n",
pch_cur_temp, pch_thr_temp);
/* * If current PCH temperature is higher than configured PCH threshold * value, run some delay loop with sleep to let the current temperature * go down below the threshold value which helps to allow system enter * lower power S0ix suspend state. Even after delay loop if PCH current * temperature stays above threshold, notify the warning message * which helps to indentify the reason why S0ix entry was rejected.
*/ while (pch_delay_cnt < delay_cnt) { if (pch_cur_temp < pch_thr_temp) break;
pch_delay_cnt++;
dev_dbg(&ptd->pdev->dev, "CPU-PCH current temp [%dC] higher than the threshold temp [%dC], sleep %d times for %d ms duration\n",
pch_cur_temp, pch_thr_temp, pch_delay_cnt, delay_timeout);
msleep(delay_timeout); /* Read the PCH current temperature for next cycle. */
pch_cur_temp = GET_PCH_TEMP(WPT_TEMP_TSR & readw(ptd->hw_base + WPT_TEMP));
}
if (pch_cur_temp >= pch_thr_temp)
dev_warn(&ptd->pdev->dev, "CPU-PCH is hot [%dC] after %d ms delay. S0ix might fail\n",
pch_cur_temp, pch_delay_cnt * delay_timeout); else { if (pch_delay_cnt)
dev_info(&ptd->pdev->dev, "CPU-PCH is cool [%dC] after %d ms delay\n",
pch_cur_temp, pch_delay_cnt * delay_timeout); else
dev_info(&ptd->pdev->dev, "CPU-PCH is cool [%dC]\n",
pch_cur_temp);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.