All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: Can't load speedstep-centrino on IBM x336?
@ 2005-10-25  2:00 Pallipadi, Venkatesh
  2005-10-25  6:18 ` Darrick J. Wong
  0 siblings, 1 reply; 9+ messages in thread
From: Pallipadi, Venkatesh @ 2005-10-25  2:00 UTC (permalink / raw)
  To: Darrick J. Wong, Dave Jones; +Cc: cpufreq, Chris McDermott


It is just that speedstep-centrino driver can only handle
FIXED_HARDWARE. For SYSTEM_IO you should be using acpi-cpufreq driver.
Please try that driver and things should work fine.

Thanks,
Venki 

>-----Original Message-----
>From: cpufreq-bounces@lists.linux.org.uk 
>[mailto:cpufreq-bounces@lists.linux.org.uk] On Behalf Of 
>Darrick J. Wong
>Sent: Monday, October 24, 2005 6:48 PM
>To: Dave Jones
>Cc: cpufreq@lists.linux.org.uk; Chris McDermott
>Subject: Can't load speedstep-centrino on IBM x336?
>
>Hi all,
>
>I've been trying to get Enhanced SpeedStep working on an IBM x336
>(3.6GHz Xeon).  If I load the speedstep-centrino driver with cpufreq
>debugging turned on, I get a message about "Invalid control/status
>registers (1 - 1)" and the module refuses to load.  It seems that the
>stumbling point is this chunk of code in centrino_cpu_init_acpi():
>
>if ((p.control_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE) ||
>    (p.status_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE)) {
>        dprintk("Invalid control/status registers (%x - %x)\n",
>               p.control_register.space_id, 
>p.status_register.space_id);
>        result = -EIO;
>        goto err_unreg;
>}
>
>I decompiled the DSDT code that the BIOS supplies, and it 
>seems that the
>_PCT method returns control and status registers in SystemIO space if
>\SMIM is set (it is set to 0x1 earlier):
>
>
>Method (_PCT, 0, NotSerialized)
>{
>    If (\SMIM)
>    {
>        Return (Package (0x02)
>        {
>            ResourceTemplate ()
>            {
>                Register (SystemIO, 0x10, 0x00, 0x0000000000000800)
>            },
>            ResourceTemplate ()
>            {
>                Register (SystemIO, 0x10, 0x00, 0x0000000000000804)
>            }
>        })
>    }
>    Return (Package (0x02)
>    {
>        ResourceTemplate ()
>        {
>            Register (FFixedHW, 0x40, 0x00, 0x0000000000000199)
>        },
>        ResourceTemplate ()
>        {
>            Register (FFixedHW, 0x10, 0x00, 0x0000000000000198)
>        }
>    })
>}
>
>I checked with the ACPI specs v2.0c and v3.0, and neither of them seem
>to restrict the register address space to "fixed hardware".  Linux,
>however, expects FIXED_HARDWARE, not SYSTEM_IO, causing the error
>space_id checking to trip.  However, EST seems to work just fine on the
>x336 without this check.  I built a kernel without this code and was
>able to switch frequencies and governors in a loop without any adverse
>effects.  /proc/cpuinfo was getting updated, too.
>
>So now I'm wondering three things: Is there a reason why there is this
>address space check?  Can we get rid of it?  And, am I supposed to be
>using acpi_cpufreq instead?  The speedstep_centrino code seems to
>indicate that my CPU revision (0xF41) should be supported by 
>this driver...
>
>(Attached is a patch against 2.6.14-rc4 to get rid of the check.)
>
>--Darrick
>

^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: Can't load speedstep-centrino on IBM x336?
@ 2005-10-28  1:05 Pallipadi, Venkatesh
  2005-10-30  2:34 ` Darrick J. Wong
  0 siblings, 1 reply; 9+ messages in thread
From: Pallipadi, Venkatesh @ 2005-10-28  1:05 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Dave Jones, Chris McDermott, cpufreq

 

