Contribute
Register

HP OMEN 15-ax202na

Status
Not open for further replies.
Hi @RehabMan,

Thanks for your help so far. I was able to follow the code in my laptop's DSDT to see the processes that _BIF and _BST take to do their jobs, but I wasn't able to identify where my issue may be coming from. From what I understand:

1. _BIF runs through to the 2nd if statement and calls UPBI
2. UPBI runs and calls:
Code:
Store ("Primary", Index (PBIF, 0x09))
which seems to output:
Code:
kernel: (ACPIBatteryManager) ACPIBatteryManager: setBatteryBIF: acpibat_bif size = 13
2018-06-27 23:10:42.529098+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fPowerUnit       = 0x1
2018-06-27 23:10:42.529100+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fDesignCapacityRaw  = 3776
2018-06-27 23:10:42.529102+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fMaxCapacityRaw     = 3776
2018-06-27 23:10:42.529104+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fBatteryTech     = 0x1
2018-06-27 23:10:42.529106+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fDesignVoltage   = 15400
2018-06-27 23:10:42.529108+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCapacityWarningRaw = 0
2018-06-27 23:10:42.529110+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fLowWarningRaw      = 0
2018-06-27 23:10:42.529112+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fDeviceName      = 'Primary'
2018-06-27 23:10:42.529115+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fSerialNumber    = ' '
2018-06-27 23:10:42.529117+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fType            = 'LION'
2018-06-27 23:10:42.529119+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fManufacturer    = 'Hewlett-Packard'
2018-06-27 23:10:42.529124+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: setBatterySerialNumber called
2018-06-27 23:10:42.529131+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: getBatteryBST called
2018-06-27 23:10:42.529459+0100 0x168      Default     0x0                  0      0

3. UPUM is called, runs and exits
4. UPBI exits
5. _BIF exits
6. _BST runs to the second if statement before calling UPBS
7. UPBS run until the end of the third if statement, where after, this runs:

Code:
Store (B1B2 (^^PCI0.LPCB.EC0.BCV0, ^^PCI0.LPCB.EC0.BCV1), Index (PBST, 0x03))
Store (^^PCI0.LPCB.EC0.MBST, Index (PBST, Zero))
and we get this:
Code:
kernel: (ACPIBatteryManager) ACPIBatteryManager: setBatteryBST: acpibat_bst size = 4
2018-06-27 23:10:42.533549+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fPowerUnit       = 0x1
2018-06-27 23:10:42.533551+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: currentStatus    = 0x0
2018-06-27 23:10:42.533553+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentRate     = 4163
2018-06-27 23:10:42.533555+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentCapacity = 768
2018-06-27 23:10:42.533557+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentVoltage  = 16403
2018-06-27 23:10:42.533559+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fAverageRate = 4163
2018-06-27 23:10:42.533569+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: Battery is charged.
2018-06-27 23:10:42.533574+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: rebuildLegacyIOBatteryInfo called
2018-06-27 23:10:42.533606+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fRealAC=-1, fACConnected=1
2018-06-27 23:10:42.533612+0100 0x7c       Default     0x0                  0      0

8. UPBS exits
9. _BST exits

Any help would be greatly appreciated. Latest gen_debug attached.

Thank you.
 

Attachments

  • debug_23728.zip
    2.8 MB · Views: 84
Hi @RehabMan,

Thanks for your help so far. I was able to follow the code in my laptop's DSDT to see the processes that _BIF and _BST take to do their jobs, but I wasn't able to identify where my issue may be coming from. From what I understand:

