History log of /linux-master/drivers/acpi/acpica/exserial.c
Revision Date Author Comments
# bac36a17 20-Apr-2023 Jiangshan Yi <yijiangshan@kylinos.cn>

ACPICA: exserial.c: replace ternary operator with ACPI_MIN()

ACPICA commit 2250f71fe77396db21df805222ffcbf19e1e7896

Make the code simpler and more readable.

Link: https://github.com/acpica/acpica/commit/2250f71f
Signed-off-by: Jiangshan Yi <yijiangshan@kylinos.cn>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 612c2932 05-Apr-2023 Bob Moore <robert.moore@intel.com>

ACPICA: Update all copyrights/signons to 2023

ACPICA commit 25bddd1824b1e450829468a64bbdcb38074ba3d2

Copyright updates to 2023.

Link: https://github.com/acpica/acpica/commit/25bddd18
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# ee64b827 27-Oct-2022 Sudeep Holla <sudeep.holla@arm.com>

ACPICA: Add support for FFH Opregion special context data

ACPICA commit fad527b6e76babc7527c41325bfbef6bd1a1132b

FFH(Fixed Function Hardware) Opregion is approved to be added in ACPI 6.5 via
code first approach [1]. It requires special context data similar to GPIO and
Generic Serial Bus as it needs to know platform specific offset and length.

Add support for the special context data needed by FFH Opregion.

FFH op_region enables advanced use of FFH on some architectures. For example,
it could be used to easily proxy AML code to architecture-specific behavior
(to ensure it is OS initiated)

Actual behavior of FFH is ofcourse architecture specific and depends on
the FFH bindings. The offset and length could have arch specific meaning
or usage.

Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3598 # [1]
Link: https://github.com/acpica/acpica/commit/fad527b6
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 487ea80a 11-Apr-2022 Bob Moore <robert.moore@intel.com>

ACPICA: Update copyright notices to the year 2022

ACPICA commit 738d7b0726e6c0458ef93c0a01c0377490888d1e

Affects all source modules and utility signons.

Link: https://github.com/acpica/acpica/commit/738d7b07
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 04da290d 04-Jun-2021 Erik Kaneda <erik.kaneda@intel.com>

ACPICA: Add support for PlatformRtMechanism OperationRegion handler

ACPICA commit cdf48b141d7da38e47fe4020310033ddd1971f9e

Writing a buffer to a PlatformRtMechanism FieldUnit invokes a
bidirectional transaction. The input buffer contains 26 bytes
containing 9 bytes of status, a command byte and a 16-byte UUID.
This change will will simply pass this incoming buffer to a handler
registered by the OS.

Link: https://github.com/acpica/acpica/commit/cdf48b14
Signed-off-by: Erik Kaneda <erik.kaneda@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 4441e55d 15-Jan-2021 Bob Moore <robert.moore@intel.com>

ACPICA: Updated all copyrights to 2021

This affects all ACPICA source code modules.

ACPICA commit c570953c914437e621dd5f160f26ddf352e0d2f4

Link: https://github.com/acpica/acpica/commit/c570953c
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Kaneda <erik.kaneda@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 800ba7c5 10-Jan-2020 Bob Moore <robert.moore@intel.com>

ACPICA: All acpica: Update copyrights to 2020 Including tool signons.

ACPICA commit 8b9c69d0984067051ffbe8526f871448ead6a26b

Link: https://github.com/acpica/acpica/commit/8b9c69d0
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Kaneda <erik.kaneda@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# c163f90c 15-Feb-2019 Erik Kaneda <erik.kaneda@intel.com>

ACPI/ACPICA: Trivial: fix spelling mistakes and fix whitespace formatting

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 840c02ca 14-Jan-2019 Bob Moore <robert.moore@intel.com>

ACPICA: All acpica: Update copyrights to 2019

ACPICA commit 62f4f98e941d86e41969bf2ab5a93b8dc94dc49e

The update includes userspace tool signons.

Link: https://github.com/acpica/acpica/commit/62f4f98e
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 55e8054d 13-Dec-2018 Erik Kaneda <erik.kaneda@intel.com>

ACPICA: change coding style to match ACPICA, no functional change

This commit alters the coding style of the following commit to match
ACPICA to keep divergences between Linux and ACPICA at a minimum.
This is not intended to result in functional changes.

ae6b3e54aa52cd29965b8e4e47000ed2c5d78eb8
Author: Hans de Goede <hdegoede@redhat.com>
Date: Sun Nov 18 20:25:35 2018 +0100

ACPICA: Fix handling of buffer-size in acpi_ex_write_data_to_field()

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# ae6b3e54 18-Nov-2018 Hans de Goede <hdegoede@redhat.com>

ACPICA: Fix handling of buffer-size in acpi_ex_write_data_to_field()

Generic Serial Bus transfers use a data struct like this:

struct gsb_buffer {
u8 status;
u8 len;
u8 data[0];
};

acpi_ex_write_data_to_field() copies the data which is to be written from
the source-buffer to a temp-buffer. This is done because the OpReg-handler
overwrites the status field and some transfers do a write + read-back.

Commit f99b89eefeb6 ("ACPICA: Update for generic_serial_bus and
attrib_raw_process_bytes protocol") acpi_ex_write_data_to_field()
introduces a number of problems with this:

1) It drops a "length += 2" statement used to calculate the temp-buffer
size causing the temp-buffer to only be 1/2 bytes large for byte/word
transfers while it should be 3/4 bytes (taking the status and len field
into account). This is already fixed in commit e324e10109fc ("ACPICA:
Update for field unit access") which refactors the code.

The ACPI 6.0 spec (ACPI_6.0.pdf) "5.5.2.4.5.2 Declaring and Using a
GenericSerialBusData Buffer" (page 232) states that the GenericSerialBus
Data Buffer Length field is only valid when doing a Read/Write Block
(AttribBlock) transfer, but since the troublesome commit we unconditionally
use the len field to determine how much data to copy from the source-buffer
into the temp-buffer passed to the OpRegion.

This causes 3 further issues:

2) This may lead to not copying enough data to the temp-buffer causing the
OpRegion handler for the serial-bus to write garbage to the hardware.

3) The temp-buffer passed to the OpRegion is allocated to the size
returned by acpi_ex_get_serial_access_length(), which may be as little
as 1, so potentially this may lead to a write overflow of the temp-buffer.

4) Commit e324e10109fc ("ACPICA: Update for field unit access") drops a
length check on the source-buffer, leading to a potential read overflow
of the source-buffer.

This commit fixes all 3 remaining issues by not looking at the len field at
all (the interpretation of this field is left up to the OpRegion handler),
and copying the minimum of the source- and temp-buffer sizes from the
source-buffer to the temp-buffer.

This fixes e.g. an Acer S1003 no longer booting since the troublesome
commit.

Fixes: f99b89eefeb6 (ACPICA: Update for generic_serial_bus and ...)
Fixes: e324e10109fc (ACPICA: Update for field unit access)
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 9e9f8733 03-Oct-2018 Bob Moore <robert.moore@intel.com>

ACPICA: Split large interpreter file

New file: exserial.c

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>