>-----Original Message-----
>From: Darrick J. Wong [mailto:djwong@us.ibm.com] 
>Sent: Thursday, October 27, 2005 5:54 PM
>To: Pallipadi, Venkatesh
>Cc: Dave Jones; cpufreq@lists.linux.org.uk; Chris McDermott
>Subject: Re: Can't load speedstep-centrino on IBM x336?
>
>Venkatesh,
>
>It turns out that RHEL4 wasn't calling the SMM to tell it that the OS
>would handle the p-state transitions.  Thus, the status register trap
>never got set up, which is why I kept reading 0xFFFF.  RHEL4 also
>obliterates the value of PSTATE_CNT if the FADT revision is 1.0, so I
>sent RH a backport of mainline's cpufreq, which only obliterates
>PSTATE_CNT if acpi=strict and also makes that call to SMM.  With that
>patch, DBS works great.
>

Ok. That's good news. Can you share that patch here? Thanks.

>However, I am curious about the removal of the status register check in
>acpi_cpufreq--how slow is reading that status register?  

It is really slow due to SMM. 100+ mS. One one system I measured it as
500 mS.

> It seems to me
>that it's a rather good idea to check that the operation actually
>succeeded, instead of assuming that it does and changing the reported
>clock speed as if it did, because any failures that happen will be
>silent; we could only tell if the switch succeeded for sure by running
>CPU benchmarks.  But, perhaps there's a justification for removing it
>that I simply don't know about?

It is mostly needed for enabling new platforms. But, once thinsg are
working, it really is not required to be tested all the time. It doubles
the time for a P-state transition.

Thanks,
Venki

