i7300_idle.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. /*
  2. * (C) Copyright 2008 Intel Corporation
  3. * Authors:
  4. * Andy Henroid <andrew.d.henroid@intel.com>
  5. * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
  6. */
  7. /*
  8. * Save DIMM power on Intel 7300-based platforms when all CPUs/cores
  9. * are idle, using the DIMM thermal throttling capability.
  10. *
  11. * This driver depends on the Intel integrated DMA controller (I/O AT).
  12. * If the driver for I/O AT (drivers/dma/ioatdma*) is also enabled,
  13. * this driver should work cooperatively.
  14. */
  15. /* #define DEBUG */
  16. #include <linux/module.h>
  17. #include <linux/pci.h>
  18. #include <linux/sched.h>
  19. #include <linux/notifier.h>
  20. #include <linux/cpumask.h>
  21. #include <linux/ktime.h>
  22. #include <linux/delay.h>
  23. #include <linux/debugfs.h>
  24. #include <linux/stop_machine.h>
  25. #include <linux/i7300_idle.h>
  26. #include <asm/idle.h>
  27. #include "../dma/ioat/hw.h"
  28. #include "../dma/ioat/registers.h"
  29. #define I7300_IDLE_DRIVER_VERSION "1.55"
  30. #define I7300_PRINT "i7300_idle:"
  31. #define MAX_STOP_RETRIES 10
  32. static int debug;
  33. module_param_named(debug, debug, uint, 0644);
  34. MODULE_PARM_DESC(debug, "Enable debug printks in this driver");
  35. static int forceload;
  36. module_param_named(forceload, forceload, uint, 0644);
  37. MODULE_PARM_DESC(debug, "Enable driver testing on unvalidated i5000");
  38. #define dprintk(fmt, arg...) \
  39. do { if (debug) printk(KERN_INFO I7300_PRINT fmt, ##arg); } while (0)
  40. /*
  41. * Value to set THRTLOW to when initiating throttling
  42. * 0 = No throttling
  43. * 1 = Throttle when > 4 activations per eval window (Maximum throttling)
  44. * 2 = Throttle when > 8 activations
  45. * 168 = Throttle when > 672 activations (Minimum throttling)
  46. */
  47. #define MAX_THROTTLE_LOW_LIMIT 168
  48. static uint throttle_low_limit = 1;
  49. module_param_named(throttle_low_limit, throttle_low_limit, uint, 0644);
  50. MODULE_PARM_DESC(throttle_low_limit,
  51. "Value for THRTLOWLM activation field "
  52. "(0 = disable throttle, 1 = Max throttle, 168 = Min throttle)");
  53. /*
  54. * simple invocation and duration statistics
  55. */
  56. static unsigned long total_starts;
  57. static unsigned long total_us;
  58. #ifdef DEBUG
  59. static unsigned long past_skip;
  60. #endif
  61. static struct pci_dev *fbd_dev;
  62. static spinlock_t i7300_idle_lock;
  63. static int i7300_idle_active;
  64. static u8 i7300_idle_thrtctl_saved;
  65. static u8 i7300_idle_thrtlow_saved;
  66. static u32 i7300_idle_mc_saved;
  67. static cpumask_t idle_cpumask;
  68. static ktime_t start_ktime;
  69. static unsigned long avg_idle_us;
  70. static struct dentry *debugfs_dir;
  71. /* Begin: I/O AT Helper routines */
  72. #define IOAT_CHANBASE(ioat_ctl, chan) (ioat_ctl + 0x80 + 0x80 * chan)
  73. /* Snoop control (disable snoops when coherency is not important) */
  74. #define IOAT_DESC_SADDR_SNP_CTL (1UL << 1)
  75. #define IOAT_DESC_DADDR_SNP_CTL (1UL << 2)
  76. static struct pci_dev *ioat_dev;
  77. static struct ioat_dma_descriptor *ioat_desc; /* I/O AT desc & data (1 page) */
  78. static unsigned long ioat_desc_phys;
  79. static u8 *ioat_iomap; /* I/O AT memory-mapped control regs (aka CB_BAR) */
  80. static u8 *ioat_chanbase;
  81. /* Start I/O AT memory copy */
  82. static int i7300_idle_ioat_start(void)
  83. {
  84. u32 err;
  85. /* Clear error (due to circular descriptor pointer) */
  86. err = readl(ioat_chanbase + IOAT_CHANERR_OFFSET);
  87. if (err)
  88. writel(err, ioat_chanbase + IOAT_CHANERR_OFFSET);
  89. writeb(IOAT_CHANCMD_START, ioat_chanbase + IOAT1_CHANCMD_OFFSET);
  90. return 0;
  91. }
  92. /* Stop I/O AT memory copy */
  93. static void i7300_idle_ioat_stop(void)
  94. {
  95. int i;
  96. u64 sts;
  97. for (i = 0; i < MAX_STOP_RETRIES; i++) {
  98. writeb(IOAT_CHANCMD_RESET,
  99. ioat_chanbase + IOAT1_CHANCMD_OFFSET);
  100. udelay(10);
  101. sts = readq(ioat_chanbase + IOAT1_CHANSTS_OFFSET) &
  102. IOAT_CHANSTS_STATUS;
  103. if (sts != IOAT_CHANSTS_ACTIVE)
  104. break;
  105. }
  106. if (i == MAX_STOP_RETRIES) {
  107. dprintk("failed to stop I/O AT after %d retries\n",
  108. MAX_STOP_RETRIES);
  109. }
  110. }
  111. /* Test I/O AT by copying 1024 byte from 2k to 1k */
  112. static int __init i7300_idle_ioat_selftest(u8 *ctl,
  113. struct ioat_dma_descriptor *desc, unsigned long desc_phys)
  114. {
  115. u64 chan_sts;
  116. memset(desc, 0, 2048);
  117. memset((u8 *) desc + 2048, 0xab, 1024);
  118. desc[0].size = 1024;
  119. desc[0].ctl = 0;
  120. desc[0].src_addr = desc_phys + 2048;
  121. desc[0].dst_addr = desc_phys + 1024;
  122. desc[0].next = 0;
  123. writeb(IOAT_CHANCMD_RESET, ioat_chanbase + IOAT1_CHANCMD_OFFSET);
  124. writeb(IOAT_CHANCMD_START, ioat_chanbase + IOAT1_CHANCMD_OFFSET);
  125. udelay(1000);
  126. chan_sts = readq(ioat_chanbase + IOAT1_CHANSTS_OFFSET) &
  127. IOAT_CHANSTS_STATUS;
  128. if (chan_sts != IOAT_CHANSTS_DONE) {
  129. /* Not complete, reset the channel */
  130. writeb(IOAT_CHANCMD_RESET,
  131. ioat_chanbase + IOAT1_CHANCMD_OFFSET);
  132. return -1;
  133. }
  134. if (*(u32 *) ((u8 *) desc + 3068) != 0xabababab ||
  135. *(u32 *) ((u8 *) desc + 2044) != 0xabababab) {
  136. dprintk("Data values src 0x%x, dest 0x%x, memset 0x%x\n",
  137. *(u32 *) ((u8 *) desc + 2048),
  138. *(u32 *) ((u8 *) desc + 1024),
  139. *(u32 *) ((u8 *) desc + 3072));
  140. return -1;
  141. }
  142. return 0;
  143. }
  144. static struct device dummy_dma_dev = {
  145. .init_name = "fallback device",
  146. .coherent_dma_mask = DMA_BIT_MASK(64),
  147. .dma_mask = &dummy_dma_dev.coherent_dma_mask,
  148. };
  149. /* Setup and initialize I/O AT */
  150. /* This driver needs I/O AT as the throttling takes effect only when there is
  151. * some memory activity. We use I/O AT to set up a dummy copy, while all CPUs
  152. * go idle and memory is throttled.
  153. */
  154. static int __init i7300_idle_ioat_init(void)
  155. {
  156. u8 ver, chan_count, ioat_chan;
  157. u16 chan_ctl;
  158. ioat_iomap = (u8 *) ioremap_nocache(pci_resource_start(ioat_dev, 0),
  159. pci_resource_len(ioat_dev, 0));
  160. if (!ioat_iomap) {
  161. printk(KERN_ERR I7300_PRINT "failed to map I/O AT registers\n");
  162. goto err_ret;
  163. }
  164. ver = readb(ioat_iomap + IOAT_VER_OFFSET);
  165. if (ver != IOAT_VER_1_2) {
  166. printk(KERN_ERR I7300_PRINT "unknown I/O AT version (%u.%u)\n",
  167. ver >> 4, ver & 0xf);
  168. goto err_unmap;
  169. }
  170. chan_count = readb(ioat_iomap + IOAT_CHANCNT_OFFSET);
  171. if (!chan_count) {
  172. printk(KERN_ERR I7300_PRINT "unexpected # of I/O AT channels "
  173. "(%u)\n",
  174. chan_count);
  175. goto err_unmap;
  176. }
  177. ioat_chan = chan_count - 1;
  178. ioat_chanbase = IOAT_CHANBASE(ioat_iomap, ioat_chan);
  179. chan_ctl = readw(ioat_chanbase + IOAT_CHANCTRL_OFFSET);
  180. if (chan_ctl & IOAT_CHANCTRL_CHANNEL_IN_USE) {
  181. printk(KERN_ERR I7300_PRINT "channel %d in use\n", ioat_chan);
  182. goto err_unmap;
  183. }
  184. writew(IOAT_CHANCTRL_CHANNEL_IN_USE,
  185. ioat_chanbase + IOAT_CHANCTRL_OFFSET);
  186. ioat_desc = (struct ioat_dma_descriptor *)dma_alloc_coherent(
  187. &dummy_dma_dev, 4096,
  188. (dma_addr_t *)&ioat_desc_phys, GFP_KERNEL);
  189. if (!ioat_desc) {
  190. printk(KERN_ERR I7300_PRINT "failed to allocate I/O AT desc\n");
  191. goto err_mark_unused;
  192. }
  193. writel(ioat_desc_phys & 0xffffffffUL,
  194. ioat_chanbase + IOAT1_CHAINADDR_OFFSET_LOW);
  195. writel(ioat_desc_phys >> 32,
  196. ioat_chanbase + IOAT1_CHAINADDR_OFFSET_HIGH);
  197. if (i7300_idle_ioat_selftest(ioat_iomap, ioat_desc, ioat_desc_phys)) {
  198. printk(KERN_ERR I7300_PRINT "I/O AT self-test failed\n");
  199. goto err_free;
  200. }
  201. /* Setup circular I/O AT descriptor chain */
  202. ioat_desc[0].ctl = IOAT_DESC_SADDR_SNP_CTL | IOAT_DESC_DADDR_SNP_CTL;
  203. ioat_desc[0].src_addr = ioat_desc_phys + 2048;
  204. ioat_desc[0].dst_addr = ioat_desc_phys + 3072;
  205. ioat_desc[0].size = 128;
  206. ioat_desc[0].next = ioat_desc_phys + sizeof(struct ioat_dma_descriptor);
  207. ioat_desc[1].ctl = ioat_desc[0].ctl;
  208. ioat_desc[1].src_addr = ioat_desc[0].src_addr;
  209. ioat_desc[1].dst_addr = ioat_desc[0].dst_addr;
  210. ioat_desc[1].size = ioat_desc[0].size;
  211. ioat_desc[1].next = ioat_desc_phys;
  212. return 0;
  213. err_free:
  214. dma_free_coherent(&dummy_dma_dev, 4096, (void *)ioat_desc, 0);
  215. err_mark_unused:
  216. writew(0, ioat_chanbase + IOAT_CHANCTRL_OFFSET);
  217. err_unmap:
  218. iounmap(ioat_iomap);
  219. err_ret:
  220. return -ENODEV;
  221. }
  222. /* Cleanup I/O AT */
  223. static void __exit i7300_idle_ioat_exit(void)
  224. {
  225. int i;
  226. u64 chan_sts;
  227. i7300_idle_ioat_stop();
  228. /* Wait for a while for the channel to halt before releasing */
  229. for (i = 0; i < MAX_STOP_RETRIES; i++) {
  230. writeb(IOAT_CHANCMD_RESET,
  231. ioat_chanbase + IOAT1_CHANCMD_OFFSET);
  232. chan_sts = readq(ioat_chanbase + IOAT1_CHANSTS_OFFSET) &
  233. IOAT_CHANSTS_STATUS;
  234. if (chan_sts != IOAT_CHANSTS_ACTIVE) {
  235. writew(0, ioat_chanbase + IOAT_CHANCTRL_OFFSET);
  236. break;
  237. }
  238. udelay(1000);
  239. }
  240. chan_sts = readq(ioat_chanbase + IOAT1_CHANSTS_OFFSET) &
  241. IOAT_CHANSTS_STATUS;
  242. /*
  243. * We tried to reset multiple times. If IO A/T channel is still active
  244. * flag an error and return without cleanup. Memory leak is better
  245. * than random corruption in that extreme error situation.
  246. */
  247. if (chan_sts == IOAT_CHANSTS_ACTIVE) {
  248. printk(KERN_ERR I7300_PRINT "Unable to stop IO A/T channels."
  249. " Not freeing resources\n");
  250. return;
  251. }
  252. dma_free_coherent(&dummy_dma_dev, 4096, (void *)ioat_desc, 0);
  253. iounmap(ioat_iomap);
  254. }
  255. /* End: I/O AT Helper routines */
  256. #define DIMM_THRTLOW 0x64
  257. #define DIMM_THRTCTL 0x67
  258. #define DIMM_THRTCTL_THRMHUNT (1UL << 0)
  259. #define DIMM_MC 0x40
  260. #define DIMM_GTW_MODE (1UL << 17)
  261. #define DIMM_GBLACT 0x60
  262. /*
  263. * Keep track of an exponential-decaying average of recent idle durations.
  264. * The latest duration gets DURATION_WEIGHT_PCT percentage weight
  265. * in this average, with the old average getting the remaining weight.
  266. *
  267. * High weights emphasize recent history, low weights include long history.
  268. */
  269. #define DURATION_WEIGHT_PCT 55
  270. /*
  271. * When the decaying average of recent durations or the predicted duration
  272. * of the next timer interrupt is shorter than duration_threshold, the
  273. * driver will decline to throttle.
  274. */
  275. #define DURATION_THRESHOLD_US 100
  276. /* Store DIMM thermal throttle configuration */
  277. static int i7300_idle_thrt_save(void)
  278. {
  279. u32 new_mc_val;
  280. u8 gblactlm;
  281. pci_read_config_byte(fbd_dev, DIMM_THRTCTL, &i7300_idle_thrtctl_saved);
  282. pci_read_config_byte(fbd_dev, DIMM_THRTLOW, &i7300_idle_thrtlow_saved);
  283. pci_read_config_dword(fbd_dev, DIMM_MC, &i7300_idle_mc_saved);
  284. /*
  285. * Make sure we have Global Throttling Window Mode set to have a
  286. * "short" window. This (mostly) works around an issue where
  287. * throttling persists until the end of the global throttling window
  288. * size. On the tested system, this was resulting in a maximum of
  289. * 64 ms to exit throttling (average 32 ms). The actual numbers
  290. * depends on system frequencies. Setting the short window reduces
  291. * this by a factor of 4096.
  292. *
  293. * We will only do this only if the system is set for
  294. * unlimited-activations while in open-loop throttling (i.e., when
  295. * Global Activation Throttle Limit is zero).
  296. */
  297. pci_read_config_byte(fbd_dev, DIMM_GBLACT, &gblactlm);
  298. dprintk("thrtctl_saved = 0x%02x, thrtlow_saved = 0x%02x\n",
  299. i7300_idle_thrtctl_saved,
  300. i7300_idle_thrtlow_saved);
  301. dprintk("mc_saved = 0x%08x, gblactlm = 0x%02x\n",
  302. i7300_idle_mc_saved,
  303. gblactlm);
  304. if (gblactlm == 0) {
  305. new_mc_val = i7300_idle_mc_saved | DIMM_GTW_MODE;
  306. pci_write_config_dword(fbd_dev, DIMM_MC, new_mc_val);
  307. return 0;
  308. } else {
  309. dprintk("could not set GTW_MODE = 1 (OLTT enabled)\n");
  310. return -ENODEV;
  311. }
  312. }
  313. /* Restore DIMM thermal throttle configuration */
  314. static void i7300_idle_thrt_restore(void)
  315. {
  316. pci_write_config_dword(fbd_dev, DIMM_MC, i7300_idle_mc_saved);
  317. pci_write_config_byte(fbd_dev, DIMM_THRTLOW, i7300_idle_thrtlow_saved);
  318. pci_write_config_byte(fbd_dev, DIMM_THRTCTL, i7300_idle_thrtctl_saved);
  319. }
  320. /* Enable DIMM thermal throttling */
  321. static void i7300_idle_start(void)
  322. {
  323. u8 new_ctl;
  324. u8 limit;
  325. new_ctl = i7300_idle_thrtctl_saved & ~DIMM_THRTCTL_THRMHUNT;
  326. pci_write_config_byte(fbd_dev, DIMM_THRTCTL, new_ctl);
  327. limit = throttle_low_limit;
  328. if (unlikely(limit > MAX_THROTTLE_LOW_LIMIT))
  329. limit = MAX_THROTTLE_LOW_LIMIT;
  330. pci_write_config_byte(fbd_dev, DIMM_THRTLOW, limit);
  331. new_ctl = i7300_idle_thrtctl_saved | DIMM_THRTCTL_THRMHUNT;
  332. pci_write_config_byte(fbd_dev, DIMM_THRTCTL, new_ctl);
  333. }
  334. /* Disable DIMM thermal throttling */
  335. static void i7300_idle_stop(void)
  336. {
  337. u8 new_ctl;
  338. u8 got_ctl;
  339. new_ctl = i7300_idle_thrtctl_saved & ~DIMM_THRTCTL_THRMHUNT;
  340. pci_write_config_byte(fbd_dev, DIMM_THRTCTL, new_ctl);
  341. pci_write_config_byte(fbd_dev, DIMM_THRTLOW, i7300_idle_thrtlow_saved);
  342. pci_write_config_byte(fbd_dev, DIMM_THRTCTL, i7300_idle_thrtctl_saved);
  343. pci_read_config_byte(fbd_dev, DIMM_THRTCTL, &got_ctl);
  344. WARN_ON_ONCE(got_ctl != i7300_idle_thrtctl_saved);
  345. }
  346. /*
  347. * i7300_avg_duration_check()
  348. * return 0 if the decaying average of recent idle durations is
  349. * more than DURATION_THRESHOLD_US
  350. */
  351. static int i7300_avg_duration_check(void)
  352. {
  353. if (avg_idle_us >= DURATION_THRESHOLD_US)
  354. return 0;
  355. #ifdef DEBUG
  356. past_skip++;
  357. #endif
  358. return 1;
  359. }
  360. /* Idle notifier to look at idle CPUs */
  361. static int i7300_idle_notifier(struct notifier_block *nb, unsigned long val,
  362. void *data)
  363. {
  364. unsigned long flags;
  365. ktime_t now_ktime;
  366. static ktime_t idle_begin_time;
  367. static int time_init = 1;
  368. if (!throttle_low_limit)
  369. return 0;
  370. if (unlikely(time_init)) {
  371. time_init = 0;
  372. idle_begin_time = ktime_get();
  373. }
  374. spin_lock_irqsave(&i7300_idle_lock, flags);
  375. if (val == IDLE_START) {
  376. cpu_set(smp_processor_id(), idle_cpumask);
  377. if (cpus_weight(idle_cpumask) != num_online_cpus())
  378. goto end;
  379. now_ktime = ktime_get();
  380. idle_begin_time = now_ktime;
  381. if (i7300_avg_duration_check())
  382. goto end;
  383. i7300_idle_active = 1;
  384. total_starts++;
  385. start_ktime = now_ktime;
  386. i7300_idle_start();
  387. i7300_idle_ioat_start();
  388. } else if (val == IDLE_END) {
  389. cpu_clear(smp_processor_id(), idle_cpumask);
  390. if (cpus_weight(idle_cpumask) == (num_online_cpus() - 1)) {
  391. /* First CPU coming out of idle */
  392. u64 idle_duration_us;
  393. now_ktime = ktime_get();
  394. idle_duration_us = ktime_to_us(ktime_sub
  395. (now_ktime, idle_begin_time));
  396. avg_idle_us =
  397. ((100 - DURATION_WEIGHT_PCT) * avg_idle_us +
  398. DURATION_WEIGHT_PCT * idle_duration_us) / 100;
  399. if (i7300_idle_active) {
  400. ktime_t idle_ktime;
  401. idle_ktime = ktime_sub(now_ktime, start_ktime);
  402. total_us += ktime_to_us(idle_ktime);
  403. i7300_idle_ioat_stop();
  404. i7300_idle_stop();
  405. i7300_idle_active = 0;
  406. }
  407. }
  408. }
  409. end:
  410. spin_unlock_irqrestore(&i7300_idle_lock, flags);
  411. return 0;
  412. }
  413. static struct notifier_block i7300_idle_nb = {
  414. .notifier_call = i7300_idle_notifier,
  415. };
  416. MODULE_DEVICE_TABLE(pci, pci_tbl);
  417. int stats_open_generic(struct inode *inode, struct file *fp)
  418. {
  419. fp->private_data = inode->i_private;
  420. return 0;
  421. }
  422. static ssize_t stats_read_ul(struct file *fp, char __user *ubuf, size_t count,
  423. loff_t *off)
  424. {
  425. unsigned long *p = fp->private_data;
  426. char buf[32];
  427. int len;
  428. len = snprintf(buf, 32, "%lu\n", *p);
  429. return simple_read_from_buffer(ubuf, count, off, buf, len);
  430. }
  431. static const struct file_operations idle_fops = {
  432. .open = stats_open_generic,
  433. .read = stats_read_ul,
  434. };
  435. struct debugfs_file_info {
  436. void *ptr;
  437. char name[32];
  438. struct dentry *file;
  439. } debugfs_file_list[] = {
  440. {&total_starts, "total_starts", NULL},
  441. {&total_us, "total_us", NULL},
  442. #ifdef DEBUG
  443. {&past_skip, "past_skip", NULL},
  444. #endif
  445. {NULL, "", NULL}
  446. };
  447. static int __init i7300_idle_init(void)
  448. {
  449. spin_lock_init(&i7300_idle_lock);
  450. cpus_clear(idle_cpumask);
  451. total_us = 0;
  452. if (i7300_idle_platform_probe(&fbd_dev, &ioat_dev, forceload))
  453. return -ENODEV;
  454. if (i7300_idle_thrt_save())
  455. return -ENODEV;
  456. if (i7300_idle_ioat_init())
  457. return -ENODEV;
  458. debugfs_dir = debugfs_create_dir("i7300_idle", NULL);
  459. if (debugfs_dir) {
  460. int i = 0;
  461. while (debugfs_file_list[i].ptr != NULL) {
  462. debugfs_file_list[i].file = debugfs_create_file(
  463. debugfs_file_list[i].name,
  464. S_IRUSR,
  465. debugfs_dir,
  466. debugfs_file_list[i].ptr,
  467. &idle_fops);
  468. i++;
  469. }
  470. }
  471. idle_notifier_register(&i7300_idle_nb);
  472. printk(KERN_INFO "i7300_idle: loaded v%s\n", I7300_IDLE_DRIVER_VERSION);
  473. return 0;
  474. }
  475. static void __exit i7300_idle_exit(void)
  476. {
  477. idle_notifier_unregister(&i7300_idle_nb);
  478. if (debugfs_dir) {
  479. int i = 0;
  480. while (debugfs_file_list[i].file != NULL) {
  481. debugfs_remove(debugfs_file_list[i].file);
  482. i++;
  483. }
  484. debugfs_remove(debugfs_dir);
  485. }
  486. i7300_idle_thrt_restore();
  487. i7300_idle_ioat_exit();
  488. }
  489. module_init(i7300_idle_init);
  490. module_exit(i7300_idle_exit);
  491. MODULE_AUTHOR("Andy Henroid <andrew.d.henroid@intel.com>");
  492. MODULE_DESCRIPTION("Intel Chipset DIMM Idle Power Saving Driver v"
  493. I7300_IDLE_DRIVER_VERSION);
  494. MODULE_LICENSE("GPL");