i7300_idle.c 16 KB

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