Hi Don,
Please test the following patch provided by the developer.
(shown inline)
---------- Forwarded message ---------
From: Benjamin Tissoires <
benjamin....@gmail.com>
Date: 2018年11月14日 週三 下午3:19
Subject: Re: 8.1-rc2 ACPI fix and Cherrytrail support
To: Chih-Wei Huang <
cwh...@android-x86.org>
Hi Chih-Wei,
On Wed, Nov 14, 2018 at 4:45 AM Chih-Wei Huang <
cwh...@android-x86.org> wrote:
>
> 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.
> Please check:
>
https://osdn.net/projects/android-x86/scm/git/kernel/commits/611e5e2b35488e652667a20d9f7fa8a55bf9f77e
>
> ---------- Forwarded message ---------
> From: Don Quijote <
rosins...@gmail.com>
> Date: 2018年11月14日 週三 上午7:03
> Subject: 8.1-rc2 ACPI fix and Cherrytrail support
> To: Android-x86 <
andro...@googlegroups.com>
> 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
There is something fishy in this comment :
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