Discussion:
8.1-rc2 ACPI fix and Cherrytrail support
(too old to reply)
Don Quijote
2018-11-13 23:03:01 UTC
Permalink
Hello,

first the short version, then a detailed version with some questions etc

tl;dr:
1. Please revert commit 611e5e2b35488e652667a20d9f7fa8a55bf9f77e ("ACPICA:
Update for generic_serial_bus and attrib_raw_process_bytes protocol") in
the kernel repo. It is a cherrypicked commit, that only found its way into
Linux kernel 4.20. It seems to break ACPI for Intel Atom devices in 4.18!
My guess is, that this is also the main cause of this problem:
https://groups.google.com/forum/#!msg/android-x86/PkYpy3Y-lPw/uM9OpcHlBwAJ
(It's also an Atom device, an problem with the charging indicator (was my
reason to dig into it) and it seems to be the same kernel error as I
experienced. Do you have a special reason to use that commit on the 4.18
kernel?

2. Please enable the drivers for Cherrytrail devices in the kernel. If you
need to know which options to enable, I can upload a patch file.



Now the long version:
I own a HP x2 210 G2. It has an Intel Atom x5-Z8350 CPU.

I first tried to use Android-x86 with the 7.X releases, but i mostly didnt
work. No sound, no charging indicator, screen orientation getting stuck,
crashes, pen for touchscreen not getting recognized correctly. First I
tried newer kernels that I found in this group. I found out, that the
correct hdmi audio driver was not available in the old kernel, just as it
didnt have working support for cherrytrail devices. I got audio and
charging indicator to work, but the remaining issues (more crashes, pen not
working no matter what I tried) stopped me from trying any further.

Next try was with the 8.1-rc1: Really bad situation. Every build (self
compiled and the ISOs from the download page) crashed, no application was
able to start, newer kernels or different kernel builds were not able to
get a working image at all, just black screens on/after boot. So, I waited
again.


Now enter 8.1-rc2: Downloaded ISO, put it onto the USB stick, installed
and... BOOM: audio working from the start, no crashes, smooth animations,
and even the PEN was recognized correctly! Very nice. But no charging
indicator. So I updated my local repo, enabled CHT support (see tl;dr point
2) and restarted. Still no working charging indicator. Battery always
showing up as charging, even when the device was running on battery power
alone. Strange.
I dug into it, saw ACPI errors during debug boot, found the error report in
the google group and began to compare the android-x86 kernel to the
unmodified 4.18 kernel. I found a strange looking commit (see tl;dr point
1), reverted it, compiled and the charging indicator is working again on my
device.


Now everything is working, EXCEPT: the screen rotation is not working. Apps
testing the sensors are working correctly. And sometimes I can rotate the
screen once or twice after boot. Then it gets stuck. After reboot it works
again for a moment, then: no screen rotation anymore again. Checking the
devices in the console (/sys/class/...) still shows all sensors correctly
and the kernel log shows no related errors.
So I think it is a problem in the communication between kernel and android
itself. Do you have any ideas, how to fix that? Maybe I have to change
something in the startup script?

Apart from that (I can use screen rotation apps for now) I can now fully
use my device with android-x86. If you can incorporate the two changes I
mentioned in the tl;dr I won't have to compile it myself everytime (and can
free ~200GB of HDD space xD ), so that would be great. As I said, I can
supply a patch if you want me to.


Thanks to everyone participating in this project. Keep up the good work!
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
youling 257
2018-11-14 03:54:23 UTC
Permalink
It is a set of patch.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?qt=grep&q=Bob+Moore
[0/6] ACPICA version 20181003 - Patchwork
[1/6] ACPICA: Update for generic_serial_bus and

