[haiku-bugs] Re: [Haiku] #5838: Enabled ACPI , but cant install Battery Bar Replicant in tray.

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Thu, 06 May 2010 18:55:00 -0000

#5838: Enabled ACPI , but cant install Battery Bar Replicant in tray.
--------------------------+-------------------------------------------------
 Reporter:  streak        |       Owner:  czeidler      
     Type:  bug           |      Status:  assigned      
 Priority:  normal        |   Milestone:  R1/alpha2     
Component:  Drivers/ACPI  |     Version:  R1/Development
 Keywords:                |   Blockedby:                
 Platform:  All           |    Blocking:                
--------------------------+-------------------------------------------------

Comment(by bonefish):

 Replying to [comment:14 phoudoin]:
 > Currently the driver supports only EIST control & status registers
 addresses and freq/states values hardcoded.
 >
 > But here it sounds like EIST set and get state MSR registers are not
 located/setup by MSI bios at default addresses 0x198 and 0x199. These
 locations should probably be retrieved from _PCT ACPI object instead, as
 the supported freq/states pairs, in _PSS ACPI object. In particular when
 ACPI 2.0 is in used, like with this MSI Wind.

 Not sure what you're talking about here. My knowledge regarding ACPI is
 close to non-existent. I do, however, have the "Intel® 64 and IA-32
 Architectures, Software Developer’s Manual, Volume 3A: System Programming
 Guide, Part 1, June 2009" at hand, which in chapter 14 details on ''Power
 and Thermal Management''. To my knowledge MSRs always have fixed indexes.
 For the three concerned ones the following table gives the names of the
 registers as per spec, the corresponding macro names in the driver
 (unfortunately not matching the spec name), the register indexes, and
 specification sections of definition for the indexes:
 ||'''Name (Spec)'''||'''Name (Driver)'''||'''Register Index'''||'''Defined
 in Spec Section'''||
 ||IA32_PERF_STATUS||MSR_GET_FREQ_STATE||0x198||14.3.2.2||
 ||IA32_PERF_CTL||MSR_SET_FREQ_STATE||0x199||14.3.2.2||
 ||IA32_MISC_ENABLE||MSR_MISC||0x1a0||8.7.8||

 After a quick look at the driver I see at least two issues:
  - est_open() enables SpeedStep only on the current logical CPU, not on
 all CPUs. At least after a quick scan of the specs I find no indication
 that this has not to be done for all CPUs. That would at least explain an
 exception (probably #GP; the panic message is unfortunately missing in the
 screen shot) -- when writing to IA32_PERF_CTL on a CPU that doesn't have
 the feature enabled.
  - The driver seems to be ignorant where multi-threading is concerned. I
 see no locking at all, and I have the feeling that e.g. est_set_id16()
 should really not be executed by two threads at the same time. Since
 interrupts are enabled a thread might even change the CPU while executing
 the function, which definitely is a problem, if the MSRs are really per-
 CPU.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/5838#comment:15>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: