{"id":113734,"date":"2026-10-07T10:09:09","date_gmt":"2026-10-07T02:09:09","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/113734.html"},"modified":"2026-10-07T10:09:09","modified_gmt":"2026-10-07T02:09:09","slug":"%e3%80%90linux%e5%86%85%e6%a0%b8%e4%b8%93%e6%a0%8f-15%e3%80%91%e7%94%b5%e6%ba%90%e7%ae%a1%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/113734.html","title":{"rendered":"\u3010Linux\u5185\u6838\u4e13\u680f 15\u3011\u7535\u6e90\u7ba1\u7406"},"content":{"rendered":"<h2>15 \u00b7 \u7535\u6e90\u7ba1\u7406<\/h2>\n<p>\u672c\u7bc7\u5b9a\u4f4d:\u5d4c\u5165\u5f0f\u548c\u79fb\u52a8\u8bbe\u5907,\u7701\u7535\u662f\u786c\u6307\u6807\u3002FreeRTOS \u7528 tickless idle &#043; WFI;Linux \u6709\u5b8c\u6574\u7535\u6e90\u7ba1\u7406\u6846\u67b6:cpuidle(\u7a7a\u95f2\u72b6\u6001)\u3001cpufreq(\u9891\u7387\u8c03\u8282)\u3001Runtime PM(\u8fd0\u884c\u65f6\u6309\u9700\u5f00\u5173\u8bbe\u5907)\u3001\u7cfb\u7edf\u7ea7 suspend\/hibernate\u3001wakeup source(\u5524\u9192\u6e90)\u3002\u672c\u7bc7\u8bb2\u6e05\u8fd9\u5957,\u8bfb\u5b8c\u80fd\u7ed9\u8bbe\u5907\u914d\u7701\u7535\u7b56\u7565\u3001\u80fd\u8c03&#034;\u4e3a\u4ec0\u4e48\u8bbe\u5907\u4e0d\u4f11\u7720&#034;\u3002<\/p>\n<p>Linux \u7535\u6e90\u7ba1\u7406\u662ftickless\/WFI \u7684\u7cfb\u7edf\u5316\u6269\u5c55 FreeRTOS \u7701\u7535:tickless idle(\u8fdb WFI,\u505c tick)\u3002Linux \u7701\u7535\u590d\u6742\u5f97\u591a:\u2460 cpuidle(\u591a\u7ea7\u7a7a\u95f2\u72b6\u6001,\u6d45\u7761\/\u6df1\u7761);\u2461 cpufreq(\u52a8\u6001\u8c03\u9891,\u6309\u8d1f\u8f7d);\u2462 Runtime PM(\u8bbe\u5907\u4e0d\u7528\u5c31\u5173);\u2463 suspend(\u6574\u673a\u7761\u7720);\u2464 wakeup source(\u4ec0\u4e48\u80fd\u5524\u9192)\u3002\u589e\u91cf\u662f&#034;\u591a\u7ea7 &#043; \u8bbe\u5907\u7ea7 &#043; \u7cfb\u7edf\u7ea7&#034;\u3002WFI \u662f cpuidle \u6700\u6d45\u4e00\u7ea7\u3002<\/p>\n<hr \/>\n<h4>\u76ee\u5f55<\/h4>\n<ul>\n<li>15 \u00b7 \u7535\u6e90\u7ba1\u7406<\/li>\n<li>\u4e00\u3001\u7535\u6e90\u7ba1\u7406\u7684\u5c42\u6b21<\/li>\n<li>\u4e8c\u3001cpuidle:CPU \u7a7a\u95f2\u72b6\u6001<\/li>\n<li>\n<ul>\n<li>2.1 \u4e3a\u4ec0\u4e48\u591a\u7ea7\u7a7a\u95f2<\/li>\n<li>2.2 idle state<\/li>\n<li>2.3 RISC-V idle<\/li>\n<li>2.4 \u770b cpuidle<\/li>\n<li>2.5 \u5bf9\u7167 FreeRTOS tickless<\/li>\n<\/ul>\n<\/li>\n<li>\u4e09\u3001cpufreq:\u52a8\u6001\u8c03\u9891(DVFS)<\/li>\n<li>\n<ul>\n<li>3.1 DVFS \u662f\u4ec0\u4e48<\/li>\n<li>3.2 cpufreq \u6846\u67b6<\/li>\n<li>3.3 governor(\u7b56\u7565)<\/li>\n<li>3.4 \u770b\u4e0e\u914d<\/li>\n<li>3.5 OPP(Operating Performance Points)<\/li>\n<\/ul>\n<\/li>\n<li>\u56db\u3001Runtime PM:\u8bbe\u5907\u8fd0\u884c\u65f6\u7535\u6e90\u7ba1\u7406\u2b50<\/li>\n<li>\n<ul>\n<li>4.1 \u4e3a\u4ec0\u4e48 Runtime PM<\/li>\n<li>4.2 Runtime PM API<\/li>\n<li>4.3 runtime PM callback<\/li>\n<li>4.4 \u5f15\u7528\u8ba1\u6570<\/li>\n<li>4.5 autosuspend(\u5ef6\u8fdf\u6302\u8d77)<\/li>\n<li>4.6 \u770b Runtime PM<\/li>\n<\/ul>\n<\/li>\n<li>\u4e94\u3001\u7cfb\u7edf\u7ea7 Suspend(\u7761\u7720)<\/li>\n<li>\n<ul>\n<li>5.1 suspend \u72b6\u6001<\/li>\n<li>5.2 suspend \u6d41\u7a0b<\/li>\n<li>5.3 \u6cbf\u8bbe\u5907\u6811\u7ea7\u8054(10 \u7bc7)<\/li>\n<li>5.4 PM QoS(\u7535\u6e90\u7ba1\u7406\u670d\u52a1\u8d28\u91cf)<\/li>\n<li>5.5 \u89e6\u53d1 suspend<\/li>\n<\/ul>\n<\/li>\n<li>\u516d\u3001wakeup source(\u5524\u9192\u6e90)<\/li>\n<li>\n<ul>\n<li>6.1 \u4ec0\u4e48\u662f\u5524\u9192\u6e90<\/li>\n<li>6.2 \u6ce8\u518c\u5524\u9192\u6e90<\/li>\n<li>6.3 \u770b\u5524\u9192\u6e90<\/li>\n<li>6.4 \u5524\u9192\u539f\u56e0\u6392\u67e5<\/li>\n<\/ul>\n<\/li>\n<li>\u4e03\u3001clock \u548c regulator \u6846\u67b6<\/li>\n<li>\n<ul>\n<li>7.1 clock framework<\/li>\n<li>7.2 regulator framework<\/li>\n<li>7.3 \u4e0e PM \u5173\u7cfb<\/li>\n<\/ul>\n<\/li>\n<li>\u516b\u3001PM ops \u5b8c\u6574\u7ed3\u6784<\/li>\n<li>\u4e5d\u3001\u5d4c\u5165\u5f0f\u7701\u7535\u7b56\u7565<\/li>\n<li>\n<ul>\n<li>\n<ul>\n<li>9.1 \u5e38\u89c1\u7b56\u7565<\/li>\n<\/ul>\n<\/li>\n<li>9.2 \u5d4c\u5165\u5f0f\u5178\u578b\u573a\u666f<\/li>\n<li>9.3 \u8c03\u8bd5\u7701\u7535<\/li>\n<\/ul>\n<\/li>\n<li>\u5341\u3001\u5bf9\u7167\u603b\u8868<\/li>\n<li>\u5341\u4e00\u3001\u672c\u7bc7\u5c0f\u7ed3<\/li>\n<li>\u901f\u67e5\u8868<\/li>\n<\/ul>\n<h2>\u4e00\u3001\u7535\u6e90\u7ba1\u7406\u7684\u5c42\u6b21<\/h2>\n<p>\u7cfb\u7edf\u7ea7:    suspend(sleep) \/ hibernate(\u78c1\u76d8) \/ shutdown<br \/>\n              \u2502<br \/>\n\u5b50\u7cfb\u7edf\u7ea7:  Runtime PM(\u8bbe\u5907\u6309\u9700\u5f00\u5173)<br \/>\n              \u2502<br \/>\nCPU \u7ea7:    cpufreq(\u8c03\u9891) &#043; cpuidle(\u7a7a\u95f2\u72b6\u6001)<br \/>\n              \u2502<br \/>\n\u786c\u4ef6:      DVFS(\u7535\u538b\u9891\u7387) \/ WFI \/ clock gating \/ power gating<\/p>\n<table>\n<tr>\u5c42\u6b21\u4f5c\u7528\u89e6\u53d1<\/tr>\n<tbody>\n<tr>\n<td>\u7cfb\u7edf\u7ea7<\/td>\n<td>\u6574\u673a\u7761\u7720\/\u4f11\u7720<\/td>\n<td>\u7528\u6237(\u7535\u6e90\u952e)\/\u8d85\u65f6<\/td>\n<\/tr>\n<tr>\n<td>\u5b50\u7cfb\u7edf\u7ea7<\/td>\n<td>\u8bbe\u5907\u6309\u9700\u5f00\u5173<\/td>\n<td>\u8bbe\u5907\u4e0d\u5fd9\u65f6\u81ea\u52a8<\/td>\n<\/tr>\n<tr>\n<td>CPU \u7ea7<\/td>\n<td>\u8c03\u9891\/\u7a7a\u95f2<\/td>\n<td>\u8d1f\u8f7d\/\u7a7a\u95f2<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h2>\u4e8c\u3001cpuidle:CPU \u7a7a\u95f2\u72b6\u6001<\/h2>\n<h3>2.1 \u4e3a\u4ec0\u4e48\u591a\u7ea7\u7a7a\u95f2<\/h3>\n<ul>\n<li>CPU \u7a7a\u95f2\u53ef\u8fdb\u4e0d\u540c\u7761\u7720\u6df1\u5ea6<\/li>\n<li>\u6d45\u7761(WFI):\u5524\u9192\u5feb,\u7701\u7535\u5c11<\/li>\n<li>\u6df1\u7761(power gating):\u5524\u9192\u6162,\u7701\u7535\u591a<\/li>\n<li>cpuidle \u6846\u67b6:\u6309\u9884\u8ba1\u7a7a\u95f2\u65f6\u95f4\u9009\u6700\u4f18\u72b6\u6001<\/li>\n<\/ul>\n<h3>2.2 idle state<\/h3>\n<p><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">cpuidle_state<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">char<\/span> name<span class=\"token punctuation\">[<\/span>CPUIDLE_NAME_LEN<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">unsigned<\/span> <span class=\"token keyword\">int<\/span> flags<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>enter<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">cpuidle_device<\/span> <span class=\"token operator\">*<\/span>dev<span class=\"token punctuation\">,<\/span><br \/>\n                 <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">cpuidle_driver<\/span> <span class=\"token operator\">*<\/span>drv<span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">int<\/span> index<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> exit_latency<span class=\"token punctuation\">;<\/span>     <span class=\"token comment\">\/\/ \u9000\u51fa\u5ef6\u8fdf(\u03bcs,\u5524\u9192\u8981\u591a\u4e45)<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> target_residency<span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u76ee\u6807\u9a7b\u7559(\u03bcs,\u81f3\u5c11\u7761\u8fd9\u4e48\u4e45\u624d\u5212\u7b97)<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> power_usage<span class=\"token punctuation\">;<\/span>      <span class=\"token comment\">\/\/ \u529f\u8017(mW)<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<ul>\n<li>\u6bcf\u4e2a state \u6709\u9000\u51fa\u5ef6\u8fdf &#043; \u76ee\u6807\u9a7b\u7559<\/li>\n<li>idle \u65f6\u95f4\u77ed\u9009\u6d45\u7761(\u5feb\u9192),\u957f\u9009\u6df1\u7761(\u7701\u7535)<\/li>\n<\/ul>\n<h3>2.3 RISC-V idle<\/h3>\n<ul>\n<li>\u6700\u6d45:WFI(Wait For Interrupt),\u6307\u4ee4\u8fdb\u4f4e\u529f\u8017<\/li>\n<li>\u66f4\u6df1:SoC \u7279\u5b9a(\u5173 PLL\/\u5173\u57df)<\/li>\n<li>cpuidle driver \u6ce8\u518c\u591a\u7ea7<\/li>\n<\/ul>\n<h3>2.4 \u770b cpuidle<\/h3>\n<p><span class=\"token function\">cat<\/span> \/sys\/devices\/system\/cpu\/cpu0\/cpuidle\/state*\/name<br \/>\n<span class=\"token comment\"># WFI<\/span><br \/>\n<span class=\"token comment\"># RETENTION<\/span><br \/>\n<span class=\"token comment\"># POWER_OFF<\/span><\/p>\n<p><span class=\"token function\">cat<\/span> \/sys\/devices\/system\/cpu\/cpu0\/cpuidle\/state*\/disable<br \/>\n<span class=\"token comment\"># 0  (0&#061;\u542f\u7528,1&#061;\u7981\u7528\u67d0\u72b6\u6001)<\/span><\/p>\n<h3>2.5 \u5bf9\u7167 FreeRTOS tickless<\/h3>\n<table>\n<tr>FreeRTOS ticklessLinux cpuidle<\/tr>\n<tbody>\n<tr>\n<td>\u7a7a\u95f2\u8fdb<\/td>\n<td>WFI(\u5e38\u4e00\u7ea7)<\/td>\n<td>\u591a\u7ea7 idle state<\/td>\n<\/tr>\n<tr>\n<td>\u9009\u54ea\u7ea7<\/td>\n<td>\u5355\u7ea7<\/td>\n<td>\u6309\u9884\u8ba1\u7a7a\u95f2\u65f6\u95f4<\/td>\n<\/tr>\n<tr>\n<td>\u5524\u9192<\/td>\n<td>\u4e2d\u65ad<\/td>\n<td>\u4e2d\u65ad<\/td>\n<\/tr>\n<tr>\n<td>tick<\/td>\n<td>\u505c<\/td>\n<td>\u505c(NOHZ,08 \u7bc7)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>tickless WFI \u662f cpuidle \u6700\u6d45\u7ea7 FreeRTOS tickless \u8fdb WFI\u2014\u2014Linux cpuidle \u7684\u6700\u6d45 state(WFI)\u3002Linux \u591a\u4e86\u6df1\u7761\u72b6\u6001(\u5173\u57df\/\u5173 PLL),\u6309\u7a7a\u95f2\u65f6\u957f\u9009\u3002\u589e\u91cf\u662f\u591a\u7ea7 &#043; \u667a\u80fd\u9009\u62e9\u3002WFI \u7ecf\u9a8c\u76f4\u63a5\u8fc1\u79fb,\u65b0\u589e&#034;\u6df1\u7761\u7684\u5ef6\u8fdf\/\u9a7b\u7559\u6743\u8861&#034;\u3002<\/p>\n<hr \/>\n<h2>\u4e09\u3001cpufreq:\u52a8\u6001\u8c03\u9891(DVFS)<\/h2>\n<h3>3.1 DVFS \u662f\u4ec0\u4e48<\/h3>\n<ul>\n<li>Dynamic Voltage and Frequency Scaling<\/li>\n<li>\u8d1f\u8f7d\u4f4e\u964d\u9891\u964d\u538b(\u7701\u7535),\u8d1f\u8f7d\u9ad8\u5347\u9891\u5347\u538b(\u6027\u80fd)<\/li>\n<li>CPU &#043; \u8c03\u9891\u9a71\u52a8 &#043; governor(\u7b56\u7565)<\/li>\n<\/ul>\n<h3>3.2 cpufreq \u6846\u67b6<\/h3>\n<p><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">cpufreq_driver<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>init<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">cpufreq_policy<\/span> <span class=\"token operator\">*<\/span>policy<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>setpolicy<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>        <span class=\"token comment\">\/\/ \u8bbe\u7b56\u7565<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>target_index<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>     <span class=\"token comment\">\/\/ \u8bbe\u9891\u7387<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">cpufreq_governor<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>throttle<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">unsigned<\/span> <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>get<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<ul>\n<li>driver:\u786c\u4ef6\u64cd\u4f5c(SoC \u8c03\u9891\u63a5\u53e3)<\/li>\n<li>governor:\u7b56\u7565(\u4ec0\u4e48\u65f6\u5019\u8c03\u591a\u5c11)<\/li>\n<\/ul>\n<h3>3.3 governor(\u7b56\u7565)<\/h3>\n<table>\n<tr>governor\u7b56\u7565\u7528\u9014<\/tr>\n<tbody>\n<tr>\n<td>performance<\/td>\n<td>\u4e00\u76f4\u6700\u9ad8\u9891<\/td>\n<td>\u6027\u80fd\u4f18\u5148<\/td>\n<\/tr>\n<tr>\n<td>powersave<\/td>\n<td>\u4e00\u76f4\u6700\u4f4e\u9891<\/td>\n<td>\u7701\u7535\u4f18\u5148<\/td>\n<\/tr>\n<tr>\n<td>userspace<\/td>\n<td>\u7528\u6237\u6001\u6307\u5b9a<\/td>\n<td>\u624b\u52a8<\/td>\n<\/tr>\n<tr>\n<td>ondemand<\/td>\n<td>\u6309\u8d1f\u8f7d\u5347\u9891<\/td>\n<td>\u901a\u7528(\u9ed8\u8ba4)<\/td>\n<\/tr>\n<tr>\n<td>schedutil<\/td>\n<td>\u636e\u8c03\u5ea6\u5668\u4fe1\u606f\u8c03<\/td>\n<td>\u73b0\u4ee3(\u914d\u5408 EAS)<\/td>\n<\/tr>\n<tr>\n<td>conservative<\/td>\n<td>\u6e10\u8fdb\u8c03\u9891<\/td>\n<td>\u5e73\u8861<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>3.4 \u770b\u4e0e\u914d<\/h3>\n<p><span class=\"token function\">cat<\/span> \/sys\/devices\/system\/cpu\/cpu0\/cpufreq\/scaling_available_governors<br \/>\n<span class=\"token comment\"># ondemand performance powersave &#8230;<\/span><\/p>\n<p><span class=\"token function\">cat<\/span> \/sys\/devices\/system\/cpu\/cpu0\/cpufreq\/scaling_cur_freq<br \/>\n<span class=\"token comment\"># 1200000  (1.2 GHz)<\/span><\/p>\n<p><span class=\"token function\">cat<\/span> \/sys\/devices\/system\/cpu\/cpu0\/cpufreq\/scaling_available_frequencies<br \/>\n<span class=\"token comment\"># 400000 800000 1200000 1600000<\/span><\/p>\n<p><span class=\"token comment\"># \u6539 governor<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> performance <span class=\"token operator\">&gt;<\/span> \/sys\/devices\/system\/cpu\/cpu0\/cpufreq\/scaling_governor<\/p>\n<p><span class=\"token comment\"># \u8bbe\u56fa\u5b9a\u9891\u7387<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token number\">800000<\/span> <span class=\"token operator\">&gt;<\/span> \/sys\/devices\/system\/cpu\/cpu0\/cpufreq\/scaling_setspeed<\/p>\n<h3>3.5 OPP(Operating Performance Points)<\/h3>\n<ul>\n<li>SoC \u5b9a\u4e49\u7684&#034;\u9891\u7387&#043;\u7535\u538b&#034;\u7ec4\u5408<\/li>\n<li>DTS \u63cf\u8ff0:operating-points-v2<\/li>\n<li>\u8c03\u9891\u9a71\u52a8\u636e OPP \u5207\u6362<\/li>\n<\/ul>\n<p>cpu0_opp_table: opp-table {<br \/>\n    compatible &#061; &#034;oper-points-v2&#034;;<br \/>\n    opp-400M { opp-hz &#061; &lt;400000000&gt;; opp-microvolt &#061; &lt;900000&gt;; };<br \/>\n    opp-1G   { opp-hz &#061; &lt;1000000000&gt;; opp-microvolt &#061; &lt;1100000&gt;; };<br \/>\n};<\/p>\n<hr \/>\n<h2>\u56db\u3001Runtime PM:\u8bbe\u5907\u8fd0\u884c\u65f6\u7535\u6e90\u7ba1\u7406\u2b50<\/h2>\n<h3>4.1 \u4e3a\u4ec0\u4e48 Runtime PM<\/h3>\n<ul>\n<li>\u8bbe\u5907\u4e0d\u5fd9\u65f6\u5173\u5b83(\u7701\u7535),\u8981\u7528\u65f6\u5f00<\/li>\n<li>\u4e0d\u7b49\u6574\u673a suspend,\u8fd0\u884c\u65f6\u52a8\u6001\u5f00\u5173<\/li>\n<li>\u4f8b:USB \u8bbe\u5907\u7a7a\u95f2\u81ea\u52a8\u6302\u8d77<\/li>\n<\/ul>\n<h3>4.2 Runtime PM API<\/h3>\n<p><span class=\"token comment\">\/\/ \u8bbe\u5907\u7ed3\u6784(\u7ee7\u627f device,10 \u7bc7)<\/span><br \/>\n<span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">device<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">dev_pm_info<\/span> power<span class=\"token punctuation\">;<\/span>   <span class=\"token comment\">\/\/ PM \u72b6\u6001<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u9a71\u52a8\u7528:<\/span><br \/>\n<span class=\"token function\">pm_runtime_get_sync<\/span><span class=\"token punctuation\">(<\/span>dev<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>    <span class=\"token comment\">\/\/ \u6807\u8bb0&#034;\u8981\u7528&#034;,&#043;1 \u8ba1\u6570,\u82e5 0\u21921 \u8c03 resume<\/span><br \/>\n<span class=\"token function\">pm_runtime_put_sync<\/span><span class=\"token punctuation\">(<\/span>dev<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>    <span class=\"token comment\">\/\/ \u6807\u8bb0&#034;\u7528\u5b8c&#034;,-1,\u82e5 1\u21920 \u8c03 suspend<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u6216\u81ea\u52a8:<\/span><br \/>\n<span class=\"token function\">pm_runtime_enable<\/span><span class=\"token punctuation\">(<\/span>dev<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">pm_runtime_set_autosuspend_delay<\/span><span class=\"token punctuation\">(<\/span>dev<span class=\"token punctuation\">,<\/span> <span class=\"token number\">2000<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u7a7a\u95f2 2s \u540e\u81ea\u52a8\u6302\u8d77<\/span><br \/>\n<span class=\"token function\">pm_runtime_use_autosuspend<\/span><span class=\"token punctuation\">(<\/span>dev<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">pm_runtime_mark_last_busy<\/span><span class=\"token punctuation\">(<\/span>dev<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h3>4.3 runtime PM callback<\/h3>\n<p><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">dev_pm_ops<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>runtime_suspend<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">device<\/span> <span class=\"token operator\">*<\/span>dev<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>   <span class=\"token comment\">\/\/ \u6302\u8d77<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>runtime_resume<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">device<\/span> <span class=\"token operator\">*<\/span>dev<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>    <span class=\"token comment\">\/\/ \u6062\u590d<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>runtime_idle<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">device<\/span> <span class=\"token operator\">*<\/span>dev<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>      <span class=\"token comment\">\/\/ \u7a7a\u95f2(\u53ef\u51b3\u5b9a\u6302\u8d77)<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u9a71\u52a8\u6ce8\u518c<\/span><br \/>\n<span class=\"token keyword\">static<\/span> <span class=\"token keyword\">const<\/span> <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">dev_pm_ops<\/span> my_pm <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token function\">SET_RUNTIME_PM_OPS<\/span><span class=\"token punctuation\">(<\/span>my_runtime_suspend<span class=\"token punctuation\">,<\/span> my_runtime_resume<span class=\"token punctuation\">,<\/span> <span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h3>4.4 \u5f15\u7528\u8ba1\u6570<\/h3>\n<ul>\n<li>pm_runtime_get:\u8ba1\u6570 &#043;1(\u8981\u7528)<\/li>\n<li>pm_runtime_put:\u8ba1\u6570 -1(\u7528\u5b8c)<\/li>\n<li>\u8ba1\u6570 &gt; 0:\u8bbe\u5907\u6d3b\u8dc3<\/li>\n<li>\u8ba1\u6570 &#061; 0:\u53ef\u6302\u8d77<\/li>\n<li>\u8ba1\u6570 0\u21921:\u8c03 resume;1\u21920:\u8c03 suspend<\/li>\n<\/ul>\n<h3>4.5 autosuspend(\u5ef6\u8fdf\u6302\u8d77)<\/h3>\n<ul>\n<li>\u4e0d\u662f\u7528\u5b8c\u7acb\u523b\u6302\u8d77(\u9891\u7e41\u5f00\u5173\u635f\u8017)<\/li>\n<li>\u7a7a\u95f2 N \u79d2\u540e\u624d\u6302\u8d77<\/li>\n<li>pm_runtime_mark_last_busy &#043; autosuspend_delay<\/li>\n<\/ul>\n<p>Runtime PM \u662f\u8bbe\u5907\u7ea7\u7701\u7535,\u4f60\u88f8\u673a\u624b\u52a8\u5f00\u5173\u5916\u8bbe \u88f8\u673a\u7701\u7535:\u4e0d\u7528 UART \u65f6\u624b\u52a8\u5173\u65f6\u949f\u3002Linux Runtime PM \u6846\u67b6\u5316:\u9a71\u52a8\u5b9e\u73b0 suspend\/resume \u56de\u8c03,\u6846\u67b6\u7ba1\u5f15\u7528\u8ba1\u6570,\u81ea\u52a8\u5f00\u5173\u3002\u5199\u9a71\u52a8\u52a0 dev_pm_ops,\u6846\u67b6\u7ba1\u65f6\u673a\u3002<\/p>\n<h3>4.6 \u770b Runtime PM<\/h3>\n<p><span class=\"token function\">cat<\/span> \/sys\/devices\/<span class=\"token punctuation\">..<\/span>.\/power\/control<br \/>\n<span class=\"token comment\"># on        (on&#061;\u7981\u6b62\u81ea\u52a8\u6302\u8d77,auto&#061;\u5141\u8bb8)<\/span><\/p>\n<p><span class=\"token function\">cat<\/span> \/sys\/devices\/<span class=\"token punctuation\">..<\/span>.\/power\/runtime_status<br \/>\n<span class=\"token comment\"># active \/ suspended \/ suspending \/ resuming<\/span><\/p>\n<p><span class=\"token builtin class-name\">echo<\/span> auto <span class=\"token operator\">&gt;<\/span> \/sys\/devices\/<span class=\"token punctuation\">..<\/span>.\/power\/control   <span class=\"token comment\"># \u5141\u8bb8\u81ea\u52a8<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> on <span class=\"token operator\">&gt;<\/span> \/sys\/devices\/<span class=\"token punctuation\">..<\/span>.\/power\/control     <span class=\"token comment\"># \u7981\u6b62(\u5e38\u5f00)<\/span><\/p>\n<hr \/>\n<h2>\u4e94\u3001\u7cfb\u7edf\u7ea7 Suspend(\u7761\u7720)<\/h2>\n<h3>5.1 suspend \u72b6\u6001<\/h3>\n<table>\n<tr>\u72b6\u6001\u540d\u5b57\u7279\u70b9<\/tr>\n<tbody>\n<tr>\n<td>freeze<\/td>\n<td>\u51bb\u7ed3\u7528\u6237\u6001<\/td>\n<td>\u6700\u6d45,\u53ea\u505c\u8fdb\u7a0b<\/td>\n<\/tr>\n<tr>\n<td>standby<\/td>\n<td>\u5f85\u673a<\/td>\n<td>\u7cfb\u7edf\u8fdb\u4f4e\u529f\u8017,\u5185\u5b58\u4fdd\u6301<\/td>\n<\/tr>\n<tr>\n<td>mem<\/td>\n<td>\u6302\u8d77\u5230\u5185\u5b58(S3)<\/td>\n<td>\u5185\u5b58\u81ea\u5237\u65b0,CPU\/\u591a\u6570\u5916\u8bbe\u5173<\/td>\n<\/tr>\n<tr>\n<td>disk<\/td>\n<td>\u6302\u8d77\u5230\u78c1\u76d8(\u4f11\u7720,S4)<\/td>\n<td>\u5185\u5b58\u5b58\u76d8\u540e\u6574\u673a\u5173<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>5.2 suspend \u6d41\u7a0b<\/h3>\n<p>echo mem &gt; \/sys\/power\/state<br \/>\n  \u2192 \u5185\u6838 suspend \u6d41\u7a0b:<br \/>\n      1. \u51bb\u7ed3\u7528\u6237\u8fdb\u7a0b(\u4fe1\u53f7\u505c\u6b62)<br \/>\n      2. \u901a\u77e5\u6240\u6709\u8bbe\u5907 suspend(dev_pm_ops.suspend)<br \/>\n      3. \u5173\u4e2d\u65ad<br \/>\n      4. \u5173 CPU(\u8fdb\u7761\u7720)<br \/>\n      &#8230; \u7b49\u5524\u9192 &#8230;<br \/>\n  \u5524\u9192:<br \/>\n      5. \u5524\u9192\u6e90\u89e6\u53d1<br \/>\n      6. \u6062\u590d CPU<br \/>\n      7. \u5f00\u4e2d\u65ad<br \/>\n      8. resume \u8bbe\u5907(\u9006\u5e8f)<br \/>\n      9. \u89e3\u51bb\u8fdb\u7a0b<\/p>\n<h3>5.3 \u6cbf\u8bbe\u5907\u6811\u7ea7\u8054(10 \u7bc7)<\/h3>\n<ul>\n<li>suspend \u6309\u8bbe\u5907\u6811\u6df1\u5ea6\u4f18\u5148\u9006\u5e8f:\u5148\u5b50\u540e\u7236<\/li>\n<li>resume \u6309\u8bbe\u5907\u6811\u987a\u5e8f:\u5148\u7236\u540e\u5b50<\/li>\n<li>\u7236\u8bbe\u5907(\u603b\u7ebf)\u5148 resume,\u5b50\u8bbe\u5907\u624d\u80fd\u7528<\/li>\n<\/ul>\n<h3>5.4 PM QoS(\u7535\u6e90\u7ba1\u7406\u670d\u52a1\u8d28\u91cf)<\/h3>\n<ul>\n<li>\u7ea6\u675f&#034;\u4e0d\u80fd\u7761\u592a\u6df1&#034;\u6216&#034;\u5fc5\u987b\u5feb\u9192&#034;<\/li>\n<li>\u4f8b:\u97f3\u9891\u8981\u4f4e\u5ef6\u8fdf,\u4e0d\u80fd\u8fdb\u6df1\u7761<\/li>\n<li>pm_qos_add_request \u52a0\u7ea6\u675f<\/li>\n<\/ul>\n<h3>5.5 \u89e6\u53d1 suspend<\/h3>\n<p><span class=\"token builtin class-name\">echo<\/span> mem <span class=\"token operator\">&gt;<\/span> \/sys\/power\/state        <span class=\"token comment\"># \u6302\u8d77\u5230\u5185\u5b58<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> disk <span class=\"token operator\">&gt;<\/span> \/sys\/power\/state       <span class=\"token comment\"># \u4f11\u7720<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> freeze <span class=\"token operator\">&gt;<\/span> \/sys\/power\/state     <span class=\"token comment\"># \u4ec5\u51bb\u7ed3<\/span><\/p>\n<p><span class=\"token comment\"># \u770b\u652f\u6301\u7684\u72b6\u6001<\/span><br \/>\n<span class=\"token function\">cat<\/span> \/sys\/power\/state<br \/>\n<span class=\"token comment\"># freeze mem disk<\/span><\/p>\n<hr \/>\n<h2>\u516d\u3001wakeup source(\u5524\u9192\u6e90)<\/h2>\n<h3>6.1 \u4ec0\u4e48\u662f\u5524\u9192\u6e90<\/h3>\n<ul>\n<li>\u7cfb\u7edf\u7761\u7720\u65f6,\u53ea\u6709\u7279\u5b9a\u6e90\u80fd\u5524\u9192(\u4e2d\u65ad)<\/li>\n<li>wakeup source \u6807\u8bb0&#034;\u6211\u80fd\u5524\u9192\u7cfb\u7edf&#034;<\/li>\n<li>\u4f8b:\u7535\u6e90\u952e\u3001\u7f51\u7edc(Wake-on-LAN)\u3001RTC \u95f9\u949f\u3001GPIO<\/li>\n<\/ul>\n<h3>6.2 \u6ce8\u518c\u5524\u9192\u6e90<\/h3>\n<p><span class=\"token comment\">\/\/ \u8bbe\u5907\u542f\u7528\u5524\u9192\u80fd\u529b<\/span><br \/>\n<span class=\"token function\">device_set_wakeup_capable<\/span><span class=\"token punctuation\">(<\/span>dev<span class=\"token punctuation\">,<\/span> true<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">device_wakeup_enable<\/span><span class=\"token punctuation\">(<\/span>dev<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u4e2d\u65ad\u5524\u9192(IRQF \u4e4b\u5916)<\/span><br \/>\n<span class=\"token function\">enable_irq_wake<\/span><span class=\"token punctuation\">(<\/span>irq<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>    <span class=\"token comment\">\/\/ \u8ba9\u8be5\u4e2d\u65ad\u80fd\u5524\u9192<\/span><br \/>\n<span class=\"token function\">disable_irq_wake<\/span><span class=\"token punctuation\">(<\/span>irq<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h3>6.3 \u770b\u5524\u9192\u6e90<\/h3>\n<p><span class=\"token function\">cat<\/span> \/proc\/acpi\/wakeup     <span class=\"token comment\"># x86<\/span><br \/>\n<span class=\"token function\">cat<\/span> \/sys\/kernel\/debug\/wakeup_sources   <span class=\"token comment\"># \u901a\u7528<\/span><\/p>\n<p><span class=\"token comment\"># \u770b\u54ea\u4e9b\u8bbe\u5907\u80fd\u5524\u9192<\/span><br \/>\n<span class=\"token keyword\">for<\/span> <span class=\"token for-or-select variable\">d<\/span> <span class=\"token keyword\">in<\/span> \/sys\/devices\/*\/*\/power\/wakeup<span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">do<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$d<\/span>: <span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">cat<\/span> $d<span class=\"token variable\">)<\/span><\/span>&#034;<\/span><br \/>\n<span class=\"token keyword\">done<\/span><\/p>\n<h3>6.4 \u5524\u9192\u539f\u56e0\u6392\u67e5<\/h3>\n<p><span class=\"token comment\"># \u770b\u4e0a\u6b21\u5524\u9192\u539f\u56e0<\/span><br \/>\n<span class=\"token function\">cat<\/span> \/sys\/kernel\/debug\/wakeup_sources<br \/>\n<span class=\"token comment\"># active_count \/ event_count \/ wakeup_count \/ expire_count<\/span><br \/>\n<span class=\"token comment\"># last_time \/ max_time \/ total_time<\/span><\/p>\n<p>\u5d4c\u5165\u5f0f\u5524\u9192\u8c03\u8bd5\u662f\u96be\u70b9 \u5d4c\u5165\u5f0f\u4ea7\u54c1:\u201c\u7761\u7720\u4e86\u4f46\u88ab\u610f\u5916\u5524\u9192&#034;\u6216&#034;\u7761\u7720\u540e\u5524\u9192\u4e0d\u6765\u201d\u3002\u6392\u67e5:\u2460 \/sys\/kernel\/debug\/wakeup_sources \u770b\u54ea\u4e2a\u6e90\u89e6\u53d1;\u2461 \u68c0\u67e5\u8bbe\u5907 wakeup_enabled;\u2462 enable_irq_wake \u662f\u5426\u5bf9\u3002\u8fd9\u662f\u5d4c\u5165\u5f0f BSP \u7701\u7535\u8c03\u8bd5\u7684\u6838\u5fc3\u3002<\/p>\n<hr \/>\n<h2>\u4e03\u3001clock \u548c regulator \u6846\u67b6<\/h2>\n<h3>7.1 clock framework<\/h3>\n<ul>\n<li>SoC \u65f6\u949f\u6811\u590d\u6742(PLL\/\u5206\u9891\/gating)<\/li>\n<li>clock framework \u7edf\u4e00\u7ba1\u7406<\/li>\n<li>\u9a71\u52a8 clk_get\/clk_prepare_enable\/clk_disable_unprepare<\/li>\n<\/ul>\n<p><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">clk<\/span> <span class=\"token operator\">*<\/span>clk <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">clk_get<\/span><span class=\"token punctuation\">(<\/span>dev<span class=\"token punctuation\">,<\/span> <span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">clk_prepare_enable<\/span><span class=\"token punctuation\">(<\/span>clk<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>    <span class=\"token comment\">\/\/ \u5f00\u65f6\u949f<\/span><br \/>\n<span class=\"token comment\">\/\/ \u7528\u8bbe\u5907<\/span><br \/>\n<span class=\"token function\">clk_disable_unprepare<\/span><span class=\"token punctuation\">(<\/span>clk<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h3>7.2 regulator framework<\/h3>\n<ul>\n<li>\u7535\u6e90\u8c03\u8282\u5668(LDO\/DCDC)<\/li>\n<li>\u9a71\u52a8 regulator_get\/regulator_enable\/regulator_set_voltage<\/li>\n<\/ul>\n<p><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">regulator<\/span> <span class=\"token operator\">*<\/span>r <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">devm_regulator_get<\/span><span class=\"token punctuation\">(<\/span>dev<span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;vdd&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">regulator_enable<\/span><span class=\"token punctuation\">(<\/span>r<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">regulator_set_voltage<\/span><span class=\"token punctuation\">(<\/span>r<span class=\"token punctuation\">,<\/span> <span class=\"token number\">1100000<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">1100000<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h3>7.3 \u4e0e PM \u5173\u7cfb<\/h3>\n<ul>\n<li>cpufreq \u8c03\u9891\u8981\u540c\u6b65\u8c03\u538b(\u8c03 regulator)<\/li>\n<li>suspend \u5173\u65f6\u949f(clock gating)<\/li>\n<li>DVFS &#061; clock(\u9891\u7387)&#043; regulator(\u7535\u538b)\u8054\u52a8<\/li>\n<\/ul>\n<hr \/>\n<h2>\u516b\u3001PM ops \u5b8c\u6574\u7ed3\u6784<\/h2>\n<p><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">dev_pm_ops<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\">\/* \u7cfb\u7edf suspend\/resume *\/<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>suspend<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>       <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>resume<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>freeze<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>        <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>thaw<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>poweroff<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>      <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>restore<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\">\/* Runtime PM *\/<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>runtime_suspend<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>runtime_resume<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>runtime_idle<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\">\/* &#8230; \u5b8c\u6574\u7248\u66f4\u591a *\/<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u9a71\u52a8\u7528\u5b8f\u7b80\u5316<\/span><br \/>\n<span class=\"token keyword\">static<\/span> <span class=\"token keyword\">const<\/span> <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">dev_pm_ops<\/span> my_pm <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token function\">SET_SYSTEM_SLEEP_PM_OPS<\/span><span class=\"token punctuation\">(<\/span>my_suspend<span class=\"token punctuation\">,<\/span> my_resume<span class=\"token punctuation\">)<\/span>        <span class=\"token comment\">\/\/ \u7cfb\u7edf suspend<\/span><br \/>\n    <span class=\"token function\">SET_RUNTIME_PM_OPS<\/span><span class=\"token punctuation\">(<\/span>my_rt_suspend<span class=\"token punctuation\">,<\/span> my_rt_resume<span class=\"token punctuation\">,<\/span> <span class=\"token constant\">NULL<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token comment\">\/\/ Runtime PM<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<ul>\n<li>\u7cfb\u7edf suspend \u548c Runtime PM \u662f\u4e24\u5957<\/li>\n<li>\u9a71\u52a8\u53ef\u53ea\u5b9e\u73b0\u4e00\u5957\u6216\u90fd\u5b9e\u73b0<\/li>\n<\/ul>\n<hr \/>\n<h2>\u4e5d\u3001\u5d4c\u5165\u5f0f\u7701\u7535\u7b56\u7565<\/h2>\n<h4>9.1 \u5e38\u89c1\u7b56\u7565<\/h4>\n<table>\n<tr>\u7b56\u7565\u5de5\u5177<\/tr>\n<tbody>\n<tr>\n<td>CPU \u8c03\u9891<\/td>\n<td>cpufreq ondemand\/schedutil<\/td>\n<\/tr>\n<tr>\n<td>CPU \u7a7a\u95f2<\/td>\n<td>cpuidle \u591a\u7ea7<\/td>\n<\/tr>\n<tr>\n<td>\u8bbe\u5907\u6309\u9700\u5f00\u5173<\/td>\n<td>Runtime PM<\/td>\n<\/tr>\n<tr>\n<td>\u6574\u673a\u7761\u7720<\/td>\n<td>suspend mem(\u65e0\u4efb\u52a1\u65f6)<\/td>\n<\/tr>\n<tr>\n<td>\u5173\u5916\u8bbe\u65f6\u949f<\/td>\n<td>clock gating<\/td>\n<\/tr>\n<tr>\n<td>\u5173\u672a\u7528\u57df<\/td>\n<td>power gating(SoC \u7ea7)<\/td>\n<\/tr>\n<tr>\n<td>\u5524\u9192\u6e90<\/td>\n<td>\u53ea\u7559\u5fc5\u8981(\u7535\u6e90\u952e\/RTC\/\u7f51\u7edc)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>9.2 \u5d4c\u5165\u5f0f\u5178\u578b\u573a\u666f<\/h3>\n<ul>\n<li>\u7535\u6c60\u4ea7\u54c1(\u624b\u6301):cpufreq ondemand &#043; cpuidle \u6df1\u7761 &#043; Runtime PM &#043; \u7a7a\u95f2 suspend<\/li>\n<li>\u5e38\u7535\u4ea7\u54c1( plugged):cpufreq performance &#043; \u7981\u6df1\u7761(\u4f4e\u5ef6\u8fdf\u4f18\u5148)<\/li>\n<li>\u8fb9\u7f18 AI:\u9ad8\u6027\u80fd\u65f6\u5168\u9891,\u7a7a\u95f2\u964d\u9891<\/li>\n<\/ul>\n<h3>9.3 \u8c03\u8bd5\u7701\u7535<\/h3>\n<p><span class=\"token comment\"># \u770b\u529f\u8017(\u82e5\u6709\u529f\u7387\u8ba1)<\/span><br \/>\n<span class=\"token comment\"># \u770b CPU \u9891\u7387\/\u72b6\u6001<\/span><br \/>\n<span class=\"token function\">cat<\/span> \/sys\/devices\/system\/cpu\/cpu*\/cpufreq\/scaling_cur_freq<br \/>\n<span class=\"token function\">cat<\/span> \/sys\/devices\/system\/cpu\/cpu*\/cpuidle\/state*\/usage<\/p>\n<p><span class=\"token comment\"># \u770b\u8bbe\u5907 PM \u72b6\u6001<\/span><br \/>\n<span class=\"token function\">cat<\/span> \/sys\/devices\/<span class=\"token punctuation\">..<\/span>.\/power\/runtime_status<\/p>\n<p><span class=\"token comment\"># \u770b\u5524\u9192\u6e90<\/span><br \/>\n<span class=\"token function\">cat<\/span> \/sys\/kernel\/debug\/wakeup_sources<\/p>\n<p><span class=\"token comment\"># powertop(\u7701\u7535\u5206\u6790\u5de5\u5177)<\/span><br \/>\npowertop<\/p>\n<p>\u5d4c\u5165\u5f0f\u89c6\u89d2:powertop \u662f\u7701\u7535\u8c03\u4f18\u5229\u5668 Ubuntu \u6709 powertop,\u626b\u7cfb\u7edf\u7ed9\u51fa&#034;\u54ea\u4e9b\u8bbe\u5907\u53ef\u7701\u7535&#034;\u201c\u54ea\u4e9b wakeup \u9891\u7e41\u201d\u3002\u5d4c\u5165\u5f0f\u867d\u4e0d\u4e00\u5b9a\u6709 powertop,\u4f46\u601d\u8def\u901a\u7528:\u2460 \u627e\u5f02\u5e38\u6d3b\u8dc3\u8bbe\u5907;\u2461 \u7981\u4e0d\u5fc5\u8981\u5524\u9192;\u2462 \u914d Runtime PM\u3002\u4f60 AEGIX \u7701\u7535\u4ea7\u54c1\u53ef\u53c2\u8003\u3002<\/p>\n<hr \/>\n<h2>\u5341\u3001\u5bf9\u7167\u603b\u8868<\/h2>\n<table>\n<tr>\u6982\u5ff5FreeRTOS\/\u88f8\u673aLinux PM<\/tr>\n<tbody>\n<tr>\n<td>CPU \u7a7a\u95f2<\/td>\n<td>WFI<\/td>\n<td>cpuidle \u591a\u7ea7<\/td>\n<\/tr>\n<tr>\n<td>\u8c03\u9891<\/td>\n<td>\u624b\u52a8<\/td>\n<td>cpufreq &#043; governor<\/td>\n<\/tr>\n<tr>\n<td>\u8bbe\u5907\u5f00\u5173<\/td>\n<td>\u624b\u52a8<\/td>\n<td>Runtime PM<\/td>\n<\/tr>\n<tr>\n<td>\u6574\u673a\u7761\u7720<\/td>\n<td>\u65e0(\u6216\u81ea\u5df1\u5199)<\/td>\n<td>suspend(mem\/disk)<\/td>\n<\/tr>\n<tr>\n<td>\u5524\u9192\u6e90<\/td>\n<td>\u4e2d\u65ad<\/td>\n<td>wakeup source<\/td>\n<\/tr>\n<tr>\n<td>\u65f6\u949f\u7ba1\u7406<\/td>\n<td>\u624b\u52a8\u914d<\/td>\n<td>clock framework<\/td>\n<\/tr>\n<tr>\n<td>\u7535\u538b\u7ba1\u7406<\/td>\n<td>\u624b\u52a8<\/td>\n<td>regulator framework<\/td>\n<\/tr>\n<tr>\n<td>\u7701\u7535\u7b56\u7565<\/td>\n<td>tickless<\/td>\n<td>\u591a\u5c42\u7ec4\u5408<\/td>\n<\/tr>\n<tr>\n<td>\u8c03\u8bd5<\/td>\n<td>\u7535\u6d41\u8ba1<\/td>\n<td>powertop\/wakeup_sources<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h2>\u5341\u4e00\u3001\u672c\u7bc7\u5c0f\u7ed3<\/h2>\n<ul>\n<li>cpuidle:CPU \u7a7a\u95f2\u591a\u7ea7\u72b6\u6001(WFI \u6d45\/\u6df1\u7761),\u6309\u9884\u8ba1\u7a7a\u95f2\u65f6\u95f4\u9009,exit_latency\/target_residency \u6743\u8861<\/li>\n<li>cpufreq:DVFS \u52a8\u6001\u8c03\u9891,governor(performance\/ondemand\/schedutil),DTS OPP \u63cf\u8ff0\u9891\u7387\u7535\u538b<\/li>\n<li>Runtime PM:\u8bbe\u5907\u8fd0\u884c\u65f6\u6309\u9700\u5f00\u5173,\u5f15\u7528\u8ba1\u6570(pm_runtime_get\/put),autosuspend \u5ef6\u8fdf\u6302\u8d77,dev_pm_ops runtime_suspend\/resume<\/li>\n<li>\u7cfb\u7edf suspend:freeze\/standby\/mem\/disk,\u6cbf\u8bbe\u5907\u6811\u7ea7\u8054(\u5b50\u5148 suspend,\u7236\u5148 resume)<\/li>\n<li>wakeup source:\u6807\u8bb0\u80fd\u5524\u9192\u7cfb\u7edf\u7684\u6e90,enable_irq_wake,\u6392\u67e5 \/sys\/kernel\/debug\/wakeup_sources<\/li>\n<li>clock framework:\u7edf\u4e00\u65f6\u949f\u7ba1\u7406(clk_prepare_enable);regulator framework:\u7535\u6e90\u8c03\u538b<\/li>\n<li>PM ops:\u7cfb\u7edf suspend \u548c Runtime PM \u4e24\u5957,SET_SYSTEM_SLEEP_PM_OPS \/ SET_RUNTIME_PM_OPS<\/li>\n<li>\u5d4c\u5165\u5f0f\u7701\u7535:cpufreq ondemand &#043; cpuidle \u6df1\u7761 &#043; Runtime PM &#043; \u7a7a\u95f2 suspend &#043; \u53ea\u7559\u5fc5\u8981\u5524\u9192\u6e90<\/li>\n<li>FreeRTOS tickless WFI &#061; cpuidle \u6700\u6d45\u7ea7,\u589e\u91cf\u662f\u591a\u7ea7 &#043; \u8bbe\u5907\u7ea7 &#043; \u7cfb\u7edf\u7ea7<\/li>\n<\/ul>\n<hr \/>\n<h2>\u901f\u67e5\u8868<\/h2>\n<table>\n<tr>\u60f3\u5e72\u5565\u7528\u4ec0\u4e48<\/tr>\n<tbody>\n<tr>\n<td>\u770b CPU \u9891\u7387<\/td>\n<td>cat \/sys\/\u2026\/cpu\/cpu0\/cpufreq\/scaling_cur_freq<\/td>\n<\/tr>\n<tr>\n<td>\u6539 governor<\/td>\n<td>echo ondemand &gt; \/sys\/\u2026\/scaling_governor<\/td>\n<\/tr>\n<tr>\n<td>\u8bbe\u56fa\u5b9a\u9891\u7387<\/td>\n<td>echo Hz &gt; \/sys\/\u2026\/scaling_setspeed<\/td>\n<\/tr>\n<tr>\n<td>\u770b idle \u72b6\u6001<\/td>\n<td>cat \/sys\/\u2026\/cpu0\/cpuidle\/state*\/name<\/td>\n<\/tr>\n<tr>\n<td>\u7981\u67d0 idle \u72b6\u6001<\/td>\n<td>echo 1 &gt; \/sys\/\u2026\/cpu0\/cpuidle\/state3\/disable<\/td>\n<\/tr>\n<tr>\n<td>\u770b\u8bbe\u5907 PM \u72b6\u6001<\/td>\n<td>cat \/sys\/devices\/\u2026\/power\/runtime_status<\/td>\n<\/tr>\n<tr>\n<td>\u7981\u8bbe\u5907\u81ea\u52a8\u6302\u8d77<\/td>\n<td>echo on &gt; \/sys\/devices\/\u2026\/power\/control<\/td>\n<\/tr>\n<tr>\n<td>\u7cfb\u7edf\u6302\u8d77<\/td>\n<td>echo mem &gt; \/sys\/power\/state<\/td>\n<\/tr>\n<tr>\n<td>\u770b\u652f\u6301\u7761\u7720\u72b6\u6001<\/td>\n<td>cat \/sys\/power\/state<\/td>\n<\/tr>\n<tr>\n<td>\u770b\u5524\u9192\u6e90<\/td>\n<td>cat \/sys\/kernel\/debug\/wakeup_sources<\/td>\n<\/tr>\n<tr>\n<td>\u8ba9\u4e2d\u65ad\u5524\u9192<\/td>\n<td>enable_irq_wake(irq)<\/td>\n<\/tr>\n<tr>\n<td>\u5f00\u65f6\u949f<\/td>\n<td>clk_prepare_enable(clk)<\/td>\n<\/tr>\n<tr>\n<td>\u8bbe\u7535\u538b<\/td>\n<td>regulator_set_voltage<\/td>\n<\/tr>\n<tr>\n<td>\u7701\u7535\u5206\u6790<\/td>\n<td>powertop<\/td>\n<\/tr>\n<tr>\n<td>Runtime PM \u5f15\u7528<\/td>\n<td>pm_runtime_get_sync \/ pm_runtime_put_sync<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p>&#x1f4a1;\u6280\u672f\u4e4b\u8def\u6f2b\u6f2b&#xff0c;\u5206\u4eab\u662f\u4e3a\u4e86\u66f4\u597d\u5730\u4ea4\u6d41\u3002\u5982\u679c\u672c\u6587\u7684\u5185\u5bb9\u5bf9\u4f60\u6709\u542f\u53d1&#xff0c;\u5e0c\u671b\u80fd\u5f97\u5230\u4f60\u7684 \u70b9\u8d5e &#x1f44d; \u548c \u6536\u85cf \u2b50\u3002<\/p>\n<p>\u5982\u679c\u4f60\u5728\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\u9047\u5230\u4e86\u5176\u4ed6\u95ee\u9898&#xff0c;\u6b22\u8fce\u5728 \u8bc4\u8bba\u533a &#x1f4ac; \u7559\u8a00&#xff0c;\u6211\u4eec\u4e00\u8d77\u63a2\u8ba8\u3002\u4e5f\u6b22\u8fce \u5173\u6ce8 &#x1f440; \u6211&#xff0c;\u4e00\u8d77\u4ea4\u6d41\u5e95\u5c42\u5f00\u53d1\u7684\u90a3\u4e9b\u4e8b\u513f\u3002<\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>15 \u00b7 \u7535\u6e90\u7ba1\u7406 \u672c\u7bc7\u5b9a\u4f4d:\u5d4c\u5165\u5f0f\u548c\u79fb\u52a8\u8bbe\u5907,\u7701\u7535\u662f\u786c\u6307\u6807\u3002FreeRTOS \u7528 tickless idle  WFI;Linux \u6709\u5b8c\u6574\u7535\u6e90\u7ba1\u7406\u6846\u67b6:cpuidle(\u7a7a\u95f2\u72b6\u6001)\u3001cpufreq(\u9891\u7387\u8c03\u8282)\u3001Runtime PM(\u8fd0\u884c\u65f6\u6309\u9700\u5f00\u5173\u8bbe\u5907)\u3001\u7cfb\u7edf\u7ea7 suspend\/hibernate\u3001wakeup source(\u5524\u9192\u6e90)\u3002\u672c\u7bc7\u8bb2\u6e05\u8fd9\u5957,\u8bfb\u5b8c\u80fd\u7ed9\u8bbe\u5907\u914d\u7701\u7535\u7b56\u7565\u3001\u80fd\u8c03\\&#8221;\u4e3a\u4ec0\u4e48\u8bbe\u5907\u4e0d\u4f11\u7720\\&#8221;\u3002 Linux \u7535\u6e90\u7ba1\u7406\u662ftickless\/WFI \u7684\u7cfb\u7edf\u5316\u6269\u5c55 FreeRTOS<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11820,58,43,44],"topic":[],"class_list":["post-113734","post","type-post","status-publish","format-standard","hentry","category-server","tag-atomgit","tag-linux","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010Linux\u5185\u6838\u4e13\u680f 15\u3011\u7535\u6e90\u7ba1\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/113734.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Linux\u5185\u6838\u4e13\u680f 15\u3011\u7535\u6e90\u7ba1\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"15 \u00b7 \u7535\u6e90\u7ba1\u7406 \u672c\u7bc7\u5b9a\u4f4d:\u5d4c\u5165\u5f0f\u548c\u79fb\u52a8\u8bbe\u5907,\u7701\u7535\u662f\u786c\u6307\u6807\u3002FreeRTOS \u7528 tickless idle WFI;Linux \u6709\u5b8c\u6574\u7535\u6e90\u7ba1\u7406\u6846\u67b6:cpuidle(\u7a7a\u95f2\u72b6\u6001)\u3001cpufreq(\u9891\u7387\u8c03\u8282)\u3001Runtime PM(\u8fd0\u884c\u65f6\u6309\u9700\u5f00\u5173\u8bbe\u5907)\u3001\u7cfb\u7edf\u7ea7 suspend\/hibernate\u3001wakeup source(\u5524\u9192\u6e90)\u3002\u672c\u7bc7\u8bb2\u6e05\u8fd9\u5957,\u8bfb\u5b8c\u80fd\u7ed9\u8bbe\u5907\u914d\u7701\u7535\u7b56\u7565\u3001\u80fd\u8c03&quot;\u4e3a\u4ec0\u4e48\u8bbe\u5907\u4e0d\u4f11\u7720&quot;\u3002 Linux \u7535\u6e90\u7ba1\u7406\u662ftickless\/WFI \u7684\u7cfb\u7edf\u5316\u6269\u5c55 FreeRTOS\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/113734.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-07T02:09:09+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/113734.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/113734.html\",\"name\":\"\u3010Linux\u5185\u6838\u4e13\u680f 15\u3011\u7535\u6e90\u7ba1\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-07T02:09:09+00:00\",\"dateModified\":\"2026-10-07T02:09:09+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/113734.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/113734.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/113734.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Linux\u5185\u6838\u4e13\u680f 15\u3011\u7535\u6e90\u7ba1\u7406\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Linux\u5185\u6838\u4e13\u680f 15\u3011\u7535\u6e90\u7ba1\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/113734.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Linux\u5185\u6838\u4e13\u680f 15\u3011\u7535\u6e90\u7ba1\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"15 \u00b7 \u7535\u6e90\u7ba1\u7406 \u672c\u7bc7\u5b9a\u4f4d:\u5d4c\u5165\u5f0f\u548c\u79fb\u52a8\u8bbe\u5907,\u7701\u7535\u662f\u786c\u6307\u6807\u3002FreeRTOS \u7528 tickless idle WFI;Linux \u6709\u5b8c\u6574\u7535\u6e90\u7ba1\u7406\u6846\u67b6:cpuidle(\u7a7a\u95f2\u72b6\u6001)\u3001cpufreq(\u9891\u7387\u8c03\u8282)\u3001Runtime PM(\u8fd0\u884c\u65f6\u6309\u9700\u5f00\u5173\u8bbe\u5907)\u3001\u7cfb\u7edf\u7ea7 suspend\/hibernate\u3001wakeup source(\u5524\u9192\u6e90)\u3002\u672c\u7bc7\u8bb2\u6e05\u8fd9\u5957,\u8bfb\u5b8c\u80fd\u7ed9\u8bbe\u5907\u914d\u7701\u7535\u7b56\u7565\u3001\u80fd\u8c03\"\u4e3a\u4ec0\u4e48\u8bbe\u5907\u4e0d\u4f11\u7720\"\u3002 Linux \u7535\u6e90\u7ba1\u7406\u662ftickless\/WFI \u7684\u7cfb\u7edf\u5316\u6269\u5c55 FreeRTOS","og_url":"https:\/\/www.wsisp.com\/helps\/113734.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-07T02:09:09+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/113734.html","url":"https:\/\/www.wsisp.com\/helps\/113734.html","name":"\u3010Linux\u5185\u6838\u4e13\u680f 15\u3011\u7535\u6e90\u7ba1\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-07T02:09:09+00:00","dateModified":"2026-10-07T02:09:09+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/113734.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/113734.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/113734.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010Linux\u5185\u6838\u4e13\u680f 15\u3011\u7535\u6e90\u7ba1\u7406"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/113734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=113734"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/113734\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=113734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=113734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=113734"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=113734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}