intel_telemetry_debugfs.c 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062
  1. /*
  2. * Intel SOC Telemetry debugfs Driver: Currently supports APL
  3. * Copyright (c) 2015, Intel Corporation.
  4. * All Rights Reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms and conditions of the GNU General Public License,
  8. * version 2, as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * This file provides the debugfs interfaces for telemetry.
  16. * /sys/kernel/debug/telemetry/pss_info: Shows Primary Control Sub-Sys Counters
  17. * /sys/kernel/debug/telemetry/ioss_info: Shows IO Sub-System Counters
  18. * /sys/kernel/debug/telemetry/soc_states: Shows SoC State
  19. * /sys/kernel/debug/telemetry/pss_trace_verbosity: Read and Change Tracing
  20. * Verbosity via firmware
  21. * /sys/kernel/debug/telemetry/ioss_race_verbosity: Write and Change Tracing
  22. * Verbosity via firmware
  23. */
  24. #include <linux/module.h>
  25. #include <linux/init.h>
  26. #include <linux/device.h>
  27. #include <linux/debugfs.h>
  28. #include <linux/seq_file.h>
  29. #include <linux/io.h>
  30. #include <linux/uaccess.h>
  31. #include <linux/pci.h>
  32. #include <linux/suspend.h>
  33. #include <asm/cpu_device_id.h>
  34. #include <asm/intel-family.h>
  35. #include <asm/intel_pmc_ipc.h>
  36. #include <asm/intel_punit_ipc.h>
  37. #include <asm/intel_telemetry.h>
  38. #define DRIVER_NAME "telemetry_soc_debugfs"
  39. #define DRIVER_VERSION "1.0.0"
  40. /* ApolloLake SoC Event-IDs */
  41. #define TELEM_APL_PSS_PSTATES_ID 0x2802
  42. #define TELEM_APL_PSS_IDLE_ID 0x2806
  43. #define TELEM_APL_PCS_IDLE_BLOCKED_ID 0x2C00
  44. #define TELEM_APL_PCS_S0IX_BLOCKED_ID 0x2C01
  45. #define TELEM_APL_PSS_WAKEUP_ID 0x2C02
  46. #define TELEM_APL_PSS_LTR_BLOCKING_ID 0x2C03
  47. #define TELEM_APL_S0IX_TOTAL_OCC_ID 0x4000
  48. #define TELEM_APL_S0IX_SHLW_OCC_ID 0x4001
  49. #define TELEM_APL_S0IX_DEEP_OCC_ID 0x4002
  50. #define TELEM_APL_S0IX_TOTAL_RES_ID 0x4800
  51. #define TELEM_APL_S0IX_SHLW_RES_ID 0x4801
  52. #define TELEM_APL_S0IX_DEEP_RES_ID 0x4802
  53. #define TELEM_APL_D0IX_ID 0x581A
  54. #define TELEM_APL_D3_ID 0x5819
  55. #define TELEM_APL_PG_ID 0x5818
  56. #define TELEM_INFO_SRAMEVTS_MASK 0xFF00
  57. #define TELEM_INFO_SRAMEVTS_SHIFT 0x8
  58. #define TELEM_SSRAM_READ_TIMEOUT 10
  59. #define TELEM_MASK_BIT 1
  60. #define TELEM_MASK_BYTE 0xFF
  61. #define BYTES_PER_LONG 8
  62. #define TELEM_APL_MASK_PCS_STATE 0xF
  63. /* Max events in bitmap to check for */
  64. #define TELEM_PSS_IDLE_EVTS 25
  65. #define TELEM_PSS_IDLE_BLOCKED_EVTS 20
  66. #define TELEM_PSS_S0IX_BLOCKED_EVTS 20
  67. #define TELEM_PSS_S0IX_WAKEUP_EVTS 20
  68. #define TELEM_PSS_LTR_BLOCKING_EVTS 20
  69. #define TELEM_IOSS_DX_D0IX_EVTS 25
  70. #define TELEM_IOSS_PG_EVTS 30
  71. #define TELEM_EVT_LEN(x) (sizeof(x)/sizeof((x)[0]))
  72. #define TELEM_DEBUGFS_CPU(model, data) \
  73. { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, (unsigned long)&data}
  74. #define TELEM_CHECK_AND_PARSE_EVTS(EVTID, EVTNUM, BUF, EVTLOG, EVTDAT, MASK) { \
  75. if (evtlog[index].telem_evtid == (EVTID)) { \
  76. for (idx = 0; idx < (EVTNUM); idx++) \
  77. (BUF)[idx] = ((EVTLOG) >> (EVTDAT)[idx].bit_pos) & \
  78. (MASK); \
  79. continue; \
  80. } \
  81. }
  82. #define TELEM_CHECK_AND_PARSE_CTRS(EVTID, CTR) { \
  83. if (evtlog[index].telem_evtid == (EVTID)) { \
  84. (CTR) = evtlog[index].telem_evtlog; \
  85. continue; \
  86. } \
  87. }
  88. static u8 suspend_prep_ok;
  89. static u32 suspend_shlw_ctr_temp, suspend_deep_ctr_temp;
  90. static u64 suspend_shlw_res_temp, suspend_deep_res_temp;
  91. struct telemetry_susp_stats {
  92. u32 shlw_swake_ctr;
  93. u32 deep_swake_ctr;
  94. u64 shlw_swake_res;
  95. u64 deep_swake_res;
  96. u32 shlw_ctr;
  97. u32 deep_ctr;
  98. u64 shlw_res;
  99. u64 deep_res;
  100. };
  101. /* Bitmap definitions for default counters in APL */
  102. struct telem_pss_idle_stateinfo {
  103. const char *name;
  104. u32 bit_pos;
  105. };
  106. static struct telem_pss_idle_stateinfo telem_apl_pss_idle_data[] = {
  107. {"IA_CORE0_C1E", 0},
  108. {"IA_CORE1_C1E", 1},
  109. {"IA_CORE2_C1E", 2},
  110. {"IA_CORE3_C1E", 3},
  111. {"IA_CORE0_C6", 16},
  112. {"IA_CORE1_C6", 17},
  113. {"IA_CORE2_C6", 18},
  114. {"IA_CORE3_C6", 19},
  115. {"IA_MODULE0_C7", 32},
  116. {"IA_MODULE1_C7", 33},
  117. {"GT_RC6", 40},
  118. {"IUNIT_PROCESSING_IDLE", 41},
  119. {"FAR_MEM_IDLE", 43},
  120. {"DISPLAY_IDLE", 44},
  121. {"IUNIT_INPUT_SYSTEM_IDLE", 45},
  122. {"PCS_STATUS", 60},
  123. };
  124. struct telem_pcs_blkd_info {
  125. const char *name;
  126. u32 bit_pos;
  127. };
  128. static struct telem_pcs_blkd_info telem_apl_pcs_idle_blkd_data[] = {
  129. {"COMPUTE", 0},
  130. {"MISC", 8},
  131. {"MODULE_ACTIONS_PENDING", 16},
  132. {"LTR", 24},
  133. {"DISPLAY_WAKE", 32},
  134. {"ISP_WAKE", 40},
  135. {"PSF0_ACTIVE", 48},
  136. };
  137. static struct telem_pcs_blkd_info telem_apl_pcs_s0ix_blkd_data[] = {
  138. {"LTR", 0},
  139. {"IRTL", 8},
  140. {"WAKE_DEADLINE_PENDING", 16},
  141. {"DISPLAY", 24},
  142. {"ISP", 32},
  143. {"CORE", 40},
  144. {"PMC", 48},
  145. {"MISC", 56},
  146. };
  147. struct telem_pss_ltr_info {
  148. const char *name;
  149. u32 bit_pos;
  150. };
  151. static struct telem_pss_ltr_info telem_apl_pss_ltr_data[] = {
  152. {"CORE_ACTIVE", 0},
  153. {"MEM_UP", 8},
  154. {"DFX", 16},
  155. {"DFX_FORCE_LTR", 24},
  156. {"DISPLAY", 32},
  157. {"ISP", 40},
  158. {"SOUTH", 48},
  159. };
  160. struct telem_pss_wakeup_info {
  161. const char *name;
  162. u32 bit_pos;
  163. };
  164. static struct telem_pss_wakeup_info telem_apl_pss_wakeup[] = {
  165. {"IP_IDLE", 0},
  166. {"DISPLAY_WAKE", 8},
  167. {"VOLTAGE_REG_INT", 16},
  168. {"DROWSY_TIMER (HOTPLUG)", 24},
  169. {"CORE_WAKE", 32},
  170. {"MISC_S0IX", 40},
  171. {"MISC_ABORT", 56},
  172. };
  173. struct telem_ioss_d0ix_stateinfo {
  174. const char *name;
  175. u32 bit_pos;
  176. };
  177. static struct telem_ioss_d0ix_stateinfo telem_apl_ioss_d0ix_data[] = {
  178. {"CSE", 0},
  179. {"SCC2", 1},
  180. {"GMM", 2},
  181. {"XDCI", 3},
  182. {"XHCI", 4},
  183. {"ISH", 5},
  184. {"AVS", 6},
  185. {"PCIE0P1", 7},
  186. {"PECI0P0", 8},
  187. {"LPSS", 9},
  188. {"SCC", 10},
  189. {"PWM", 11},
  190. {"PCIE1_P3", 12},
  191. {"PCIE1_P2", 13},
  192. {"PCIE1_P1", 14},
  193. {"PCIE1_P0", 15},
  194. {"CNV", 16},
  195. {"SATA", 17},
  196. {"PRTC", 18},
  197. };
  198. struct telem_ioss_pg_info {
  199. const char *name;
  200. u32 bit_pos;
  201. };
  202. static struct telem_ioss_pg_info telem_apl_ioss_pg_data[] = {
  203. {"LPSS", 0},
  204. {"SCC", 1},
  205. {"P2SB", 2},
  206. {"SCC2", 3},
  207. {"GMM", 4},
  208. {"PCIE0", 5},
  209. {"XDCI", 6},
  210. {"xHCI", 7},
  211. {"CSE", 8},
  212. {"SPI", 9},
  213. {"AVSPGD4", 10},
  214. {"AVSPGD3", 11},
  215. {"AVSPGD2", 12},
  216. {"AVSPGD1", 13},
  217. {"ISH", 14},
  218. {"EXI", 15},
  219. {"NPKVRC", 16},
  220. {"NPKVNN", 17},
  221. {"CUNIT", 18},
  222. {"FUSE_CTRL", 19},
  223. {"PCIE1", 20},
  224. {"CNV", 21},
  225. {"LPC", 22},
  226. {"SATA", 23},
  227. {"SMB", 24},
  228. {"PRTC", 25},
  229. };
  230. struct telemetry_debugfs_conf {
  231. struct telemetry_susp_stats suspend_stats;
  232. struct dentry *telemetry_dbg_dir;
  233. /* Bitmap Data */
  234. struct telem_ioss_d0ix_stateinfo *ioss_d0ix_data;
  235. struct telem_pss_idle_stateinfo *pss_idle_data;
  236. struct telem_pcs_blkd_info *pcs_idle_blkd_data;
  237. struct telem_pcs_blkd_info *pcs_s0ix_blkd_data;
  238. struct telem_pss_wakeup_info *pss_wakeup;
  239. struct telem_pss_ltr_info *pss_ltr_data;
  240. struct telem_ioss_pg_info *ioss_pg_data;
  241. u8 pcs_idle_blkd_evts;
  242. u8 pcs_s0ix_blkd_evts;
  243. u8 pss_wakeup_evts;
  244. u8 pss_idle_evts;
  245. u8 pss_ltr_evts;
  246. u8 ioss_d0ix_evts;
  247. u8 ioss_pg_evts;
  248. /* IDs */
  249. u16 pss_ltr_blocking_id;
  250. u16 pcs_idle_blkd_id;
  251. u16 pcs_s0ix_blkd_id;
  252. u16 s0ix_total_occ_id;
  253. u16 s0ix_shlw_occ_id;
  254. u16 s0ix_deep_occ_id;
  255. u16 s0ix_total_res_id;
  256. u16 s0ix_shlw_res_id;
  257. u16 s0ix_deep_res_id;
  258. u16 pss_wakeup_id;
  259. u16 ioss_d0ix_id;
  260. u16 pstates_id;
  261. u16 pss_idle_id;
  262. u16 ioss_d3_id;
  263. u16 ioss_pg_id;
  264. };
  265. static struct telemetry_debugfs_conf *debugfs_conf;
  266. static struct telemetry_debugfs_conf telem_apl_debugfs_conf = {
  267. .pss_idle_data = telem_apl_pss_idle_data,
  268. .pcs_idle_blkd_data = telem_apl_pcs_idle_blkd_data,
  269. .pcs_s0ix_blkd_data = telem_apl_pcs_s0ix_blkd_data,
  270. .pss_ltr_data = telem_apl_pss_ltr_data,
  271. .pss_wakeup = telem_apl_pss_wakeup,
  272. .ioss_d0ix_data = telem_apl_ioss_d0ix_data,
  273. .ioss_pg_data = telem_apl_ioss_pg_data,
  274. .pss_idle_evts = TELEM_EVT_LEN(telem_apl_pss_idle_data),
  275. .pcs_idle_blkd_evts = TELEM_EVT_LEN(telem_apl_pcs_idle_blkd_data),
  276. .pcs_s0ix_blkd_evts = TELEM_EVT_LEN(telem_apl_pcs_s0ix_blkd_data),
  277. .pss_ltr_evts = TELEM_EVT_LEN(telem_apl_pss_ltr_data),
  278. .pss_wakeup_evts = TELEM_EVT_LEN(telem_apl_pss_wakeup),
  279. .ioss_d0ix_evts = TELEM_EVT_LEN(telem_apl_ioss_d0ix_data),
  280. .ioss_pg_evts = TELEM_EVT_LEN(telem_apl_ioss_pg_data),
  281. .pstates_id = TELEM_APL_PSS_PSTATES_ID,
  282. .pss_idle_id = TELEM_APL_PSS_IDLE_ID,
  283. .pcs_idle_blkd_id = TELEM_APL_PCS_IDLE_BLOCKED_ID,
  284. .pcs_s0ix_blkd_id = TELEM_APL_PCS_S0IX_BLOCKED_ID,
  285. .pss_wakeup_id = TELEM_APL_PSS_WAKEUP_ID,
  286. .pss_ltr_blocking_id = TELEM_APL_PSS_LTR_BLOCKING_ID,
  287. .s0ix_total_occ_id = TELEM_APL_S0IX_TOTAL_OCC_ID,
  288. .s0ix_shlw_occ_id = TELEM_APL_S0IX_SHLW_OCC_ID,
  289. .s0ix_deep_occ_id = TELEM_APL_S0IX_DEEP_OCC_ID,
  290. .s0ix_total_res_id = TELEM_APL_S0IX_TOTAL_RES_ID,
  291. .s0ix_shlw_res_id = TELEM_APL_S0IX_SHLW_RES_ID,
  292. .s0ix_deep_res_id = TELEM_APL_S0IX_DEEP_RES_ID,
  293. .ioss_d0ix_id = TELEM_APL_D0IX_ID,
  294. .ioss_d3_id = TELEM_APL_D3_ID,
  295. .ioss_pg_id = TELEM_APL_PG_ID,
  296. };
  297. static const struct x86_cpu_id telemetry_debugfs_cpu_ids[] = {
  298. TELEM_DEBUGFS_CPU(INTEL_FAM6_ATOM_GOLDMONT, telem_apl_debugfs_conf),
  299. TELEM_DEBUGFS_CPU(INTEL_FAM6_ATOM_GOLDMONT_PLUS, telem_apl_debugfs_conf),
  300. {}
  301. };
  302. MODULE_DEVICE_TABLE(x86cpu, telemetry_debugfs_cpu_ids);
  303. static int telemetry_debugfs_check_evts(void)
  304. {
  305. if ((debugfs_conf->pss_idle_evts > TELEM_PSS_IDLE_EVTS) ||
  306. (debugfs_conf->pcs_idle_blkd_evts > TELEM_PSS_IDLE_BLOCKED_EVTS) ||
  307. (debugfs_conf->pcs_s0ix_blkd_evts > TELEM_PSS_S0IX_BLOCKED_EVTS) ||
  308. (debugfs_conf->pss_ltr_evts > TELEM_PSS_LTR_BLOCKING_EVTS) ||
  309. (debugfs_conf->pss_wakeup_evts > TELEM_PSS_S0IX_WAKEUP_EVTS) ||
  310. (debugfs_conf->ioss_d0ix_evts > TELEM_IOSS_DX_D0IX_EVTS) ||
  311. (debugfs_conf->ioss_pg_evts > TELEM_IOSS_PG_EVTS))
  312. return -EINVAL;
  313. return 0;
  314. }
  315. static int telem_pss_states_show(struct seq_file *s, void *unused)
  316. {
  317. struct telemetry_evtlog evtlog[TELEM_MAX_OS_ALLOCATED_EVENTS];
  318. struct telemetry_debugfs_conf *conf = debugfs_conf;
  319. const char *name[TELEM_MAX_OS_ALLOCATED_EVENTS];
  320. u32 pcs_idle_blkd[TELEM_PSS_IDLE_BLOCKED_EVTS],
  321. pcs_s0ix_blkd[TELEM_PSS_S0IX_BLOCKED_EVTS],
  322. pss_s0ix_wakeup[TELEM_PSS_S0IX_WAKEUP_EVTS],
  323. pss_ltr_blkd[TELEM_PSS_LTR_BLOCKING_EVTS],
  324. pss_idle[TELEM_PSS_IDLE_EVTS];
  325. int index, idx, ret, err = 0;
  326. u64 pstates = 0;
  327. ret = telemetry_read_eventlog(TELEM_PSS, evtlog,
  328. TELEM_MAX_OS_ALLOCATED_EVENTS);
  329. if (ret < 0)
  330. return ret;
  331. err = telemetry_get_evtname(TELEM_PSS, name,
  332. TELEM_MAX_OS_ALLOCATED_EVENTS);
  333. if (err < 0)
  334. return err;
  335. seq_puts(s, "\n----------------------------------------------------\n");
  336. seq_puts(s, "\tPSS TELEM EVENTLOG (Residency = field/19.2 us\n");
  337. seq_puts(s, "----------------------------------------------------\n");
  338. for (index = 0; index < ret; index++) {
  339. seq_printf(s, "%-32s %llu\n",
  340. name[index], evtlog[index].telem_evtlog);
  341. /* Fetch PSS IDLE State */
  342. if (evtlog[index].telem_evtid == conf->pss_idle_id) {
  343. pss_idle[conf->pss_idle_evts - 1] =
  344. (evtlog[index].telem_evtlog >>
  345. conf->pss_idle_data[conf->pss_idle_evts - 1].bit_pos) &
  346. TELEM_APL_MASK_PCS_STATE;
  347. }
  348. TELEM_CHECK_AND_PARSE_EVTS(conf->pss_idle_id,
  349. conf->pss_idle_evts - 1,
  350. pss_idle, evtlog[index].telem_evtlog,
  351. conf->pss_idle_data, TELEM_MASK_BIT);
  352. TELEM_CHECK_AND_PARSE_EVTS(conf->pcs_idle_blkd_id,
  353. conf->pcs_idle_blkd_evts,
  354. pcs_idle_blkd,
  355. evtlog[index].telem_evtlog,
  356. conf->pcs_idle_blkd_data,
  357. TELEM_MASK_BYTE);
  358. TELEM_CHECK_AND_PARSE_EVTS(conf->pcs_s0ix_blkd_id,
  359. conf->pcs_s0ix_blkd_evts,
  360. pcs_s0ix_blkd,
  361. evtlog[index].telem_evtlog,
  362. conf->pcs_s0ix_blkd_data,
  363. TELEM_MASK_BYTE);
  364. TELEM_CHECK_AND_PARSE_EVTS(conf->pss_wakeup_id,
  365. conf->pss_wakeup_evts,
  366. pss_s0ix_wakeup,
  367. evtlog[index].telem_evtlog,
  368. conf->pss_wakeup, TELEM_MASK_BYTE);
  369. TELEM_CHECK_AND_PARSE_EVTS(conf->pss_ltr_blocking_id,
  370. conf->pss_ltr_evts, pss_ltr_blkd,
  371. evtlog[index].telem_evtlog,
  372. conf->pss_ltr_data, TELEM_MASK_BYTE);
  373. if (evtlog[index].telem_evtid == debugfs_conf->pstates_id)
  374. pstates = evtlog[index].telem_evtlog;
  375. }
  376. seq_puts(s, "\n--------------------------------------\n");
  377. seq_puts(s, "PStates\n");
  378. seq_puts(s, "--------------------------------------\n");
  379. seq_puts(s, "Domain\t\t\t\tFreq(Mhz)\n");
  380. seq_printf(s, " IA\t\t\t\t %llu\n GT\t\t\t\t %llu\n",
  381. (pstates & TELEM_MASK_BYTE)*100,
  382. ((pstates >> 8) & TELEM_MASK_BYTE)*50/3);
  383. seq_printf(s, " IUNIT\t\t\t\t %llu\n SA\t\t\t\t %llu\n",
  384. ((pstates >> 16) & TELEM_MASK_BYTE)*25,
  385. ((pstates >> 24) & TELEM_MASK_BYTE)*50/3);
  386. seq_puts(s, "\n--------------------------------------\n");
  387. seq_puts(s, "PSS IDLE Status\n");
  388. seq_puts(s, "--------------------------------------\n");
  389. seq_puts(s, "Device\t\t\t\t\tIDLE\n");
  390. for (index = 0; index < debugfs_conf->pss_idle_evts; index++) {
  391. seq_printf(s, "%-32s\t%u\n",
  392. debugfs_conf->pss_idle_data[index].name,
  393. pss_idle[index]);
  394. }
  395. seq_puts(s, "\n--------------------------------------\n");
  396. seq_puts(s, "PSS Idle blkd Status (~1ms saturating bucket)\n");
  397. seq_puts(s, "--------------------------------------\n");
  398. seq_puts(s, "Blocker\t\t\t\t\tCount\n");
  399. for (index = 0; index < debugfs_conf->pcs_idle_blkd_evts; index++) {
  400. seq_printf(s, "%-32s\t%u\n",
  401. debugfs_conf->pcs_idle_blkd_data[index].name,
  402. pcs_idle_blkd[index]);
  403. }
  404. seq_puts(s, "\n--------------------------------------\n");
  405. seq_puts(s, "PSS S0ix blkd Status (~1ms saturating bucket)\n");
  406. seq_puts(s, "--------------------------------------\n");
  407. seq_puts(s, "Blocker\t\t\t\t\tCount\n");
  408. for (index = 0; index < debugfs_conf->pcs_s0ix_blkd_evts; index++) {
  409. seq_printf(s, "%-32s\t%u\n",
  410. debugfs_conf->pcs_s0ix_blkd_data[index].name,
  411. pcs_s0ix_blkd[index]);
  412. }
  413. seq_puts(s, "\n--------------------------------------\n");
  414. seq_puts(s, "LTR Blocking Status (~1ms saturating bucket)\n");
  415. seq_puts(s, "--------------------------------------\n");
  416. seq_puts(s, "Blocker\t\t\t\t\tCount\n");
  417. for (index = 0; index < debugfs_conf->pss_ltr_evts; index++) {
  418. seq_printf(s, "%-32s\t%u\n",
  419. debugfs_conf->pss_ltr_data[index].name,
  420. pss_s0ix_wakeup[index]);
  421. }
  422. seq_puts(s, "\n--------------------------------------\n");
  423. seq_puts(s, "Wakes Status (~1ms saturating bucket)\n");
  424. seq_puts(s, "--------------------------------------\n");
  425. seq_puts(s, "Wakes\t\t\t\t\tCount\n");
  426. for (index = 0; index < debugfs_conf->pss_wakeup_evts; index++) {
  427. seq_printf(s, "%-32s\t%u\n",
  428. debugfs_conf->pss_wakeup[index].name,
  429. pss_ltr_blkd[index]);
  430. }
  431. return 0;
  432. }
  433. static int telem_pss_state_open(struct inode *inode, struct file *file)
  434. {
  435. return single_open(file, telem_pss_states_show, inode->i_private);
  436. }
  437. static const struct file_operations telem_pss_ops = {
  438. .open = telem_pss_state_open,
  439. .read = seq_read,
  440. .llseek = seq_lseek,
  441. .release = single_release,
  442. };
  443. static int telem_ioss_states_show(struct seq_file *s, void *unused)
  444. {
  445. struct telemetry_evtlog evtlog[TELEM_MAX_OS_ALLOCATED_EVENTS];
  446. const char *name[TELEM_MAX_OS_ALLOCATED_EVENTS];
  447. int index, ret, err;
  448. ret = telemetry_read_eventlog(TELEM_IOSS, evtlog,
  449. TELEM_MAX_OS_ALLOCATED_EVENTS);
  450. if (ret < 0)
  451. return ret;
  452. err = telemetry_get_evtname(TELEM_IOSS, name,
  453. TELEM_MAX_OS_ALLOCATED_EVENTS);
  454. if (err < 0)
  455. return err;
  456. seq_puts(s, "--------------------------------------\n");
  457. seq_puts(s, "\tI0SS TELEMETRY EVENTLOG\n");
  458. seq_puts(s, "--------------------------------------\n");
  459. for (index = 0; index < ret; index++) {
  460. seq_printf(s, "%-32s 0x%llx\n",
  461. name[index], evtlog[index].telem_evtlog);
  462. }
  463. return 0;
  464. }
  465. static int telem_ioss_state_open(struct inode *inode, struct file *file)
  466. {
  467. return single_open(file, telem_ioss_states_show, inode->i_private);
  468. }
  469. static const struct file_operations telem_ioss_ops = {
  470. .open = telem_ioss_state_open,
  471. .read = seq_read,
  472. .llseek = seq_lseek,
  473. .release = single_release,
  474. };
  475. static int telem_soc_states_show(struct seq_file *s, void *unused)
  476. {
  477. u32 d3_sts[TELEM_IOSS_DX_D0IX_EVTS], d0ix_sts[TELEM_IOSS_DX_D0IX_EVTS];
  478. u32 pg_sts[TELEM_IOSS_PG_EVTS], pss_idle[TELEM_PSS_IDLE_EVTS];
  479. struct telemetry_evtlog evtlog[TELEM_MAX_OS_ALLOCATED_EVENTS];
  480. u32 s0ix_total_ctr = 0, s0ix_shlw_ctr = 0, s0ix_deep_ctr = 0;
  481. u64 s0ix_total_res = 0, s0ix_shlw_res = 0, s0ix_deep_res = 0;
  482. struct telemetry_debugfs_conf *conf = debugfs_conf;
  483. struct pci_dev *dev = NULL;
  484. int index, idx, ret;
  485. u32 d3_state;
  486. u16 pmcsr;
  487. ret = telemetry_read_eventlog(TELEM_IOSS, evtlog,
  488. TELEM_MAX_OS_ALLOCATED_EVENTS);
  489. if (ret < 0)
  490. return ret;
  491. for (index = 0; index < ret; index++) {
  492. TELEM_CHECK_AND_PARSE_EVTS(conf->ioss_d3_id,
  493. conf->ioss_d0ix_evts,
  494. d3_sts, evtlog[index].telem_evtlog,
  495. conf->ioss_d0ix_data,
  496. TELEM_MASK_BIT);
  497. TELEM_CHECK_AND_PARSE_EVTS(conf->ioss_pg_id, conf->ioss_pg_evts,
  498. pg_sts, evtlog[index].telem_evtlog,
  499. conf->ioss_pg_data, TELEM_MASK_BIT);
  500. TELEM_CHECK_AND_PARSE_EVTS(conf->ioss_d0ix_id,
  501. conf->ioss_d0ix_evts,
  502. d0ix_sts, evtlog[index].telem_evtlog,
  503. conf->ioss_d0ix_data,
  504. TELEM_MASK_BIT);
  505. TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_total_occ_id,
  506. s0ix_total_ctr);
  507. TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_shlw_occ_id,
  508. s0ix_shlw_ctr);
  509. TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_deep_occ_id,
  510. s0ix_deep_ctr);
  511. TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_total_res_id,
  512. s0ix_total_res);
  513. TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_shlw_res_id,
  514. s0ix_shlw_res);
  515. TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_deep_res_id,
  516. s0ix_deep_res);
  517. }
  518. seq_puts(s, "\n---------------------------------------------------\n");
  519. seq_puts(s, "S0IX Type\t\t\t Occurrence\t\t Residency(us)\n");
  520. seq_puts(s, "---------------------------------------------------\n");
  521. seq_printf(s, "S0IX Shallow\t\t\t %10u\t %10llu\n",
  522. s0ix_shlw_ctr -
  523. conf->suspend_stats.shlw_ctr -
  524. conf->suspend_stats.shlw_swake_ctr,
  525. (u64)((s0ix_shlw_res -
  526. conf->suspend_stats.shlw_res -
  527. conf->suspend_stats.shlw_swake_res)*10/192));
  528. seq_printf(s, "S0IX Deep\t\t\t %10u\t %10llu\n",
  529. s0ix_deep_ctr -
  530. conf->suspend_stats.deep_ctr -
  531. conf->suspend_stats.deep_swake_ctr,
  532. (u64)((s0ix_deep_res -
  533. conf->suspend_stats.deep_res -
  534. conf->suspend_stats.deep_swake_res)*10/192));
  535. seq_printf(s, "Suspend(With S0ixShallow)\t %10u\t %10llu\n",
  536. conf->suspend_stats.shlw_ctr,
  537. (u64)(conf->suspend_stats.shlw_res*10)/192);
  538. seq_printf(s, "Suspend(With S0ixDeep)\t\t %10u\t %10llu\n",
  539. conf->suspend_stats.deep_ctr,
  540. (u64)(conf->suspend_stats.deep_res*10)/192);
  541. seq_printf(s, "Suspend(With Shallow-Wakes)\t %10u\t %10llu\n",
  542. conf->suspend_stats.shlw_swake_ctr +
  543. conf->suspend_stats.deep_swake_ctr,
  544. (u64)((conf->suspend_stats.shlw_swake_res +
  545. conf->suspend_stats.deep_swake_res)*10/192));
  546. seq_printf(s, "S0IX+Suspend Total\t\t %10u\t %10llu\n", s0ix_total_ctr,
  547. (u64)(s0ix_total_res*10/192));
  548. seq_puts(s, "\n-------------------------------------------------\n");
  549. seq_puts(s, "\t\tDEVICE STATES\n");
  550. seq_puts(s, "-------------------------------------------------\n");
  551. for_each_pci_dev(dev) {
  552. pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
  553. d3_state = ((pmcsr & PCI_PM_CTRL_STATE_MASK) ==
  554. (__force int)PCI_D3hot) ? 1 : 0;
  555. seq_printf(s, "pci %04x %04X %s %20.20s: ",
  556. dev->vendor, dev->device, dev_name(&dev->dev),
  557. dev_driver_string(&dev->dev));
  558. seq_printf(s, " d3:%x\n", d3_state);
  559. }
  560. seq_puts(s, "\n--------------------------------------\n");
  561. seq_puts(s, "D3/D0i3 Status\n");
  562. seq_puts(s, "--------------------------------------\n");
  563. seq_puts(s, "Block\t\t D3\t D0i3\n");
  564. for (index = 0; index < conf->ioss_d0ix_evts; index++) {
  565. seq_printf(s, "%-10s\t %u\t %u\n",
  566. conf->ioss_d0ix_data[index].name,
  567. d3_sts[index], d0ix_sts[index]);
  568. }
  569. seq_puts(s, "\n--------------------------------------\n");
  570. seq_puts(s, "South Complex PowerGate Status\n");
  571. seq_puts(s, "--------------------------------------\n");
  572. seq_puts(s, "Device\t\t PG\n");
  573. for (index = 0; index < conf->ioss_pg_evts; index++) {
  574. seq_printf(s, "%-10s\t %u\n",
  575. conf->ioss_pg_data[index].name,
  576. pg_sts[index]);
  577. }
  578. evtlog->telem_evtid = conf->pss_idle_id;
  579. ret = telemetry_read_events(TELEM_PSS, evtlog, 1);
  580. if (ret < 0)
  581. return ret;
  582. seq_puts(s, "\n-----------------------------------------\n");
  583. seq_puts(s, "North Idle Status\n");
  584. seq_puts(s, "-----------------------------------------\n");
  585. for (idx = 0; idx < conf->pss_idle_evts - 1; idx++) {
  586. pss_idle[idx] = (evtlog->telem_evtlog >>
  587. conf->pss_idle_data[idx].bit_pos) &
  588. TELEM_MASK_BIT;
  589. }
  590. pss_idle[idx] = (evtlog->telem_evtlog >>
  591. conf->pss_idle_data[idx].bit_pos) &
  592. TELEM_APL_MASK_PCS_STATE;
  593. for (index = 0; index < conf->pss_idle_evts; index++) {
  594. seq_printf(s, "%-30s %u\n",
  595. conf->pss_idle_data[index].name,
  596. pss_idle[index]);
  597. }
  598. seq_puts(s, "\nPCS_STATUS Code\n");
  599. seq_puts(s, "0:C0 1:C1 2:C1_DN_WT_DEV 3:C2 4:C2_WT_DE_MEM_UP\n");
  600. seq_puts(s, "5:C2_WT_DE_MEM_DOWN 6:C2_UP_WT_DEV 7:C2_DN 8:C2_VOA\n");
  601. seq_puts(s, "9:C2_VOA_UP 10:S0IX_PRE 11:S0IX\n");
  602. return 0;
  603. }
  604. static int telem_soc_state_open(struct inode *inode, struct file *file)
  605. {
  606. return single_open(file, telem_soc_states_show, inode->i_private);
  607. }
  608. static const struct file_operations telem_socstate_ops = {
  609. .open = telem_soc_state_open,
  610. .read = seq_read,
  611. .llseek = seq_lseek,
  612. .release = single_release,
  613. };
  614. static int telem_s0ix_res_get(void *data, u64 *val)
  615. {
  616. u64 s0ix_total_res;
  617. int ret;
  618. ret = intel_pmc_s0ix_counter_read(&s0ix_total_res);
  619. if (ret) {
  620. pr_err("Failed to read S0ix residency");
  621. return ret;
  622. }
  623. *val = s0ix_total_res;
  624. return 0;
  625. }
  626. DEFINE_DEBUGFS_ATTRIBUTE(telem_s0ix_fops, telem_s0ix_res_get, NULL, "%llu\n");
  627. static int telem_pss_trc_verb_show(struct seq_file *s, void *unused)
  628. {
  629. u32 verbosity;
  630. int err;
  631. err = telemetry_get_trace_verbosity(TELEM_PSS, &verbosity);
  632. if (err) {
  633. pr_err("Get PSS Trace Verbosity Failed with Error %d\n", err);
  634. return -EFAULT;
  635. }
  636. seq_printf(s, "PSS Trace Verbosity %u\n", verbosity);
  637. return 0;
  638. }
  639. static ssize_t telem_pss_trc_verb_write(struct file *file,
  640. const char __user *userbuf,
  641. size_t count, loff_t *ppos)
  642. {
  643. u32 verbosity;
  644. int err;
  645. if (kstrtou32_from_user(userbuf, count, 0, &verbosity))
  646. return -EFAULT;
  647. err = telemetry_set_trace_verbosity(TELEM_PSS, verbosity);
  648. if (err) {
  649. pr_err("Changing PSS Trace Verbosity Failed. Error %d\n", err);
  650. count = err;
  651. }
  652. return count;
  653. }
  654. static int telem_pss_trc_verb_open(struct inode *inode, struct file *file)
  655. {
  656. return single_open(file, telem_pss_trc_verb_show, inode->i_private);
  657. }
  658. static const struct file_operations telem_pss_trc_verb_ops = {
  659. .open = telem_pss_trc_verb_open,
  660. .read = seq_read,
  661. .write = telem_pss_trc_verb_write,
  662. .llseek = seq_lseek,
  663. .release = single_release,
  664. };
  665. static int telem_ioss_trc_verb_show(struct seq_file *s, void *unused)
  666. {
  667. u32 verbosity;
  668. int err;
  669. err = telemetry_get_trace_verbosity(TELEM_IOSS, &verbosity);
  670. if (err) {
  671. pr_err("Get IOSS Trace Verbosity Failed with Error %d\n", err);
  672. return -EFAULT;
  673. }
  674. seq_printf(s, "IOSS Trace Verbosity %u\n", verbosity);
  675. return 0;
  676. }
  677. static ssize_t telem_ioss_trc_verb_write(struct file *file,
  678. const char __user *userbuf,
  679. size_t count, loff_t *ppos)
  680. {
  681. u32 verbosity;
  682. int err;
  683. if (kstrtou32_from_user(userbuf, count, 0, &verbosity))
  684. return -EFAULT;
  685. err = telemetry_set_trace_verbosity(TELEM_IOSS, verbosity);
  686. if (err) {
  687. pr_err("Changing IOSS Trace Verbosity Failed. Error %d\n", err);
  688. count = err;
  689. }
  690. return count;
  691. }
  692. static int telem_ioss_trc_verb_open(struct inode *inode, struct file *file)
  693. {
  694. return single_open(file, telem_ioss_trc_verb_show, inode->i_private);
  695. }
  696. static const struct file_operations telem_ioss_trc_verb_ops = {
  697. .open = telem_ioss_trc_verb_open,
  698. .read = seq_read,
  699. .write = telem_ioss_trc_verb_write,
  700. .llseek = seq_lseek,
  701. .release = single_release,
  702. };
  703. static int pm_suspend_prep_cb(void)
  704. {
  705. struct telemetry_evtlog evtlog[TELEM_MAX_OS_ALLOCATED_EVENTS];
  706. struct telemetry_debugfs_conf *conf = debugfs_conf;
  707. int ret, index;
  708. ret = telemetry_raw_read_eventlog(TELEM_IOSS, evtlog,
  709. TELEM_MAX_OS_ALLOCATED_EVENTS);
  710. if (ret < 0) {
  711. suspend_prep_ok = 0;
  712. goto out;
  713. }
  714. for (index = 0; index < ret; index++) {
  715. TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_shlw_occ_id,
  716. suspend_shlw_ctr_temp);
  717. TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_deep_occ_id,
  718. suspend_deep_ctr_temp);
  719. TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_shlw_res_id,
  720. suspend_shlw_res_temp);
  721. TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_deep_res_id,
  722. suspend_deep_res_temp);
  723. }
  724. suspend_prep_ok = 1;
  725. out:
  726. return NOTIFY_OK;
  727. }
  728. static int pm_suspend_exit_cb(void)
  729. {
  730. struct telemetry_evtlog evtlog[TELEM_MAX_OS_ALLOCATED_EVENTS];
  731. static u32 suspend_shlw_ctr_exit, suspend_deep_ctr_exit;
  732. static u64 suspend_shlw_res_exit, suspend_deep_res_exit;
  733. struct telemetry_debugfs_conf *conf = debugfs_conf;
  734. int ret, index;
  735. if (!suspend_prep_ok)
  736. goto out;
  737. ret = telemetry_raw_read_eventlog(TELEM_IOSS, evtlog,
  738. TELEM_MAX_OS_ALLOCATED_EVENTS);
  739. if (ret < 0)
  740. goto out;
  741. for (index = 0; index < ret; index++) {
  742. TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_shlw_occ_id,
  743. suspend_shlw_ctr_exit);
  744. TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_deep_occ_id,
  745. suspend_deep_ctr_exit);
  746. TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_shlw_res_id,
  747. suspend_shlw_res_exit);
  748. TELEM_CHECK_AND_PARSE_CTRS(conf->s0ix_deep_res_id,
  749. suspend_deep_res_exit);
  750. }
  751. if ((suspend_shlw_ctr_exit < suspend_shlw_ctr_temp) ||
  752. (suspend_deep_ctr_exit < suspend_deep_ctr_temp) ||
  753. (suspend_shlw_res_exit < suspend_shlw_res_temp) ||
  754. (suspend_deep_res_exit < suspend_deep_res_temp)) {
  755. pr_err("Wrong s0ix counters detected\n");
  756. goto out;
  757. }
  758. suspend_shlw_ctr_exit -= suspend_shlw_ctr_temp;
  759. suspend_deep_ctr_exit -= suspend_deep_ctr_temp;
  760. suspend_shlw_res_exit -= suspend_shlw_res_temp;
  761. suspend_deep_res_exit -= suspend_deep_res_temp;
  762. if (suspend_shlw_ctr_exit == 1) {
  763. conf->suspend_stats.shlw_ctr +=
  764. suspend_shlw_ctr_exit;
  765. conf->suspend_stats.shlw_res +=
  766. suspend_shlw_res_exit;
  767. }
  768. /* Shallow Wakes Case */
  769. else if (suspend_shlw_ctr_exit > 1) {
  770. conf->suspend_stats.shlw_swake_ctr +=
  771. suspend_shlw_ctr_exit;
  772. conf->suspend_stats.shlw_swake_res +=
  773. suspend_shlw_res_exit;
  774. }
  775. if (suspend_deep_ctr_exit == 1) {
  776. conf->suspend_stats.deep_ctr +=
  777. suspend_deep_ctr_exit;
  778. conf->suspend_stats.deep_res +=
  779. suspend_deep_res_exit;
  780. }
  781. /* Shallow Wakes Case */
  782. else if (suspend_deep_ctr_exit > 1) {
  783. conf->suspend_stats.deep_swake_ctr +=
  784. suspend_deep_ctr_exit;
  785. conf->suspend_stats.deep_swake_res +=
  786. suspend_deep_res_exit;
  787. }
  788. out:
  789. suspend_prep_ok = 0;
  790. return NOTIFY_OK;
  791. }
  792. static int pm_notification(struct notifier_block *this,
  793. unsigned long event, void *ptr)
  794. {
  795. switch (event) {
  796. case PM_SUSPEND_PREPARE:
  797. return pm_suspend_prep_cb();
  798. case PM_POST_SUSPEND:
  799. return pm_suspend_exit_cb();
  800. }
  801. return NOTIFY_DONE;
  802. }
  803. static struct notifier_block pm_notifier = {
  804. .notifier_call = pm_notification,
  805. };
  806. static int __init telemetry_debugfs_init(void)
  807. {
  808. const struct x86_cpu_id *id;
  809. int err;
  810. struct dentry *f;
  811. /* Only APL supported for now */
  812. id = x86_match_cpu(telemetry_debugfs_cpu_ids);
  813. if (!id)
  814. return -ENODEV;
  815. debugfs_conf = (struct telemetry_debugfs_conf *)id->driver_data;
  816. err = telemetry_pltconfig_valid();
  817. if (err < 0) {
  818. pr_info("Invalid pltconfig, ensure IPC1 device is enabled in BIOS\n");
  819. return -ENODEV;
  820. }
  821. err = telemetry_debugfs_check_evts();
  822. if (err < 0) {
  823. pr_info("telemetry_debugfs_check_evts failed\n");
  824. return -EINVAL;
  825. }
  826. register_pm_notifier(&pm_notifier);
  827. err = -ENOMEM;
  828. debugfs_conf->telemetry_dbg_dir = debugfs_create_dir("telemetry", NULL);
  829. if (!debugfs_conf->telemetry_dbg_dir)
  830. goto out_pm;
  831. f = debugfs_create_file("pss_info", S_IFREG | S_IRUGO,
  832. debugfs_conf->telemetry_dbg_dir, NULL,
  833. &telem_pss_ops);
  834. if (!f) {
  835. pr_err("pss_sample_info debugfs register failed\n");
  836. goto out;
  837. }
  838. f = debugfs_create_file("ioss_info", S_IFREG | S_IRUGO,
  839. debugfs_conf->telemetry_dbg_dir, NULL,
  840. &telem_ioss_ops);
  841. if (!f) {
  842. pr_err("ioss_sample_info debugfs register failed\n");
  843. goto out;
  844. }
  845. f = debugfs_create_file("soc_states", S_IFREG | S_IRUGO,
  846. debugfs_conf->telemetry_dbg_dir,
  847. NULL, &telem_socstate_ops);
  848. if (!f) {
  849. pr_err("ioss_sample_info debugfs register failed\n");
  850. goto out;
  851. }
  852. f = debugfs_create_file("s0ix_residency_usec", S_IFREG | S_IRUGO,
  853. debugfs_conf->telemetry_dbg_dir,
  854. NULL, &telem_s0ix_fops);
  855. if (!f) {
  856. pr_err("s0ix_residency_usec debugfs register failed\n");
  857. goto out;
  858. }
  859. f = debugfs_create_file("pss_trace_verbosity", S_IFREG | S_IRUGO,
  860. debugfs_conf->telemetry_dbg_dir, NULL,
  861. &telem_pss_trc_verb_ops);
  862. if (!f) {
  863. pr_err("pss_trace_verbosity debugfs register failed\n");
  864. goto out;
  865. }
  866. f = debugfs_create_file("ioss_trace_verbosity", S_IFREG | S_IRUGO,
  867. debugfs_conf->telemetry_dbg_dir, NULL,
  868. &telem_ioss_trc_verb_ops);
  869. if (!f) {
  870. pr_err("ioss_trace_verbosity debugfs register failed\n");
  871. goto out;
  872. }
  873. return 0;
  874. out:
  875. debugfs_remove_recursive(debugfs_conf->telemetry_dbg_dir);
  876. debugfs_conf->telemetry_dbg_dir = NULL;
  877. out_pm:
  878. unregister_pm_notifier(&pm_notifier);
  879. return err;
  880. }
  881. static void __exit telemetry_debugfs_exit(void)
  882. {
  883. debugfs_remove_recursive(debugfs_conf->telemetry_dbg_dir);
  884. debugfs_conf->telemetry_dbg_dir = NULL;
  885. unregister_pm_notifier(&pm_notifier);
  886. }
  887. late_initcall(telemetry_debugfs_init);
  888. module_exit(telemetry_debugfs_exit);
  889. MODULE_AUTHOR("Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>");
  890. MODULE_DESCRIPTION("Intel SoC Telemetry debugfs Interface");
  891. MODULE_VERSION(DRIVER_VERSION);
  892. MODULE_LICENSE("GPL");