1. _BIF runs through to the 2nd if statement and calls UPBI
2. UPBI runs and calls:
Code:
Store ("Primary", Index (PBIF, 0x09))
which seems to output:
Code:
kernel: (ACPIBatteryManager) ACPIBatteryManager: setBatteryBIF: acpibat_bif size = 13
2018-06-27 23:10:42.529098+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fPowerUnit       = 0x1
2018-06-27 23:10:42.529100+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fDesignCapacityRaw  = 3776
2018-06-27 23:10:42.529102+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fMaxCapacityRaw     = 3776
2018-06-27 23:10:42.529104+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fBatteryTech     = 0x1
2018-06-27 23:10:42.529106+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fDesignVoltage   = 15400
2018-06-27 23:10:42.529108+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCapacityWarningRaw = 0
2018-06-27 23:10:42.529110+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fLowWarningRaw      = 0
2018-06-27 23:10:42.529112+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fDeviceName      = 'Primary'
2018-06-27 23:10:42.529115+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fSerialNumber    = ' '
2018-06-27 23:10:42.529117+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fType            = 'LION'
2018-06-27 23:10:42.529119+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fManufacturer    = 'Hewlett-Packard'
2018-06-27 23:10:42.529124+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: setBatterySerialNumber called
2018-06-27 23:10:42.529131+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: getBatteryBST called
2018-06-27 23:10:42.529459+0100 0x168      Default     0x0                  0      0

3. UPUM is called, runs and exits
4. UPBI exits
5. _BIF exits
6. _BST runs to the second if statement before calling UPBS
7. UPBS run until the end of the third if statement, where after, this runs:

Code:
Store (B1B2 (^^PCI0.LPCB.EC0.BCV0, ^^PCI0.LPCB.EC0.BCV1), Index (PBST, 0x03))
Store (^^PCI0.LPCB.EC0.MBST, Index (PBST, Zero))
and we get this:
Code:
kernel: (ACPIBatteryManager) ACPIBatteryManager: setBatteryBST: acpibat_bst size = 4
2018-06-27 23:10:42.533549+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fPowerUnit       = 0x1
2018-06-27 23:10:42.533551+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: currentStatus    = 0x0
2018-06-27 23:10:42.533553+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentRate     = 4163
2018-06-27 23:10:42.533555+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentCapacity = 768
2018-06-27 23:10:42.533557+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentVoltage  = 16403
2018-06-27 23:10:42.533559+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fAverageRate = 4163
2018-06-27 23:10:42.533569+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: Battery is charged.
2018-06-27 23:10:42.533574+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: rebuildLegacyIOBatteryInfo called
2018-06-27 23:10:42.533606+0100 0xf7       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fRealAC=-1, fACConnected=1
2018-06-27 23:10:42.533612+0100 0x7c       Default     0x0                  0      0

8. UPBS exits
9. _BST exits

Any help would be greatly appreciated. Latest gen_debug attached.

Thank you.

First you must determine what you think to be incorrect in the data returned by _BST or _BIF.
Only then you can move on to determining why it is wrong.
 
First you must determine what you think to be incorrect in the data returned by _BST or _BIF.
Only then you can move on to determining why it is wrong.

Hi RehabMan,

I've been taking a look at my system console, searching or "Battery", and these are the only things I've noticed that don't seem to be 'normal'. First, of all, I'm getting this:
Code:
ACPIBatteryManager: fSerialNumber    = ' '
I'm not sure if this would cause an issue, but my battery's serial number isn't being set. This probably doesn't affect anything in macOS though?


Next, I'm noticing that my current capacity is being set to 0. This is the obvious error - if the current capacity is 0, the battery can't charge past 0?

Code:
ACPIBatteryManager: fCurrentCapacity = 0


And last, the battery status is being set to 31 (dec)? I'm not familiar with macOS battery status codes, but 31 seems a bit odd I'd assume that there'd be four states - for example:
  • 0 = no battery
  • 1 = charging
  • 2 = battery full
  • 3 = running on battery
Code:
ACPIBatteryManager: setBatterySTA: battery_status = 0x1f

No system changes, but I've regenerated my debug files. Many thanks.
 

Attachments

  • debug_1658.zip
    2.5 MB · Views: 107
It likely means _BST is failing to provide valid data.
Continue to investigate _BST code.
Thanks for confirming that for me. Would my problem be in _BST or in a function that _BST calls? What exactly am I looking for?

Looking at my log, I see this:

Code:
2018-07-02 19:44:59.529972+0100 0x16a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "Entering _BST"

2018-07-02 19:44:59.530286+0100 0x16a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "_BST: First if statement"

