Lines Matching +full:pch +full:- +full:msi +full:- +full:1

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2009-2010 Intel Corporation
10 * Some Intel Ibex Peak based platforms support so-called "intelligent
34 * - dual MCP configs
37 * - handle CPU hotplug
38 * - provide turbo enable/disable api
41 * - CDI 403777, 403778 - Auburndale EDS vol 1 & 2
42 * - CDI 401376 - Ibex Peak EDS
43 * - ref 26037, 26641 - IPS BIOS spec
44 * - ref 26489 - Nehalem BIOS writer's guide
45 * - ref 26921 - Ibex Peak BIOS Specification
68 #include <linux/io-64-nonatomic-lo-hi.h>
76 #define PLATFORM_TDP (1<<29)
77 #define PLATFORM_RATIO (1<<28)
80 #define IA32_MISC_TURBO_EN (1ULL<<38)
83 #define TURBO_TDC_OVR_EN (1UL<<31)
86 #define TURBO_TDP_OVR_EN (1UL<<15)
93 #define IA32_PERF_TURBO_DIS (1ULL<<32)
110 #define TSGPEN_HOT_LOHI (1<<1)
111 #define TSGPEN_CRIT_LOHI (1<<2)
124 #define TRC_CORE2_EN (1<<15)
125 #define TRC_THM_EN (1<<12)
126 #define TRC_C6_WAR (1<<8)
127 #define TRC_CORE1_EN (1<<7)
128 #define TRC_CORE_PWR (1<<6)
129 #define TRC_PCH_EN (1<<5)
130 #define TRC_MCH_EN (1<<4)
131 #define TRC_DIMM4 (1<<3)
132 #define TRC_DIMM3 (1<<2)
133 #define TRC_DIMM2 (1<<1)
134 #define TRC_DIMM1 (1<<0)
137 #define TEN_UPDATE_EN 1
139 #define PSC_NTG (1<<0) /* No GFX turbo support */
140 #define PSC_NTPC (1<<1) /* No CPU turbo support */
142 #define PSP_PP_PC (1<<2) /* BIOS prefers CPU perf */
145 #define PSP_PBRT (1<<4) /* BIOS run time support */
147 #define CTV_TEMP_ERROR (1<<15)
161 #define HTS_PP_PROC 1
164 #define HTS_PCTD_DIS (1<<9)
165 #define HTS_GTD_DIS (1<<8)
167 #define HTS_PTL_SHIFT 1
168 #define HTS_NVV (1<<0)
174 #define HTS2_PRST_RUNNING 1
191 #define TSPIEN_AUX_LOHI (1<<0)
192 #define TSPIEN_HOT_LOHI (1<<1)
193 #define TSPIEN_CRIT_LOHI (1<<2)
194 #define TSPIEN_AUX2_LOHI (1<<3)
206 #define STS_PP_PROC 1
209 #define STS_PCTD_DIS (1<<9)
210 #define STS_GTD_DIS (1<<8)
212 #define STS_PTL_SHIFT 1
213 #define STS_NVV (1<<0)
215 #define SEC_ACK (1<<0)
229 #define thm_readb(off) readb(ips->regmap + (off))
230 #define thm_readw(off) readw(ips->regmap + (off))
231 #define thm_readl(off) readl(ips->regmap + (off))
232 #define thm_readq(off) readq(ips->regmap + (off))
234 #define thm_writeb(off, val) writeb((val), ips->regmap + (off))
235 #define thm_writew(off, val) writew((val), ips->regmap + (off))
236 #define thm_writel(off, val) writel((val), ips->regmap + (off))
246 /* Per-SKU limits */
255 /* Max temps are -10 degrees C to avoid PROCHOT# */
339 * ips_cpu_busy - is CPU busy?
349 if ((avenrun[0] >> FSHIFT) > 1) in ips_cpu_busy()
356 * ips_cpu_raise - raise CPU power clamp
370 if (!ips->cpu_turbo_enabled) in ips_cpu_raise()
376 new_tdp_limit = cur_tdp_limit + 8; /* 1W increase */ in ips_cpu_raise()
379 if (((new_tdp_limit * 10) / 8) > ips->core_power_limit) in ips_cpu_raise()
394 * ips_cpu_lower - lower CPU power clamp
411 new_limit = cur_limit - 8; /* 1W decrease */ in ips_cpu_lower()
414 if (new_limit < (ips->orig_turbo_limit & TURBO_TDP_MASK)) in ips_cpu_lower()
415 new_limit = ips->orig_turbo_limit & TURBO_TDP_MASK; in ips_cpu_lower()
429 * do_enable_cpu_turbo - internal turbo enable function
448 * ips_enable_cpu_turbo - enable turbo mode on all CPUs
457 if (ips->__cpu_turbo_on) in ips_enable_cpu_turbo()
460 if (ips->turbo_toggle_allowed) in ips_enable_cpu_turbo()
461 on_each_cpu(do_enable_cpu_turbo, ips, 1); in ips_enable_cpu_turbo()
463 ips->__cpu_turbo_on = true; in ips_enable_cpu_turbo()
467 * do_disable_cpu_turbo - internal turbo disable function
486 * ips_disable_cpu_turbo - disable turbo mode on all CPUs
495 if (!ips->__cpu_turbo_on) in ips_disable_cpu_turbo()
498 if (ips->turbo_toggle_allowed) in ips_disable_cpu_turbo()
499 on_each_cpu(do_disable_cpu_turbo, ips, 1); in ips_disable_cpu_turbo()
501 ips->__cpu_turbo_on = false; in ips_disable_cpu_turbo()
505 * ips_gpu_busy - is GPU busy?
519 return ips->gpu_busy(); in ips_gpu_busy()
523 * ips_gpu_raise - raise GPU power clamp
534 if (!ips->gpu_raise()) in ips_gpu_raise()
535 ips->gpu_turbo_enabled = false; in ips_gpu_raise()
541 * ips_gpu_lower - lower GPU power clamp
551 if (!ips->gpu_lower()) in ips_gpu_lower()
552 ips->gpu_turbo_enabled = false; in ips_gpu_lower()
558 * ips_enable_gpu_turbo - notify the gfx driver turbo is available
566 if (ips->__gpu_turbo_on) in ips_enable_gpu_turbo()
568 ips->__gpu_turbo_on = true; in ips_enable_gpu_turbo()
572 * ips_disable_gpu_turbo - notify the gfx driver to disable turbo mode
580 if (!ips->__gpu_turbo_on) in ips_disable_gpu_turbo()
583 if (!ips->gpu_turbo_disable()) in ips_disable_gpu_turbo()
584 dev_err(ips->dev, "failed to disable graphics turbo\n"); in ips_disable_gpu_turbo()
586 ips->__gpu_turbo_on = false; in ips_disable_gpu_turbo()
590 * mcp_exceeded - check whether we're outside our thermal & power limits
604 spin_lock_irqsave(&ips->turbo_status_lock, flags); in mcp_exceeded()
606 temp_limit = ips->mcp_temp_limit * 100; in mcp_exceeded()
607 if (ips->mcp_avg_temp > temp_limit) in mcp_exceeded()
610 avg_power = ips->cpu_avg_power + ips->mch_avg_power; in mcp_exceeded()
611 if (avg_power > ips->mcp_power_limit) in mcp_exceeded()
614 spin_unlock_irqrestore(&ips->turbo_status_lock, flags); in mcp_exceeded()
620 * cpu_exceeded - check whether a CPU core is outside its limits
634 spin_lock_irqsave(&ips->turbo_status_lock, flags); in cpu_exceeded()
635 avg = cpu ? ips->ctv2_avg_temp : ips->ctv1_avg_temp; in cpu_exceeded()
636 if (avg > (ips->limits->core_temp_limit * 100)) in cpu_exceeded()
638 if (ips->cpu_avg_power > ips->core_power_limit * 100) in cpu_exceeded()
640 spin_unlock_irqrestore(&ips->turbo_status_lock, flags); in cpu_exceeded()
643 dev_info(ips->dev, "CPU power or thermal limit exceeded\n"); in cpu_exceeded()
649 * mch_exceeded - check whether the GPU is over budget
661 spin_lock_irqsave(&ips->turbo_status_lock, flags); in mch_exceeded()
662 if (ips->mch_avg_temp > (ips->limits->mch_temp_limit * 100)) in mch_exceeded()
664 if (ips->mch_avg_power > ips->mch_power_limit) in mch_exceeded()
666 spin_unlock_irqrestore(&ips->turbo_status_lock, flags); in mch_exceeded()
672 * verify_limits - verify BIOS provided limits
675 * BIOS can optionally provide non-default limits for power and temp. Check
681 if (ips->mcp_power_limit < ips->limits->mcp_power_limit || in verify_limits()
682 ips->mcp_power_limit > 35000) in verify_limits()
683 ips->mcp_power_limit = ips->limits->mcp_power_limit; in verify_limits()
685 if (ips->mcp_temp_limit < ips->limits->core_temp_limit || in verify_limits()
686 ips->mcp_temp_limit < ips->limits->mch_temp_limit || in verify_limits()
687 ips->mcp_temp_limit > 150) in verify_limits()
688 ips->mcp_temp_limit = min(ips->limits->core_temp_limit, in verify_limits()
689 ips->limits->mch_temp_limit); in verify_limits()
693 * update_turbo_limits - get various limits & settings from regs
700 * the regs for updates (as a result of AC->DC transition for example).
709 ips->cpu_turbo_enabled = !(hts & HTS_PCTD_DIS); in update_turbo_limits()
714 ips->cpu_turbo_enabled = false; in update_turbo_limits()
716 if (ips->gpu_busy) in update_turbo_limits()
717 ips->gpu_turbo_enabled = !(hts & HTS_GTD_DIS); in update_turbo_limits()
719 ips->core_power_limit = thm_readw(THM_MPCPC); in update_turbo_limits()
720 ips->mch_power_limit = thm_readw(THM_MMGPC); in update_turbo_limits()
721 ips->mcp_temp_limit = thm_readw(THM_PTL); in update_turbo_limits()
722 ips->mcp_power_limit = thm_readw(THM_MPPC); in update_turbo_limits()
729 * ips_adjust - adjust power clamp based on thermal state
735 * - do we need to adjust up or down?
736 * - is CPU busy?
737 * - is GPU busy?
738 * - is CPU in turbo?
739 * - is GPU in turbo?
740 * - is CPU or GPU preferred? (CPU is default)
743 * - up (TDP available)
744 * - CPU not busy, GPU not busy - nothing
745 * - CPU busy, GPU not busy - adjust CPU up
746 * - CPU not busy, GPU busy - adjust GPU up
747 * - CPU busy, GPU busy - adjust preferred unit up, taking headroom from
748 * non-preferred unit if necessary
749 * - down (at TDP limit)
750 * - adjust both CPU and GPU down if possible
752 * |cpu+ gpu+ cpu+gpu- cpu-gpu+ cpu-gpu-
754 * cpu < gpu >= |cpu+gpu-(mcp<) cpu+gpu-(mcp<) gpu- gpu-
755 * cpu >= gpu < |cpu-gpu+(mcp<) cpu- cpu-gpu+(mcp<) cpu-
756 * cpu >= gpu >=|cpu-gpu- cpu-gpu- cpu-gpu- cpu-gpu-
765 dev_dbg(ips->dev, "starting ips-adjust thread\n"); in ips_adjust()
775 spin_lock_irqsave(&ips->turbo_status_lock, flags); in ips_adjust()
776 if (ips->poll_turbo_status) in ips_adjust()
778 spin_unlock_irqrestore(&ips->turbo_status_lock, flags); in ips_adjust()
781 if (ips->cpu_turbo_enabled) in ips_adjust()
786 if (ips->gpu_turbo_enabled) in ips_adjust()
812 dev_dbg(ips->dev, "ips-adjust thread stopped\n"); in ips_adjust()
891 ret = (((val - *last) * 1000) / period); in get_cpu_power()
905 (((temp_decay_factor - 1) * avg) / temp_decay_factor); in update_average_temp()
915 (((power_decay_factor - 1) * avg) / power_decay_factor); in update_average_power()
938 wake_up_process(ips->monitor); in monitor_timeout()
942 * ips_monitor - temp/power monitoring thread
952 * Returns: %0 on success or -errno on error
971 dev_err(ips->dev, in ips_monitor()
979 return -ENOMEM; in ips_monitor()
999 val = read_ctv(ips, 1); in ips_monitor()
1009 if (ips->read_mch_val) { in ips_monitor()
1010 mchp = ips->read_mch_val(); in ips_monitor()
1019 ips->mcp_avg_temp = calc_avg_temp(ips, mcp_samples); in ips_monitor()
1020 ips->ctv1_avg_temp = calc_avg_temp(ips, ctv1_samples); in ips_monitor()
1021 ips->ctv2_avg_temp = calc_avg_temp(ips, ctv2_samples); in ips_monitor()
1022 ips->mch_avg_temp = calc_avg_temp(ips, mch_samples); in ips_monitor()
1023 ips->cpu_avg_power = calc_avg_power(ips, cpu_samples); in ips_monitor()
1024 ips->mch_avg_power = calc_avg_power(ips, mchp_samples); in ips_monitor()
1033 wake_up_process(ips->adjust); in ips_monitor()
1044 timer_setup(&ips->timer, monitor_timeout, TIMER_DEFERRABLE); in ips_monitor()
1051 ips->mcp_avg_temp = update_average_temp(ips->mcp_avg_temp, val); in ips_monitor()
1055 ips->ctv1_avg_temp = in ips_monitor()
1056 update_average_temp(ips->ctv1_avg_temp, val); in ips_monitor()
1060 ips->cpu_avg_power = in ips_monitor()
1061 update_average_power(ips->cpu_avg_power, cpu_val); in ips_monitor()
1063 if (ips->second_cpu) { in ips_monitor()
1064 /* Processor 1 */ in ips_monitor()
1065 val = read_ctv(ips, 1); in ips_monitor()
1066 ips->ctv2_avg_temp = in ips_monitor()
1067 update_average_temp(ips->ctv2_avg_temp, val); in ips_monitor()
1072 ips->mch_avg_temp = update_average_temp(ips->mch_avg_temp, val); in ips_monitor()
1074 if (ips->read_mch_val) { in ips_monitor()
1075 mch_val = ips->read_mch_val(); in ips_monitor()
1076 ips->mch_avg_power = in ips_monitor()
1077 update_average_power(ips->mch_avg_power, in ips_monitor()
1091 dev_warn(ips->dev, in ips_monitor()
1092 "ME failed to update for more than 1s, likely hung\n"); in ips_monitor()
1102 mod_timer(&ips->timer, expire); in ips_monitor()
1106 last_sample_period = jiffies_to_msecs(jiffies) - last_msecs; in ips_monitor()
1108 last_sample_period = 1; in ips_monitor()
1111 del_timer_sync(&ips->timer); in ips_monitor()
1113 dev_dbg(ips->dev, "ips-monitor thread stopped\n"); in ips_monitor()
1119 * ips_irq_handler - handle temperature triggers and other IPS events
1138 dev_info(ips->dev, "TSES: 0x%02x\n", tses); in ips_irq_handler()
1139 dev_info(ips->dev, "TES: 0x%02x\n", tes); in ips_irq_handler()
1142 if (tes & 1) { in ips_irq_handler()
1149 spin_lock(&ips->turbo_status_lock); in ips_irq_handler()
1150 ips->core_power_limit = (sts & STS_PCPL_MASK) >> in ips_irq_handler()
1152 ips->mch_power_limit = (sts & STS_GPL_MASK) >> in ips_irq_handler()
1155 ips->cpu_turbo_enabled = !(sts & STS_PCTD_DIS); in ips_irq_handler()
1160 ips->cpu_turbo_enabled = false; in ips_irq_handler()
1161 if (ips->gpu_busy) in ips_irq_handler()
1162 ips->gpu_turbo_enabled = !(sts & STS_GTD_DIS); in ips_irq_handler()
1163 ips->mcp_temp_limit = (sts & STS_PTL_MASK) >> in ips_irq_handler()
1165 ips->mcp_power_limit = (tc1 & STS_PPL_MASK) >> in ips_irq_handler()
1168 spin_unlock(&ips->turbo_status_lock); in ips_irq_handler()
1177 dev_warn(ips->dev, "thermal trip occurred, tses: 0x%04x\n", in ips_irq_handler()
1194 struct ips_driver *ips = m->private; in cpu_temp_show()
1196 seq_printf(m, "%d.%02d\n", ips->ctv1_avg_temp / 100, in cpu_temp_show()
1197 ips->ctv1_avg_temp % 100); in cpu_temp_show()
1205 struct ips_driver *ips = m->private; in cpu_power_show()
1207 seq_printf(m, "%dmW\n", ips->cpu_avg_power); in cpu_power_show()
1223 /* Convert to .1W/A units */ in cpu_clamp_show()
1237 struct ips_driver *ips = m->private; in mch_temp_show()
1239 seq_printf(m, "%d.%02d\n", ips->mch_avg_temp / 100, in mch_temp_show()
1240 ips->mch_avg_temp % 100); in mch_temp_show()
1248 struct ips_driver *ips = m->private; in mch_power_show()
1250 seq_printf(m, "%dmW\n", ips->mch_avg_power); in mch_power_show()
1258 debugfs_remove_recursive(ips->debug_root); in ips_debugfs_cleanup()
1263 ips->debug_root = debugfs_create_dir("ips", NULL); in ips_debugfs_init()
1265 debugfs_create_file("cpu_temp", 0444, ips->debug_root, ips, &cpu_temp_fops); in ips_debugfs_init()
1266 debugfs_create_file("cpu_power", 0444, ips->debug_root, ips, &cpu_power_fops); in ips_debugfs_init()
1267 debugfs_create_file("cpu_clamp", 0444, ips->debug_root, ips, &cpu_clamp_fops); in ips_debugfs_init()
1268 debugfs_create_file("mch_temp", 0444, ips->debug_root, ips, &mch_temp_fops); in ips_debugfs_init()
1269 debugfs_create_file("mch_power", 0444, ips->debug_root, ips, &mch_power_fops); in ips_debugfs_init()
1274 * ips_detect_cpu - detect whether CPU supports IPS
1289 dev_info(ips->dev, "Non-IPS CPU detected.\n"); in ips_detect_cpu()
1300 ips->turbo_toggle_allowed = true; in ips_detect_cpu()
1302 ips->turbo_toggle_allowed = false; in ips_detect_cpu()
1311 dev_info(ips->dev, "No CPUID match found.\n"); in ips_detect_cpu()
1319 if (limits->core_power_limit != (tdp / 8) * 1000) { in ips_detect_cpu()
1320 dev_info(ips->dev, in ips_detect_cpu()
1322 tdp / 8, limits->core_power_limit / 1000); in ips_detect_cpu()
1323 limits->core_power_limit = (tdp / 8) * 1000; in ips_detect_cpu()
1330 * ips_get_i915_syms - try to get GPU control methods from i915 driver
1342 ips->read_mch_val = symbol_get(i915_read_mch_val); in ips_get_i915_syms()
1343 if (!ips->read_mch_val) in ips_get_i915_syms()
1345 ips->gpu_raise = symbol_get(i915_gpu_raise); in ips_get_i915_syms()
1346 if (!ips->gpu_raise) in ips_get_i915_syms()
1348 ips->gpu_lower = symbol_get(i915_gpu_lower); in ips_get_i915_syms()
1349 if (!ips->gpu_lower) in ips_get_i915_syms()
1351 ips->gpu_busy = symbol_get(i915_gpu_busy); in ips_get_i915_syms()
1352 if (!ips->gpu_busy) in ips_get_i915_syms()
1354 ips->gpu_turbo_disable = symbol_get(i915_gpu_turbo_disable); in ips_get_i915_syms()
1355 if (!ips->gpu_turbo_disable) in ips_get_i915_syms()
1375 if (!ips->gpu_busy && late_i915_load) { in ips_gpu_turbo_enabled()
1377 dev_info(ips->dev, in ips_gpu_turbo_enabled()
1379 ips->gpu_turbo_enabled = !(thm_readl(THM_HTS) & HTS_GTD_DIS); in ips_gpu_turbo_enabled()
1383 return ips->gpu_turbo_enabled; in ips_gpu_turbo_enabled()
1406 pr_info("Blacklisted intel_ips for %s\n", id->ident); in ips_blacklist_callback()
1407 return 1; in ips_blacklist_callback()
1415 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1432 return -ENODEV; in ips_probe()
1434 ips = devm_kzalloc(&dev->dev, sizeof(*ips), GFP_KERNEL); in ips_probe()
1436 return -ENOMEM; in ips_probe()
1438 spin_lock_init(&ips->turbo_status_lock); in ips_probe()
1439 ips->dev = &dev->dev; in ips_probe()
1441 ips->limits = ips_detect_cpu(ips); in ips_probe()
1442 if (!ips->limits) { in ips_probe()
1443 dev_info(&dev->dev, "IPS not supported on this CPU\n"); in ips_probe()
1444 return -ENXIO; in ips_probe()
1449 dev_err(&dev->dev, "can't enable PCI device, aborting\n"); in ips_probe()
1453 ret = pcim_iomap_regions(dev, 1 << 0, pci_name(dev)); in ips_probe()
1455 dev_err(&dev->dev, "failed to map thermal regs, aborting\n"); in ips_probe()
1458 ips->regmap = pcim_iomap_table(dev)[0]; in ips_probe()
1464 dev_err(&dev->dev, "thermal device not enabled (0x%02x), aborting\n", tse); in ips_probe()
1465 return -ENXIO; in ips_probe()
1471 dev_err(&dev->dev, "thermal reporting for required devices not enabled, aborting\n"); in ips_probe()
1472 return -ENXIO; in ips_probe()
1476 ips->second_cpu = true; in ips_probe()
1479 dev_dbg(&dev->dev, "max cpu power clamp: %dW\n", in ips_probe()
1480 ips->mcp_power_limit / 10); in ips_probe()
1481 dev_dbg(&dev->dev, "max core power clamp: %dW\n", in ips_probe()
1482 ips->core_power_limit / 10); in ips_probe()
1485 ips->poll_turbo_status = true; in ips_probe()
1488 dev_info(&dev->dev, "failed to get i915 symbols, graphics turbo disabled until i915 loads\n"); in ips_probe()
1489 ips->gpu_turbo_enabled = false; in ips_probe()
1491 dev_dbg(&dev->dev, "graphics turbo enabled\n"); in ips_probe()
1492 ips->gpu_turbo_enabled = true; in ips_probe()
1501 dev_err(&dev->dev, "platform indicates TDP override unavailable, aborting\n"); in ips_probe()
1502 return -ENODEV; in ips_probe()
1507 * Note: don't use MSI here as the PCH has bugs. in ips_probe()
1509 ret = pci_alloc_irq_vectors(dev, 1, 1, PCI_IRQ_INTX); in ips_probe()
1513 ips->irq = pci_irq_vector(dev, 0); in ips_probe()
1515 ret = request_irq(ips->irq, ips_irq_handler, IRQF_SHARED, "ips", ips); in ips_probe()
1517 dev_err(&dev->dev, "request irq failed, aborting\n"); in ips_probe()
1527 ips->cta_val = thm_readw(THM_CTA); in ips_probe()
1528 ips->pta_val = thm_readw(THM_PTA); in ips_probe()
1529 ips->mgta_val = thm_readw(THM_MGTA); in ips_probe()
1532 rdmsrl(TURBO_POWER_CURRENT_LIMIT, ips->orig_turbo_limit); in ips_probe()
1535 ips->cpu_turbo_enabled = false; in ips_probe()
1538 ips->adjust = kthread_create(ips_adjust, ips, "ips-adjust"); in ips_probe()
1539 if (IS_ERR(ips->adjust)) { in ips_probe()
1540 dev_err(&dev->dev, in ips_probe()
1542 ret = -ENOMEM; in ips_probe()
1551 ips->monitor = kthread_run(ips_monitor, ips, "ips-monitor"); in ips_probe()
1552 if (IS_ERR(ips->monitor)) { in ips_probe()
1553 dev_err(&dev->dev, in ips_probe()
1555 ret = -ENOMEM; in ips_probe()
1559 hts = (ips->core_power_limit << HTS_PCPL_SHIFT) | in ips_probe()
1560 (ips->mcp_temp_limit << HTS_PTL_SHIFT) | HTS_NVV; in ips_probe()
1568 dev_info(&dev->dev, "IPS driver initialized, MCP temp limit %d\n", in ips_probe()
1569 ips->mcp_temp_limit); in ips_probe()
1573 kthread_stop(ips->adjust); in ips_probe()
1575 free_irq(ips->irq, ips); in ips_probe()
1588 if (ips->read_mch_val) in ips_remove()
1590 if (ips->gpu_raise) in ips_remove()
1592 if (ips->gpu_lower) in ips_remove()
1594 if (ips->gpu_busy) in ips_remove()
1596 if (ips->gpu_turbo_disable) in ips_remove()
1602 wrmsrl(TURBO_POWER_CURRENT_LIMIT, ips->orig_turbo_limit); in ips_remove()
1604 free_irq(ips->irq, ips); in ips_remove()
1606 if (ips->adjust) in ips_remove()
1607 kthread_stop(ips->adjust); in ips_remove()
1608 if (ips->monitor) in ips_remove()
1609 kthread_stop(ips->monitor); in ips_remove()
1610 dev_dbg(&dev->dev, "IPS driver removed\n"); in ips_remove()