<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=OfkBhk</id>
	<title>ThinkWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=OfkBhk"/>
	<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/wiki/Special:Contributions/OfkBhk"/>
	<updated>2026-04-05T13:04:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.12</generator>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Talk:Tpctl&amp;diff=29206</id>
		<title>Talk:Tpctl</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Talk:Tpctl&amp;diff=29206"/>
		<updated>2007-04-11T12:41:11Z</updated>

		<summary type="html">&lt;p&gt;OfkBhk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &amp;quot;thinkpad&amp;quot; module kernel compatibility ==&lt;br /&gt;
&lt;br /&gt;
Ajunge, how do you compile the &amp;quot;thinkpad&amp;quot; module compile on kernel &amp;gt;=2.6.9? The latest thinkpad version (5.8) still uses &amp;quot;get_cpu_ptr&amp;quot; and &amp;quot;set_cpu_ptr&amp;quot;, which were removed in 2.6.9.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 13:53, 10 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The Debian thinkpad-source package in unstable (version 5.8-4) works just fine; I'm compiling it with 2.6.14 without any problems.  And get_cpu_ptr is present; it's defined in include/linux/percpu.h.&lt;br /&gt;
&lt;br /&gt;
--[[User:TedTso|TedTso]] 18:56, 17 Dec 2005 (EDT)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Stock thinkpad_5.8.tar.gz doesn't #include percpu.h anyway, and doesn't compile on vanilla 2.6.14.3 or 2.6.15-rc5. Maybe Debian patched it? In that case the article page should ref the patch.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 11:50, 18 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Oops, my mistake.  I forgot that I had patched my copy of thinkpadpm.c.   I replaced the use of get_cpu_ptr and set_cpu_ptr with get_cpu_val() and set_cpu_val().  I just double checked, and it tpctl is working for me on 2.6.15-rc5.&lt;br /&gt;
&lt;br /&gt;
--[[User:TedTso|TedTso]] 14:45, 19 Dec 2005 (EDT)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Care to send a patch? It would be useful on the article page, and maybe we can get it into upstream.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 23:11, 19 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This is the patch I'd been using up to 2.6.15:&lt;br /&gt;
&lt;br /&gt;
 [root@ccb-thinkpad thinkpad-5.8]# more thinkpad-2.6-per_cpu.patch&lt;br /&gt;
 --- 2.6/drivers/thinkpadpm.c.ccb        2005-07-02 01:02:47.000000000 -0400&lt;br /&gt;
     2.6/drivers/thinkpadpm.c    2005-07-02 01:13:20.000000000 -0400&lt;br /&gt;
 @@ -171,8  171,8 @@&lt;br /&gt;
  #define get_gdt_table()        (cpu_gdt_table[get_cpu()])&lt;br /&gt;
  #define put_gdt_table()        put_cpu()&lt;br /&gt;
  #else&lt;br /&gt;
 -#define get_gdt_table()        (get_cpu_ptr(cpu_gdt_table))&lt;br /&gt;
 -#define put_gdt_table()        put_cpu_ptr(cpu_gdt_table)&lt;br /&gt;
  #define get_gdt_table()        per_cpu(cpu_gdt_table, smp_processor_id())&lt;br /&gt;
  #define put_gdt_table()        put_cpu()&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
Sounds like TedTso took a slightly different approach.&lt;br /&gt;
&lt;br /&gt;
As it stands, it won't compile since the release of 2.6.15 because the&lt;br /&gt;
once global pm_active variable in the kernel is no longer visible.&lt;br /&gt;
&lt;br /&gt;
ccb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
Sorry for the ugliness of that patch.  Do a wiki edit on the page&lt;br /&gt;
and you'll see it on all of it's Courier10 glory.&lt;br /&gt;
&lt;br /&gt;
For 2.6.15: some of the definitions have been split off into a&lt;br /&gt;
new header file.  You'll have to edit thinkpadpm.c and add&lt;br /&gt;
&amp;quot;#include &amp;lt;linux/pm_legacy.h&amp;gt;&amp;quot; right after the include for pm.h&lt;br /&gt;
to get it to compile.&lt;br /&gt;
&lt;br /&gt;
ccb&lt;br /&gt;
----&lt;br /&gt;
Ugliness fixed. [[User:Wyrfel|Wyrfel]] 00:24, 13 February 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As of 2.6.16 they've reworked some of the macros again.  This patch&lt;br /&gt;
applied against virgin thinkpad-5.8 sources appears to work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--- ./2.6/drivers/thinkpadpm.c.ccb      2005-09-05 20:53:39.000000000 -0400&lt;br /&gt;
    ./2.6/drivers/thinkpadpm.c  2006-05-05 10:14:26.000000000 -0400&lt;br /&gt;
@@ -38,6  38,7 @@&lt;br /&gt;
 #include &amp;lt;asm/uaccess.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/apm_bios.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/pm.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/pm_legacy.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/version.h&amp;gt;&lt;br /&gt;
 #include &amp;quot;thinkpad_common.h&amp;quot;&lt;br /&gt;
 #include &amp;quot;thinkpadpm.h&amp;quot;&lt;br /&gt;
@@ -171,8  172,8 @@&lt;br /&gt;
 #define get_gdt_table()        (cpu_gdt_table[get_cpu()])&lt;br /&gt;
 #define put_gdt_table()        put_cpu()&lt;br /&gt;
 #else&lt;br /&gt;
-#define get_gdt_table()        (get_cpu_ptr(cpu_gdt_table))&lt;br /&gt;
-#define put_gdt_table()        put_cpu_ptr(cpu_gdt_table)&lt;br /&gt;
 #define get_gdt_table()        get_cpu_gdt_table(smp_processor_id())&lt;br /&gt;
 #define put_gdt_table()        put_cpu()&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
 /**&lt;br /&gt;
@@ -472,7  473,7 @@&lt;br /&gt;
 {&lt;br /&gt;
&lt;br /&gt;
        /*** Set up APM BIOS interface ***/&lt;br /&gt;
-       if ( !pm_active ) {&lt;br /&gt;
         if ( !pm_active ) {&lt;br /&gt;
                printk(KERN_INFO &amp;quot;thinkpadpm: Power management not active. :-(\n&amp;quot;);&lt;br /&gt;
                return -ENODEV;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ccb&lt;br /&gt;
----&lt;br /&gt;
Seems not to work since 2.6.17 (with thinkpad_6.0) because of the use of old MODULE_PARM macro and inter_module_* function.&lt;br /&gt;
&lt;br /&gt;
A patch is submitted [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=366170 here]&lt;br /&gt;
But due to my lack of experience, I have not tested it. If someone could confirm it works -or not...-&lt;br /&gt;
&lt;br /&gt;
Mat&lt;/div&gt;</summary>
		<author><name>OfkBhk</name></author>
		
	</entry>
</feed>