2018-07-02 19:44:59.530447+0100 0x16a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "_BST: Second if statement"

2018-07-02 19:44:59.530800+0100 0x16a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "Entering UPBS"

2018-07-02 19:44:59.531196+0100 0x16a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: Second else statement"

2018-07-02 19:44:59.531302+0100 0x16a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: End of second else statement"

2018-07-02 19:44:59.531987+0100 0x15a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: Third if statement"

2018-07-02 19:44:59.532091+0100 0x15a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: Fourth if statement"

2018-07-02 19:44:59.532189+0100 0x15a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: End of fourth if statement"

2018-07-02 19:44:59.532286+0100 0x15a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: End of third if statement"

2018-07-02 19:44:59.533835+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: setBatteryBST: acpibat_bst size = 4

2018-07-02 19:44:59.533835+0100 0x47a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "Exiting UPBS"

2018-07-02 19:44:59.533839+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fPowerUnit       = 0x1

2018-07-02 19:44:59.533841+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: currentStatus    = 0x2

2018-07-02 19:44:59.533843+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentRate     = 4164

2018-07-02 19:44:59.533845+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentCapacity = 0

2018-07-02 19:44:59.533848+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentVoltage  = 15052

2018-07-02 19:44:59.533850+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fAverageRate = 4164

2018-07-02 19:44:59.533858+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: Battery is charging.

2018-07-02 19:44:59.533863+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: rebuildLegacyIOBatteryInfo called

2018-07-02 19:44:59.533906+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fRealAC=-1, fACConnected=1

2018-07-02 19:44:59.533961+0100 0x47a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "_BST: End of second if statement"

2018-07-02 19:44:59.534066+0100 0x47a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "_BST: End of first if statement"

2018-07-02 19:44:59.534174+0100 0x47a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "Exiting _BST"


The printout of data containing the invalid current capacity seems to come from exiting UPBS. These are the last lines of UPBS

Code:
Store (B1B2 (^^PCI0.LPCB.EC0.BCV0, ^^PCI0.LPCB.EC0.BCV1), Index (PBST, 0x03))
Store (^^PCI0.LPCB.EC0.MBST, Index (PBST, Zero))
\RMDT.PUSH ("Exiting UPBS")

Could it be anything to do with the B1B2 on line 1 of this snippet? Sorry, I'm not great at DSDT analysis.

Thanks for your help.
 
Thanks for confirming that for me. Would my problem be in _BST or in a function that _BST calls? What exactly am I looking for?

Looking at my log, I see this:

Code:
2018-07-02 19:44:59.529972+0100 0x16a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "Entering _BST"

2018-07-02 19:44:59.530286+0100 0x16a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "_BST: First if statement"

2018-07-02 19:44:59.530447+0100 0x16a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "_BST: Second if statement"

2018-07-02 19:44:59.530800+0100 0x16a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "Entering UPBS"

2018-07-02 19:44:59.531196+0100 0x16a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: Second else statement"

2018-07-02 19:44:59.531302+0100 0x16a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: End of second else statement"

2018-07-02 19:44:59.531987+0100 0x15a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: Third if statement"

2018-07-02 19:44:59.532091+0100 0x15a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: Fourth if statement"

2018-07-02 19:44:59.532189+0100 0x15a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: End of fourth if statement"

2018-07-02 19:44:59.532286+0100 0x15a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: End of third if statement"

2018-07-02 19:44:59.533835+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: setBatteryBST: acpibat_bst size = 4

2018-07-02 19:44:59.533835+0100 0x47a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "Exiting UPBS"

2018-07-02 19:44:59.533839+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fPowerUnit       = 0x1

2018-07-02 19:44:59.533841+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: currentStatus    = 0x2

2018-07-02 19:44:59.533843+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentRate     = 4164

2018-07-02 19:44:59.533845+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentCapacity = 0

2018-07-02 19:44:59.533848+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentVoltage  = 15052

2018-07-02 19:44:59.533850+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fAverageRate = 4164

2018-07-02 19:44:59.533858+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: Battery is charging.

2018-07-02 19:44:59.533863+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: rebuildLegacyIOBatteryInfo called

