Bug 18722 - _OSI(Darwin) required for expresscard, but breaks ACPI battery -- macbook pro 5,2
Summary: _OSI(Darwin) required for expresscard, but breaks ACPI battery -- macbook pro...
Status: REJECTED WILL_NOT_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: Config-Interrupts (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: acpi_config-interrupts
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-18 00:55 UTC by Thomas Zwaagstra
Modified: 2010-09-28 02:31 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.35
Subsystem:
Regression: No
Bisected commit-id:


Attachments
original DSDT (234.72 KB, text/plain)
2010-09-18 00:56 UTC, Thomas Zwaagstra
Details
patched DSDT, 2 changes marked with "BUG" in comments (235.36 KB, text/plain)
2010-09-18 00:57 UTC, Thomas Zwaagstra
Details
acpidump (126.55 KB, text/plain)
2010-09-18 01:11 UTC, Thomas Zwaagstra
Details
lspci -vvxxx with acpi_osi=Darwin (48.20 KB, text/plain)
2010-09-27 10:38 UTC, Thomas Zwaagstra
Details
lspci -vvxxx without acpi_osi=Darwin (48.21 KB, text/plain)
2010-09-27 10:40 UTC, Thomas Zwaagstra
Details

Description Thomas Zwaagstra 2010-09-18 00:55:10 UTC
On the macbook pro 5,2, PCI-based expresscards do not work without adding acpi_osi=Darwin the the kernel command line.  However, with acpi_osi=Darwin, battery monitoring fails.  The DSDT file seems to report the correct config information to darwin, and fake information to everything else.  I've patched the DSDT to pass the correct information, so that expresscards work without breaking anything else.

I'm not sure if this is the correct place to report this bug, please reassign if necessary!

I'll attach the original and patched DSDT files
Comment 1 Thomas Zwaagstra 2010-09-18 00:56:16 UTC
Created attachment 30442 [details]
original DSDT
Comment 2 Thomas Zwaagstra 2010-09-18 00:57:21 UTC
Created attachment 30452 [details]
patched DSDT, 2 changes marked with "BUG" in comments
Comment 3 Thomas Zwaagstra 2010-09-18 01:11:06 UTC
Created attachment 30462 [details]
acpidump

the acpidump is the same with and without the patched DSDT
Comment 4 Thomas Zwaagstra 2010-09-18 01:14:12 UTC
oh another note, hotplug doesn't work either... this might be DSDT related but I don't know how to fix it.  Should I open another bug for that issue?
Comment 5 Zhang Rui 2010-09-27 02:54:28 UTC
(In reply to comment #0)
> On the macbook pro 5,2, PCI-based expresscards do not work without adding
> acpi_osi=Darwin the the kernel command line.

please attach the output of lspci -vvxxx both with and without acpi_osi=Darwin.

> However, with acpi_osi=Darwin,
> battery monitoring fails.  The DSDT file seems to report the correct config
> information to darwin, and fake information to everything else.

yes, you're right.
             Device (BAT0)
                    {
                        Method (_STA, 0, NotSerialized)
                        {
                            If (OSDW ())
                            {
                                Return (0x00)
                            }
                            ...
                        }
                    }
If you're using acpi_osi=Darwin, the Battery status is always "not present". :)

> I've patched
> the DSDT to pass the correct information, so that expresscards work without
> breaking anything else.
> 
> I'm not sure if this is the correct place to report this bug, please reassign
> if necessary!
> 
yes, it is. :)
Comment 6 Zhang Rui 2010-09-27 02:56:19 UTC
BTW:
             Device (BAT0)
                    {
                        Method (_STA, 0, NotSerialized)
                        {
//                          If (OSDW ())
//                          {
//                              Return (0x00)
//                          }
                            ...
                        }
                    }
I think you can workaround this problem by commenting these four lines. can you verify this?
Comment 7 Thomas Zwaagstra 2010-09-27 10:05:37 UTC
I should have mentioned that I do boot my patched DSDT _without_ acpi_osi=Darwin and the battery works, so yes, commenting those lines should fix the battery problem.  I'll have to rebuild my kernel to verify.

As for the lspci, I'll get that as soon as I rebuild my kernel without the dsdt patch.

I should also be able to boot via EFI, which gives a slightly different lspci output, and exposes the secondary GPU.  Would that information be helpful too?
Comment 8 Thomas Zwaagstra 2010-09-27 10:38:48 UTC
Created attachment 31592 [details]
lspci -vvxxx with acpi_osi=Darwin
Comment 9 Thomas Zwaagstra 2010-09-27 10:40:08 UTC
Created attachment 31602 [details]
lspci -vvxxx without acpi_osi=Darwin
Comment 10 Thomas Zwaagstra 2010-09-27 11:00:32 UTC
I patched the DSDT by commenting out the 4 lines above, plus the 1 line change necessary to make it compile, and ran it with acpi_osi=Darwin.  As expected, the battery works, as well as the expresscard.

I'm not sure whether it's better to run acpi_osi=Darwin with the DSDT battery fix, or keep it without acpi_osi and use the DSDT expresscard fix. Everything seems functional both ways
Comment 11 Zhang Rui 2010-09-28 00:28:37 UTC
okay.
Now it's clear that this is a BIOS problem. and the battery seems not work on windows neither.
Anyway, you can use either of the fixes above as a workaround, and I'm afraid we can not fix it in Linux/ACPI.
Comment 12 Thomas Zwaagstra 2010-09-28 01:59:43 UTC
I appreciate your help, but I have to disagree on one point.  I just installed Windows XP to test it's support, and it supports both the battery and the expresscard without a modified DSDT or any additional drivers or configuration.  I have a feeling that it ignores certain details provided by the DSDT and probes for the battery by some other mechanism.

I'm comfortable with using a patched DSDT, but I know that most users are not.  This could be a dealbreaker for someone switching from windows to ubuntu, for example, where running a modified kernel is difficult and virtually unsupported.

Is there a way to use a patched DSDT without recompiling the kernel?  Perhaps this would be useful for people running a distro-supplied kernel.

Thanks,

Tom
Comment 13 Zhang Rui 2010-09-28 02:31:17 UTC
(In reply to comment #12)
> I appreciate your help, but I have to disagree on one point.  I just
> installed
> Windows XP to test it's support, and it supports both the battery and the
> expresscard without a modified DSDT or any additional drivers or
> configuration.
>  I have a feeling that it ignores certain details provided by the DSDT and
> probes for the battery by some other mechanism.
> 
Then this seems to be a real problem, bug re-opened.

> I'm comfortable with using a patched DSDT, but I know that most users are
> not. 
> This could be a dealbreaker for someone switching from windows to ubuntu, for
> example, where running a modified kernel is difficult and virtually
> unsupported.
> 
> Is there a way to use a patched DSDT without recompiling the kernel?  Perhaps
> this would be useful for people running a distro-supplied kernel.
> 
yes, you can override the battery _STA method at runtime.
How to override an ACPI control method can be found at kernel_src/Documentation/acpi/method-customizing.txt.

Note You need to log in before you can comment on or make changes to this bug.