^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: Can't load speedstep-centrino on IBM x336?
@ 2005-10-26 17:01 Pallipadi, Venkatesh
  2005-10-28  0:53 ` Darrick J. Wong
  0 siblings, 1 reply; 9+ messages in thread
From: Pallipadi, Venkatesh @ 2005-10-26 17:01 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Dave Jones, Chris McDermott, cpufreq


 

>-----Original Message-----
>From: Darrick J. Wong [mailto:djwong@us.ibm.com] 
>
>Hmm... ok then, mainline is working.  Thanks for the data!
>
>Unfortunately, RHEL4 U2's "acpi" (it's based on 2.6.9) module doesn't
>work--it prints the "Looking..." message and then "Transition failed."
>when it doesn't find the value it's looking for (0x0E1E) and 
>gets 0xFFFF

When using SYSTEM_IO, The acpi driver does the IO call with proper
parameters to change the frequency. BIOS then comes in and does the
actual P-state transition in SMM mode (after the cordination across
logical CPUs). After the transition, BIOS is supposed to export the
result in another IO port, which OS tries to read and verify. This
verification was removed in the latest base kernel, but is present in
2.6.9 (and RHEL4).

So, the problem here may be:
1) BIOS is not doing the transition. Hence when OS tries to verify by
readon the status IO port, it sees the transition has failed.
2) BIOS is doing the transition, but not reflecting the status in status
IO port or reporting some error there. Hence again OS fails to see the
change.
3) Some other bug in the OS driver.

Having seen various bugs in different BIOSes related to this, and I am
kind of confident that this also ia a bug in BIOS and not a OS issue.
Can you please check with the BIOS folks on how exactly they are doing
these transitions in SMM. You can also let me know if you need any more
details about the driver itself.

Thanks,
Venki 

>instead.  Do you have any suggestions?  (If you're not familiar with
>RHEL4, that's fine too.)
>
>--D
>
>Venkatesh Pallipadi wrote:
>> On Mon, Oct 24, 2005 at 11:18:19PM -0700, Darrick J. Wong wrote:
>> 
>>>Ok, I tried acpi-cpufreq and tried to change the frequency 
>from 3.6GHz
>>>to 2.8.  scaling_cur_freq says I'm at 2800MHz, but 
>/proc/cpuinfo still
>>>says 3600.  In dmesg, I see "Writing 0x00000e1e to port 
>0x0800" at the
>>>very end of the log, but I don't see "Looking for 0x00000e1e 
>from port
>>>0x0804" like I think I should.  I don't see "Invalid port width..."
>>>either--it's as if we fell out of the function.
>>>
>> 
>> 
>> If scaling_cur_freq shows you the right freq, then things 
>should be working.
>> We recently removed "Looking for * from port" in the common path.
>> 
>> What /proc/cpuinfo shows kind of depends on other things. I 
>had this patch 
>> in my queue that fixes things with /proc/cpuinfo. This 
>should help here..
>> 
>> Thanks,
>> Venki
>

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Can't load speedstep-centrino on IBM x336?
@ 2005-10-25  1:48 Darrick J. Wong
  0 siblings, 0 replies; 9+ messages in thread
From: Darrick J. Wong @ 2005-10-25  1:48 UTC (permalink / raw)
  To: Dave Jones; +Cc: cpufreq, Chris McDermott


[-- Attachment #1.1.1: Type: text/plain, Size: 2328 bytes --]

Hi all,

I've been trying to get Enhanced SpeedStep working on an IBM x336
(3.6GHz Xeon).  If I load the speedstep-centrino driver with cpufreq
debugging turned on, I get a message about "Invalid control/status
registers (1 - 1)" and the module refuses to load.  It seems that the
stumbling point is this chunk of code in centrino_cpu_init_acpi():

if ((p.control_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE) ||
    (p.status_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE)) {
        dprintk("Invalid control/status registers (%x - %x)\n",
               p.control_register.space_id, p.status_register.space_id);
        result = -EIO;
        goto err_unreg;
}

I decompiled the DSDT code that the BIOS supplies, and it seems that the
_PCT method returns control and status registers in SystemIO space if
\SMIM is set (it is set to 0x1 earlier):


Method (_PCT, 0, NotSerialized)
{
    If (\SMIM)
    {
        Return (Package (0x02)
        {
            ResourceTemplate ()
            {
                Register (SystemIO, 0x10, 0x00, 0x0000000000000800)
            },
            ResourceTemplate ()
            {
                Register (SystemIO, 0x10, 0x00, 0x0000000000000804)
            }
        })
    }
    Return (Package (0x02)
    {
        ResourceTemplate ()
        {
            Register (FFixedHW, 0x40, 0x00, 0x0000000000000199)
        },
        ResourceTemplate ()
        {
            Register (FFixedHW, 0x10, 0x00, 0x0000000000000198)
        }
    })
}

I checked with the ACPI specs v2.0c and v3.0, and neither of them seem
to restrict the register address space to "fixed hardware".  Linux,
however, expects FIXED_HARDWARE, not SYSTEM_IO, causing the error
space_id checking to trip.  However, EST seems to work just fine on the
x336 without this check.  I built a kernel without this code and was
able to switch frequencies and governors in a loop without any adverse
effects.  /proc/cpuinfo was getting updated, too.

So now I'm wondering three things: Is there a reason why there is this
address space check?  Can we get rid of it?  And, am I supposed to be
using acpi_cpufreq instead?  The speedstep_centrino code seems to
indicate that my CPU revision (0xF41) should be supported by this driver...

(Attached is a patch against 2.6.14-rc4 to get rid of the check.)

--Darrick

[-- Attachment #1.1.2: x336-centrino.patch --]
[-- Type: text/x-patch, Size: 807 bytes --]

diff -Naur b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
--- b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c	2005-10-24 18:24:06.000000000 -0700
+++ a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c	2005-10-24 18:28:22.000000000 -0700
@@ -392,14 +392,6 @@
 		goto err_unreg;
 	}
 
-	if ((p.control_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE) ||
-	    (p.status_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE)) {
-		dprintk("Invalid control/status registers (%x - %x)\n",
-			p.control_register.space_id, p.status_register.space_id);
-		result = -EIO;
-		goto err_unreg;
-	}
-
 	for (i=0; i<p.state_count; i++) {
 		if (p.states[i].control != p.states[i].status) {
 			dprintk("Different control (%llu) and status values (%llu)\n",

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 147 bytes --]

_______________________________________________
Cpufreq mailing list
Cpufreq@lists.linux.org.uk
http://lists.linux.org.uk/mailman/listinfo/cpufreq

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-10-30  2:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-25  2:00 Can't load speedstep-centrino on IBM x336? Pallipadi, Venkatesh
2005-10-25  6:18 ` Darrick J. Wong
2005-10-25 16:21   ` Venkatesh Pallipadi
2005-10-26  2:31     ` Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2005-10-28  1:05 Pallipadi, Venkatesh
2005-10-30  2:34 ` Darrick J. Wong
2005-10-26 17:01 Pallipadi, Venkatesh
2005-10-28  0:53 ` Darrick J. Wong
2005-10-25  1:48 Darrick J. Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.