2018-07-02 19:44:59.533906+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fRealAC=-1, fACConnected=1

2018-07-02 19:44:59.533961+0100 0x47a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "_BST: End of second if statement"

2018-07-02 19:44:59.534066+0100 0x47a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "_BST: End of first if statement"

2018-07-02 19:44:59.534174+0100 0x47a      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "Exiting _BST"


The printout of data containing the invalid current capacity seems to come from exiting UPBS. These are the last lines of UPBS

Code:
Store (B1B2 (^^PCI0.LPCB.EC0.BCV0, ^^PCI0.LPCB.EC0.BCV1), Index (PBST, 0x03))
Store (^^PCI0.LPCB.EC0.MBST, Index (PBST, Zero))
\RMDT.PUSH ("Exiting UPBS")

Could it be anything to do with the B1B2 on line 1 of this snippet? Sorry, I'm not great at DSDT analysis.

Thanks for your help.

The heart of your _BST is in UPBS. You will need to debug it...
 
The heart of your _BST is in UPBS. You will need to debug it...

Hi RehabMan, thanks for the help.

First of all, here's my latest _BST log
Code:
2018-07-02 21:55:39.530236+0100 0x7c       Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "Entering _BST"

2018-07-02 21:55:39.530366+0100 0x7c       Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "_BST: First if statement"

2018-07-02 21:55:39.530735+0100 0x7c       Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "_BST: Second if statement"

2018-07-02 21:55:39.531429+0100 0x7c       Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "Entering UPBS"

2018-07-02 21:55:39.531559+0100 0x7c       Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "UPBS: Local0: ", 0x1044, }

2018-07-02 21:55:39.531712+0100 0x7c       Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: Second else statement"

2018-07-02 21:55:39.531839+0100 0x7c       Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "UPBS: PBST: ", { 0x0, 0x1044, 0xffffffff, 0x2710, }, }

2018-07-02 21:55:39.532007+0100 0x7c       Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: End of second else statement"

2018-07-02 21:55:39.533483+0100 0x111      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "UPBS: Local5: ", 0x1a, }

2018-07-02 21:55:39.534262+0100 0x111      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: Third if statement"

2018-07-02 21:55:39.534401+0100 0x111      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "UPBS: Local5: ", 0x0, }

2018-07-02 21:55:39.534526+0100 0x111      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "UPBS: Local5: ", 0x0, }

2018-07-02 21:55:39.534809+0100 0x111      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: Fourth if statement"

2018-07-02 21:55:39.534947+0100 0x111      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "UPBS: PBST: ", { 0x0, 0x1044, 0x0, 0x2710, }, }

2018-07-02 21:55:39.535088+0100 0x111      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: End of fourth if statement"

2018-07-02 21:55:39.535219+0100 0x111      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: End of third if statement"

2018-07-02 21:55:39.535650+0100 0x481      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "UPBS: PBST: ", { 0x0, 0x1044, 0x0, 0x3b7a, }, }

2018-07-02 21:55:39.536697+0100 0x483      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "UPBS: PBST: ", { 0x2, 0x1044, 0x0, 0x3b7a, }, }

2018-07-02 21:55:39.536966+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: setBatteryBST: acpibat_bst size = 4

2018-07-02 21:55:39.536969+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fPowerUnit       = 0x1

2018-07-02 21:55:39.536971+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: currentStatus    = 0x2

2018-07-02 21:55:39.536973+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentRate     = 4164

2018-07-02 21:55:39.536975+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentCapacity = 0

2018-07-02 21:55:39.536977+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentVoltage  = 15226

2018-07-02 21:55:39.536983+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fAverageRate = 4164

2018-07-02 21:55:39.536992+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: Battery is charging.

2018-07-02 21:55:39.536997+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: rebuildLegacyIOBatteryInfo called

2018-07-02 21:55:39.537029+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fRealAC=-1, fACConnected=1

2018-07-02 21:55:39.537072+0100 0x483      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "Exiting UPBS"

2018-07-02 21:55:39.537214+0100 0x483      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "_BST: End of second if statement"

2018-07-02 21:55:39.537354+0100 0x483      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "_BST: End of first if statement"

