Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1452456
| From | Benjamin Tissoires <benjamin.tissoires@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/2] ACPICA: adapt buffer length for Field Attrib Raw Process in Ops Region |
| Date | 2016-07-29 18:00 +0200 |
| Message-ID | <s0imB-6Bu-7@gated-at.bofh.it> (permalink) |
| References | <s0icV-6y2-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Detected on the Surface 3:
The MSHW0011 driver uses Field Attrib Raw Process to return information
for the ACPI Battery. The DSDT declares a parameter of 2 though
functions like _BST or _BIX require a much bigger out buffer.
It looks like the incoming buffer has the requested size and we can
work around the issue by using this input size as the output and
parameters size.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=106231
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
drivers/acpi/acpica/exfield.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/acpi/acpica/exfield.c b/drivers/acpi/acpica/exfield.c
index d7d3ee3..a1bd041 100644
--- a/drivers/acpi/acpica/exfield.c
+++ b/drivers/acpi/acpica/exfield.c
@@ -413,6 +413,17 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
* Data[x-1]: (Bytes 2-x of the arbitrary length data buffer)
*/
length += 2;
+
+ /*
+ * When using Field Attrib Raw Process, it looks like
+ * the parameter access_length can be wrong and the
+ * required output buffer can be much bigger.
+ * So just take the incoming buffer length as the
+ * reference.
+ */
+ if (accessor_type == AML_FIELD_ATTRIB_RAW_PROCESS)
+ length = source_desc->buffer.length;
+
function = ACPI_WRITE | (accessor_type << 16);
} else { /* IPMI */
--
2.5.5
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/2] Add support for Microsoft Surface 3 power Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-29 17:50 +0200
[PATCH 1/2] ACPICA: adapt buffer length for Field Attrib Raw Process in Ops Region Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-29 18:00 +0200
RE: [PATCH 1/2] ACPICA: adapt buffer length for Field Attrib Raw Process in Ops Region "Zheng, Lv" <lv.zheng@intel.com> - 2016-08-01 08:00 +0200
[PATCH 2/2] power: surface3_power: MSHW0011 rev-eng implementation Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-29 18:00 +0200
Re: [PATCH 2/2] power: surface3_power: MSHW0011 rev-eng implementation Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-08-01 11:20 +0200
csiph-web