圚 2018幎11月14日星期䞉 UTC+8䞊午11:31:45Chih-Wei Huang写道
䞊午7:03寫道
Post by Don Quijote
first the short version, then a detailed version with some questions etc
1. Please revert commit 611e5e2b35488e652667a20d9f7fa8a55bf9f77e
("ACPICA: Update for generic_serial_bus and attrib_raw_process_bytes
protocol") in the kernel repo. It is a cherrypicked commit, that only found
its way into Linux kernel 4.20. It seems to break ACPI for Intel Atom
devices in 4.18! My guess is, that this is also the main cause of this
https://groups.google.com/forum/#!msg/android-x86/PkYpy3Y-lPw/uM9OpcHlBwAJ
(It's also an Atom device, an problem with the charging indicator (was my
reason to dig into it) and it seems to be the same kernel error as I
experienced. Do you have a special reason to use that commit on the 4.18
kernel?
This is necessary for Surface 3 battery driver.
It is also a Cherrytrail device.
The patch recommended by the upstream maintainer.
Anyway, I can discuss it with the maintainer again.
Post by Don Quijote
2. Please enable the drivers for Cherrytrail devices in the kernel. If
you need to know which options to enable, I can upload a patch file.
Which drivers did you mean exactly?
Please provide a patch.
Thank you for the good report!
--
Chih-Wei
Android-x86 project
http://www.android-x86.org
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
youling 257
2018-11-14 03:57:44 UTC
Permalink
only when you test 4.20rc2 kernel on androidx86, if has same charging
indicator problem, you can report a bug for bugzilla.kernel about "ACPICA:
Update for generic_serial_bus and".

圚 2018幎11月14日星期䞉 UTC+8䞊午7:03:01Don Quijote写道
Post by Don Quijote
Hello,
first the short version, then a detailed version with some questions etc
Update for generic_serial_bus and attrib_raw_process_bytes protocol") in
the kernel repo. It is a cherrypicked commit, that only found its way into
Linux kernel 4.20. It seems to break ACPI for Intel Atom devices in 4.18!
https://groups.google.com/forum/#!msg/android-x86/PkYpy3Y-lPw/uM9OpcHlBwAJ
(It's also an Atom device, an problem with the charging indicator (was my
reason to dig into it) and it seems to be the same kernel error as I
experienced. Do you have a special reason to use that commit on the 4.18
kernel?
2. Please enable the drivers for Cherrytrail devices in the kernel. If you
need to know which options to enable, I can upload a patch file.
I own a HP x2 210 G2. It has an Intel Atom x5-Z8350 CPU.
I first tried to use Android-x86 with the 7.X releases, but i mostly didnt
work. No sound, no charging indicator, screen orientation getting stuck,
crashes, pen for touchscreen not getting recognized correctly. First I
tried newer kernels that I found in this group. I found out, that the
correct hdmi audio driver was not available in the old kernel, just as it
didnt have working support for cherrytrail devices. I got audio and
charging indicator to work, but the remaining issues (more crashes, pen not
working no matter what I tried) stopped me from trying any further.
Next try was with the 8.1-rc1: Really bad situation. Every build (self
compiled and the ISOs from the download page) crashed, no application was
able to start, newer kernels or different kernel builds were not able to
get a working image at all, just black screens on/after boot. So, I waited
again.
Now enter 8.1-rc2: Downloaded ISO, put it onto the USB stick, installed
and... BOOM: audio working from the start, no crashes, smooth animations,
and even the PEN was recognized correctly! Very nice. But no charging
indicator. So I updated my local repo, enabled CHT support (see tl;dr point
2) and restarted. Still no working charging indicator. Battery always
showing up as charging, even when the device was running on battery power
alone. Strange.
I dug into it, saw ACPI errors during debug boot, found the error report
in the google group and began to compare the android-x86 kernel to the
unmodified 4.18 kernel. I found a strange looking commit (see tl;dr point
1), reverted it, compiled and the charging indicator is working again on my
device.
Now everything is working, EXCEPT: the screen rotation is not working.
Apps testing the sensors are working correctly. And sometimes I can rotate
the screen once or twice after boot. Then it gets stuck. After reboot it
works again for a moment, then: no screen rotation anymore again. Checking
the devices in the console (/sys/class/...) still shows all sensors
correctly and the kernel log shows no related errors.
So I think it is a problem in the communication between kernel and android
itself. Do you have any ideas, how to fix that? Maybe I have to change
something in the startup script?
Apart from that (I can use screen rotation apps for now) I can now fully
use my device with android-x86. If you can incorporate the two changes I
mentioned in the tl;dr I won't have to compile it myself everytime (and can
free ~200GB of HDD space xD ), so that would be great. As I said, I can
supply a patch if you want me to.
Thanks to everyone participating in this project. Keep up the good work!
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Don Quijote
2018-11-14 07:41:52 UTC
Permalink
䞊午7:03寫道
Post by Don Quijote
first the short version, then a detailed version with some questions etc
1. Please revert commit 611e5e2b35488e652667a20d9f7fa8a55bf9f77e
("ACPICA: Update for generic_serial_bus and attrib_raw_process_bytes
protocol") in the kernel repo. It is a cherrypicked commit, that only found
its way into Linux kernel 4.20. It seems to break ACPI for Intel Atom
devices in 4.18! My guess is, that this is also the main cause of this
https://groups.google.com/forum/#!msg/android-x86/PkYpy3Y-lPw/uM9OpcHlBwAJ
(It's also an Atom device, an problem with the charging indicator (was my
reason to dig into it) and it seems to be the same kernel error as I
experienced. Do you have a special reason to use that commit on the 4.18
kernel?
This is necessary for Surface 3 battery driver.
It is also a Cherrytrail device.
The patch recommended by the upstream maintainer.
Anyway, I can discuss it with the maintainer again.
Post by Don Quijote
2. Please enable the drivers for Cherrytrail devices in the kernel. If
you need to know which options to enable, I can upload a patch file.
Which drivers did you mean exactly?
Please provide a patch.
I have to go to work now, so the quick answer: My device needs the Dollar
Cove drivers enabled:
CONFIG_INTEL_SOC_PMIC_CHTDC_TI and CONFIG_CHT_DC_TI_PMIC_OPREGION
Exclude CONFIG_INTEL_CHTDC_TI_PWRBTN for now, as it makes the power button
event fire twice when being pushed, starting the camera when turning off
the device.

In some old patch, that enabled Dollar Cove in the kernel (
https://lore.kernel.org/patchwork/patch/825698/ ) you also find some ACPI
stuff. Maybe those ACPI patches from 4.20 only break Dollar Cove devices?!

Btw. do you know which PMIC is used in the Surface 3? Whiskey Cove or
Dollar Cove?

And on another thought, refering to youling 257: Maybe Dollar Cove devices
were fixed in a later patch from the series and the fix wasn't applied to
the android x86 repo?
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Don Quijote
2018-11-14 19:11:37 UTC
Permalink
An update from me:

I followed the link from youling 257 (
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?qt=grep&q=Bob+Moore
) and the newest commit is this one:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=58a0228707870c8330917f919804986855443a19
I shows huge changes to exfield.c, changes to the while ACPI system and the
Intel PMIC drivers. And the log says it fixes "issues with BYT/CHT" and it
shall "avoid device enumeration problems on boards with Dollar Cove". This
reinforces my opinion, that the patch set was incomplete or bugged.

Besides the Surface 3 has been used with Linux distributions with working
battery support for some time now. I think it's unlikely that something was
bugged in a way that you had to apply those patches for the Surface 3
battery to work. It only says in the commit log "... but this change works
correctly on the Surface 3.". It works with Surface 3, but it doesn't say,
that it required for it to work.

The Surface 3 also uses a Cherrytrail SoC (Z8700). Maybe it was a missing
driver until now? As I said, my Z8350 needs Dollar Cove PMIC & ACPI to be
enabled. I have no Surface 3 to test it with those drivers. But maybe it's
worth a try.


I'm currently recompiling android x86 after I cleaned up and resynced my
repository. I'm trying to find the minimum configuration for my battery
indicator to work.
For now I have enabled:
CONFIG_INTEL_SOC_PMIC_CHTDC_TI
CONFIG_CHT_DC_TI_PMIC_OPREGION
CONFIG_CHARGER_BQ2415X
CONFIG_CHARGER_BQ24190
CONFIG_INTEL_CHT_INT33FE

I think this should be the minimum amount of drivers for it to work.
other options I have enabled (have nothing to do with the battery/ACPI):
HID_ELAN
CONFIG_USB_ROLES_INTEL_XHCI


While I was testing I enabled close to all drivers for Atom SoC. Including
Medfield drivers, BXT Whiskey Cove, CONFIG_PINCTRL_MERRIFIELD, additional
GPIO stuff (Whiskey Cove) etc. It didn't hurt and I didn't want to compile
a thousand times because I missed one small option.
Maybe it's worth thinking about enabling all of those. There are many
small, mobile x86 devices out there, that are using the Atom SoCs, so
enabling as many as possible of those might be worth it.
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Don Quijote
2018-11-17 01:48:10 UTC
Permalink
Hello,

I applied your patch and it seems to work. With "+2" at the end of this
line the battery is detected correctly and shows its remaining
capacity/time. Great, thanks for your help.

I've attached a patch file for the config that I used to compile. The
second file is the extract of the drivers that were loaded by openSUSE
Tumbleweed Live, when I tried to narrow down on what I need to enable.

Now I have only two issues remaining: One input device sometimes doesn't
work. Eg. I can use the touchscreen with my Pen and I can use the touchpad
on the detachable keyboard, but touching the screen with a finger doesn't
work. After a restart I can use Pen and finger, but the touchpad doesn't
work. Any ideas?

And do you have an idea on how to debug the screen rotation?
Hi Don,
Please test the following patch provided by the developer.
(shown inline)
---------- Forwarded message ---------
Date: 2018幎11月14日 週䞉 䞋午3:19
Subject: Re: 8.1-rc2 ACPI fix and Cherrytrail support
Hi Chih-Wei,
Hi Benjamin,
In my group someone reported the patch
"ACPICA: Update for generic_serial_bus and attrib_raw_process_bytes
protocol"
causes problem to battery driver of his device.
Please see the forwarded message.
This patch was recommended by you
for battery driver of Surface 3.
Unless I made some mistakes when cherrypicked it.
https://osdn.net/projects/android-x86/scm/git/kernel/commits/611e5e2b35488e652667a20d9f7fa8a55bf9f77e
---------- Forwarded message ---------
Date: 2018幎11月14日 週䞉 䞊午7:03
Subject: 8.1-rc2 ACPI fix and Cherrytrail support
Hello,
first the short version, then a detailed version with some questions etc
1. Please revert commit 611e5e2b35488e652667a20d9f7fa8a55bf9f77e
("ACPICA: Update for generic_serial_bus and attrib_raw_process_bytes
protocol") in the kernel repo. It is a cherrypicked commit, that only
found its way into Linux kernel 4.20. It seems to break ACPI for Intel
Atom devices in 4.18! My guess is, that this is also the main cause of
https://groups.google.com/forum/#!msg/android-x86/PkYpy3Y-lPw/uM9OpcHlBwAJ
ACPI Error: Invalid zero data length in transfer buffer
(20180531/exfield-400)
AFAICT, we are missing the '+2' from the length buffer in the other
cases (non Surface 3 I would say).
Can you ask the reporter to try the simple following patch (gmail
might break it, but you get the gist of it, adding '+2' at line 397)?
---
diff --git a/drivers/acpi/acpica/exfield.c b/drivers/acpi/acpica/exfield.c
index 17b937c5144f..a89cd088b3d6 100644
--- a/drivers/acpi/acpica/exfield.c
+++ b/drivers/acpi/acpica/exfield.c
@@ -394,7 +394,7 @@ acpi_ex_write_data_to_field(union
acpi_operand_object *source_desc,
* Length; (Byte 1 of the data buffer)
* Data[x-1]: (Bytes 2-x of the arbitrary
length data buffer)
*/
- data_length = source_desc->buffer.pointer[1];
/* Data length is 2nd byte */
+ data_length = source_desc->buffer.pointer[1] +
2; /* Data length is 2nd byte */
if (!data_length) {
ACPI_ERROR((AE_INFO,
"Invalid zero data length
in transfer buffer"));
---
Cheers,
Benjamin
(It's also an Atom device, an problem with the charging indicator
(was my reason to dig into it) and it seems to be the same kernel
error as I experienced. Do you have a special reason to use that
commit on the 4.18 kernel?
2. Please enable the drivers for Cherrytrail devices in the kernel. If
you need to know which options to enable, I can upload a patch file.
I own a HP x2 210 G2. It has an Intel Atom x5-Z8350 CPU.
I first tried to use Android-x86 with the 7.X releases, but i mostly
didnt work. No sound, no charging indicator, screen orientation
getting stuck, crashes, pen for touchscreen not getting recognized
correctly. First I tried newer kernels that I found in this group. I
found out, that the correct hdmi audio driver was not available in the
old kernel, just as it didnt have working support for cherrytrail
devices. I got audio and charging indicator to work, but the remaining
issues (more crashes, pen not working no matter what I tried) stopped
me from trying any further.
Next try was with the 8.1-rc1: Really bad situation. Every build (self
compiled and the ISOs from the download page) crashed, no application
was able to start, newer kernels or different kernel builds were not
able to get a working image at all, just black screens on/after boot.
So, I waited again.
Now enter 8.1-rc2: Downloaded ISO, put it onto the USB stick,
installed and... BOOM: audio working from the start, no crashes,
smooth animations, and even the PEN was recognized correctly! Very
nice. But no charging indicator. So I updated my local repo, enabled
CHT support (see tl;dr point 2) and restarted. Still no working
charging indicator. Battery always showing up as charging, even when
the device was running on battery power alone. Strange.
I dug into it, saw ACPI errors during debug boot, found the error
report in the google group and began to compare the android-x86 kernel
to the unmodified 4.18 kernel. I found a strange looking commit (see
tl;dr point 1), reverted it, compiled and the charging indicator is
working again on my device.
Now everything is working, EXCEPT: the screen rotation is not working.
Apps testing the sensors are working correctly. And sometimes I can
rotate the screen once or twice after boot. Then it gets stuck. After
reboot it works again for a moment, then: no screen rotation anymore
again. Checking the devices in the console (/sys/class/...) still
shows all sensors correctly and the kernel log shows no related
errors.
So I think it is a problem in the communication between kernel and
android itself. Do you have any ideas, how to fix that? Maybe I have
to change something in the startup script?
Apart from that (I can use screen rotation apps for now) I can now
fully use my device with android-x86. If you can incorporate the two
changes I mentioned in the tl;dr I won't have to compile it myself
everytime (and can free ~200GB of HDD space xD ), so that would be
great. As I said, I can supply a patch if you want me to.
Thanks to everyone participating in this project. Keep up the good work!
--
Chih-Wei
Android-x86 project
http://www.android-x86.org
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Loading...