2018-07-02 21:55:39.537503+0100 0x483      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "_BST: PBST: ", { 0x2, 0x1044, 0x0, 0x3b7a, }, }

2018-07-02 21:55:39.537652+0100 0x483      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "Exiting _BST"

As you can see, before the third if statement, Local5 = 0x1a, and within the if statement, Local5 gets changed to 0x0.

The code that causes this can be seen below:
Code:
                Store (B1B2 (^^PCI0.LPCB.EC0.BRM0, ^^PCI0.LPCB.EC0.BRM1), Local5)
                \RMDT.P2 ("UPBS: Local5: ", Local5)
                If (LNot (And (Local5, 0x8000)))
                {
                    \RMDT.PUSH ("UPBS: Third if statement")
                    ShiftRight (Local5, 0x05, Local5)
                    \RMDT.P2 ("UPBS: Local5: ", Local5)
                    ShiftLeft (Local5, 0x05, Local5)
                    \RMDT.P2 ("UPBS: Local5: ", Local5)
                    If (LNotEqual (Local5, DerefOf (Index (PBST, 0x02))))
                    {
                        \RMDT.PUSH ("UPBS: Fourth if statement")
                        Store (Local5, Index (PBST, 0x02))
                        \RMDT.P2 ("UPBS: PBST: ", PBST)
                        \RMDT.PUSH ("UPBS: End of fourth if statement")
                    }

                    \RMDT.PUSH ("UPBS: End of third if statement")
               }

The parts in the code that cause this change are:
Code:
ShiftRight (Local5, 0x05, Local5)
and
Code:
ShiftLeft (Local5, 0x05, Local5)

Any tips on how to resolve this?

Thanks

Edit: I don't totally understand what ShiftRight and ShiftLeft do, but I'm guessing it moves bytes in memory? Anyway, in this code segment, it seems a little counter intuitive to move Local5 to the right and then back to the left, the exact same amount. Would simply commenting out this code provide any benefit?
 

Attachments

  • debug_22703.zip
    2.5 MB · Views: 82
Hi RehabMan, thanks for the help.

First of all, here's my latest _BST log
Code:
2018-07-02 21:55:39.530236+0100 0x7c       Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "Entering _BST"

2018-07-02 21:55:39.530366+0100 0x7c       Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "_BST: First if statement"

2018-07-02 21:55:39.530735+0100 0x7c       Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "_BST: Second if statement"

2018-07-02 21:55:39.531429+0100 0x7c       Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "Entering UPBS"

2018-07-02 21:55:39.531559+0100 0x7c       Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "UPBS: Local0: ", 0x1044, }

2018-07-02 21:55:39.531712+0100 0x7c       Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: Second else statement"

2018-07-02 21:55:39.531839+0100 0x7c       Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "UPBS: PBST: ", { 0x0, 0x1044, 0xffffffff, 0x2710, }, }

2018-07-02 21:55:39.532007+0100 0x7c       Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: End of second else statement"

2018-07-02 21:55:39.533483+0100 0x111      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "UPBS: Local5: ", 0x1a, }

2018-07-02 21:55:39.534262+0100 0x111      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: Third if statement"

2018-07-02 21:55:39.534401+0100 0x111      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "UPBS: Local5: ", 0x0, }

2018-07-02 21:55:39.534526+0100 0x111      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "UPBS: Local5: ", 0x0, }

2018-07-02 21:55:39.534809+0100 0x111      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: Fourth if statement"

2018-07-02 21:55:39.534947+0100 0x111      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "UPBS: PBST: ", { 0x0, 0x1044, 0x0, 0x2710, }, }

2018-07-02 21:55:39.535088+0100 0x111      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: End of fourth if statement"

2018-07-02 21:55:39.535219+0100 0x111      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "UPBS: End of third if statement"

2018-07-02 21:55:39.535650+0100 0x481      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "UPBS: PBST: ", { 0x0, 0x1044, 0x0, 0x3b7a, }, }

2018-07-02 21:55:39.536697+0100 0x483      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "UPBS: PBST: ", { 0x2, 0x1044, 0x0, 0x3b7a, }, }

2018-07-02 21:55:39.536966+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: setBatteryBST: acpibat_bst size = 4

2018-07-02 21:55:39.536969+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fPowerUnit       = 0x1

2018-07-02 21:55:39.536971+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: currentStatus    = 0x2

2018-07-02 21:55:39.536973+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentRate     = 4164

2018-07-02 21:55:39.536975+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentCapacity = 0

2018-07-02 21:55:39.536977+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fCurrentVoltage  = 15226

2018-07-02 21:55:39.536983+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fAverageRate = 4164

2018-07-02 21:55:39.536992+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: Battery is charging.

2018-07-02 21:55:39.536997+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: rebuildLegacyIOBatteryInfo called

2018-07-02 21:55:39.537029+0100 0xf8       Default     0x0                  0      0    kernel: (ACPIBatteryManager) ACPIBatteryManager: fRealAC=-1, fACConnected=1

2018-07-02 21:55:39.537072+0100 0x483      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "Exiting UPBS"

2018-07-02 21:55:39.537214+0100 0x483      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "_BST: End of second if statement"

2018-07-02 21:55:39.537354+0100 0x483      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "_BST: End of first if statement"

2018-07-02 21:55:39.537503+0100 0x483      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: { "_BST: PBST: ", { 0x2, 0x1044, 0x0, 0x3b7a, }, }

2018-07-02 21:55:39.537652+0100 0x483      Default     0x0                  0      0    kernel: (ACPIDebug) ACPIDebug: "Exiting _BST"

As you can see, before the third if statement, Local5 = 0x1a, and within the if statement, Local5 gets changed to 0x0.

The code that causes this can be seen below:
Code:
                Store (B1B2 (^^PCI0.LPCB.EC0.BRM0, ^^PCI0.LPCB.EC0.BRM1), Local5)
                \RMDT.P2 ("UPBS: Local5: ", Local5)
                If (LNot (And (Local5, 0x8000)))
                {
                    \RMDT.PUSH ("UPBS: Third if statement")
                    ShiftRight (Local5, 0x05, Local5)
                    \RMDT.P2 ("UPBS: Local5: ", Local5)
                    ShiftLeft (Local5, 0x05, Local5)
                    \RMDT.P2 ("UPBS: Local5: ", Local5)
                    If (LNotEqual (Local5, DerefOf (Index (PBST, 0x02))))
                    {
                        \RMDT.PUSH ("UPBS: Fourth if statement")
                        Store (Local5, Index (PBST, 0x02))
                        \RMDT.P2 ("UPBS: PBST: ", PBST)
                        \RMDT.PUSH ("UPBS: End of fourth if statement")
                    }

                    \RMDT.PUSH ("UPBS: End of third if statement")
               }

The parts in the code that cause this change are:
Code:
ShiftRight (Local5, 0x05, Local5)
and
Code:
ShiftLeft (Local5, 0x05, Local5)

Any tips on how to resolve this?

Thanks

Edit: I don't totally understand what ShiftRight and ShiftLeft do, but I'm guessing it moves bytes in memory? Anyway, in this code segment, it seems a little counter intuitive to move Local5 to the right and then back to the left, the exact same amount. Would simply commenting out this code provide any benefit?

It is up to you to study the code to determine intent and/or bugs, not me.
 
It is up to you to study the code to determine intent and/or bugs, not me.

Hi RehabMan, I understand that I need to determine the root cause of the issue myself. I think I've tracked down the issue (as mentioned in my previous post), but I'm not exactly sure how I'd go about getting UPBS to store the correct value for my fCurrentCapacity in Local5. I see that a value is stored in Local5 using this:
Code:
Store (B1B2 (^^PCI0.LPCB.EC0.BRM0, ^^PCI0.LPCB.EC0.BRM1), Local5)

Yesterday, this value was returning 0x1a (before getting overwritten as 0x0 with ShiftRight and ShiftLeft), and today this value is returning 0xb. Between these two events, I removed the ShiftRight and ShiftLeft calls mentioned in my previous post. Removing these calls allowed my fCurrentCapacity to return 26, but the battery didn't charge, so I restored the calls exactly as they were. Now Local5 only returns 0xb, my currentStatus is 0x0 (it was 0x2) and my laptop kernel panics when I unplug/plug in the AC adapter (I tried replicating this with -v and debug=0x100, but when the system froze, no verbose output was displayed).

To reiterate:

  • Local5 was 0x1a but being overwritten by ShiftRight/ShiftLeft to 0x0 - fCurrentCapacity = 0, currentStatus = 0x2
  • Removed ShiftRight/ShiftLeft to test output of Local5
  • Local5 was 0x1a and being returned properly to show fCurrentCapacity = 26
  • Added ShiftRight/ShiftLeft after testing
  • Local5 is 0xb but being overwritten by ShiftRight/ShiftLeft to 0x0, - fCurrentCapacity = 0, currentStatus = 0x0

I even restored to a previous version of my DSDT from a gen_debug to ensure the ShiftRight/ShiftLeft was correct. I also performed an EC reset.

I'm assuming that I need fCurrentCapacity to match fMaxCapacityRaw? The only calls that modify Local5 in this instance are the ones I've mentioned:

Code:
Store (B1B2 (^^PCI0.LPCB.EC0.BRM0, ^^PCI0.LPCB.EC0.BRM1), Local5)
Code:
ShiftRight (Local5, 0x05, Local5)
ShiftLeft (Local5, 0x05, Local5)

I think there are two things that I need to understand for this part:

  1. Where does the value that's initially stored in Local5 come from?
  2. What exactly does ShiftRight/ShiftLeft do?
For the initial value in Local5, I mean: how is it calculated? To my understanding, B1B2 is the hack used to merge two 8-bit registers in the EmbeddedController? In this instance, it's merging ^^PCI0.LPCB.EC0.BRM0 and ^^PCI0.LPCB.EC0.BRM1 and storing it in Local5? My question is, how is the data set in BRM0 and BRM1? I've searched the DSDT for BRM0 and BRM1, but all I can find is this:

Code:
                Method (CLRI, 0, Serialized)
                {
                    Store (Zero, Local0)
                    If (LEqual (^^LPCB.EC0.ECOK, One))
                    {
                        If (LEqual (^^LPCB.EC0.SW2S, Zero))
                        {
                            If (LEqual (^^^BAT0._STA (), 0x1F))
                            {
                                If (LLessEqual (B1B2 (^^LPCB.EC0.BRM0, ^^LPCB.EC0.BRM1), 0x96))
                                {
                                    Store (One, Local0)
                                }
                            }
                        }
                    }

                    Return (Local0)
                }

Nothing ever seems to call CLRI, and the only use of BRM0/1 is in an if statement.

Summary:

  • After a DSDT change and then reverting to the exact same DSDT, system behaviour is different. Kernel panic occurs when power input is changed and currentStatus is 0x0 instead of 0x2.
  • I can't see where BRM0 and BRM1 are getting their data from to store in Local5.
  • What is the purpose of ShiftRight/ShiftLeft? Surely this should just do nothing? Why am I getting 0x0?

I feel like I've reached a dead end and I won't be able to get my battery readout working correctly, so any help would be greatly appreciated at this point. Many thanks.
 

Attachments

  • debug_25379.zip
    2.6 MB · Views: 85
Hi RehabMan, I understand that I need to determine the root cause of the issue myself. I think I've tracked down the issue (as mentioned in my previous post), but I'm not exactly sure how I'd go about getting UPBS to store the correct value for my fCurrentCapacity in Local5. I see that a value is stored in Local5 using this:
Code:
Store (B1B2 (^^PCI0.LPCB.EC0.BRM0, ^^PCI0.LPCB.EC0.BRM1), Local5)

Yesterday, this value was returning 0x1a (before getting overwritten as 0x0 with ShiftRight and ShiftLeft), and today this value is returning 0xb. Between these two events, I removed the ShiftRight and ShiftLeft calls mentioned in my previous post. Removing these calls allowed my fCurrentCapacity to return 26, but the battery didn't charge, so I restored the calls exactly as they were. Now Local5 only returns 0xb, my currentStatus is 0x0 (it was 0x2) and my laptop kernel panics when I unplug/plug in the AC adapter (I tried replicating this with -v and debug=0x100, but when the system froze, no verbose output was displayed).

To reiterate:

  • Local5 was 0x1a but being overwritten by ShiftRight/ShiftLeft to 0x0 - fCurrentCapacity = 0, currentStatus = 0x2
  • Removed ShiftRight/ShiftLeft to test output of Local5
  • Local5 was 0x1a and being returned properly to show fCurrentCapacity = 26
  • Added ShiftRight/ShiftLeft after testing
  • Local5 is 0xb but being overwritten by ShiftRight/ShiftLeft to 0x0, - fCurrentCapacity = 0, currentStatus = 0x0

I even restored to a previous version of my DSDT from a gen_debug to ensure the ShiftRight/ShiftLeft was correct. I also performed an EC reset.

I'm assuming that I need fCurrentCapacity to match fMaxCapacityRaw? The only calls that modify Local5 in this instance are the ones I've mentioned:

Code:
Store (B1B2 (^^PCI0.LPCB.EC0.BRM0, ^^PCI0.LPCB.EC0.BRM1), Local5)
Code:
ShiftRight (Local5, 0x05, Local5)
ShiftLeft (Local5, 0x05, Local5)

I think there are two things that I need to understand for this part:

  1. Where does the value that's initially stored in Local5 come from?
  2. What exactly does ShiftRight/ShiftLeft do?
For the initial value in Local5, I mean: how is it calculated? To my understanding, B1B2 is the hack used to merge two 8-bit registers in the EmbeddedController? In this instance, it's merging ^^PCI0.LPCB.EC0.BRM0 and ^^PCI0.LPCB.EC0.BRM1 and storing it in Local5? My question is, how is the data set in BRM0 and BRM1? I've searched the DSDT for BRM0 and BRM1, but all I can find is this:

Code:
                Method (CLRI, 0, Serialized)
                {
                    Store (Zero, Local0)
                    If (LEqual (^^LPCB.EC0.ECOK, One))
                    {
                        If (LEqual (^^LPCB.EC0.SW2S, Zero))
                        {
                            If (LEqual (^^^BAT0._STA (), 0x1F))
                            {
                                If (LLessEqual (B1B2 (^^LPCB.EC0.BRM0, ^^LPCB.EC0.BRM1), 0x96))
                                {
                                    Store (One, Local0)
                                }
                            }
                        }
                    }

                    Return (Local0)
                }

Nothing ever seems to call CLRI, and the only use of BRM0/1 is in an if statement.

Summary:

  • After a DSDT change and then reverting to the exact same DSDT, system behaviour is different. Kernel panic occurs when power input is changed and currentStatus is 0x0 instead of 0x2.
  • I can't see where BRM0 and BRM1 are getting their data from to store in Local5.
  • What is the purpose of ShiftRight/ShiftLeft? Surely this should just do nothing? Why am I getting 0x0?

I feel like I've reached a dead end and I won't be able to get my battery readout working correctly, so any help would be greatly appreciated at this point. Many thanks.

For _BST, CurrentCapacity is at index 2.
So, you want to be looking at code related to Index(PBST,2) in UPBS.
It appears to me that this value comes from MBRM or from FABL in certain circumstances.
This is the code involved:
Code:
                Store (^^PCI0.LPCB.EC0.MBRM, Local5)
                If (LNot (And (Local5, 0x8000)))
                {
                    ShiftRight (Local5, 0x05, Local5)
                    ShiftLeft (Local5, 0x05, Local5)
                    If (LNotEqual (Local5, DerefOf (Index (PBST, 0x02))))
                    {
                        Store (Local5, Index (PBST, 0x02))
                    }
                }

                If (LAnd (LNot (^^PCI0.LPCB.EC0.SW2S), LEqual (^^PCI0.LPCB.EC0.BACR, One)))
                {
                    Store (FABL, Index (PBST, 0x02))
                }
 
Status
Not open for further replies.
Back
Top