From df06f4a00988bc548e761a2a7526e676449915e3 Mon Sep 17 00:00:00 2001 From: pharra <940530348@qq.com> Date: Sun, 25 Mar 2018 16:26:13 +0000 Subject: [PATCH] updated to 4.15.12 && added acpica.patch --- build/PKGBUILD | 12 ++- build/acpica.patch | 263 +++++++++++++++++++++++++++++++++++++++++++++ build/ipts.patch | 4 +- 3 files changed, 272 insertions(+), 7 deletions(-) create mode 100644 build/acpica.patch diff --git a/build/PKGBUILD b/build/PKGBUILD index 85df3f40f785..8248cbc84b97 100644 --- a/build/PKGBUILD +++ b/build/PKGBUILD @@ -5,8 +5,8 @@ #pkgbase=linux # Build stock -ARCH kernel pkgbase=linux-surface4 # Build kernel with a different name -_srcname=linux-4.15.10 -pkgver=4.15.10 +_srcname=linux-4.15.12 +pkgver=4.15.12 pkgrel=1 arch=('x86_64') url="https://www.kernel.org/" @@ -21,6 +21,7 @@ source=( 'surfacedock.patch' 'surfaceacpi.patch' 'cameras.patch' + 'acpica.patch' '99-ipts.rules' "https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz" "https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.sign" @@ -35,15 +36,16 @@ validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman ) -sha256sums=('4ae8db7dc5d5e7a689d11d432218fe30d315df8aa758bfadb51df151c4270100' +sha256sums=('6c7b26597be44de4d2949b34b87371b2dbd2825448fc60bf8fb5d084c694104b' 'ee28626aa83b288f3e02bc4bfc49fcca969cbb258da5bdb82da1fdd66aa306bd' '0bed4921cdc68844b30fb1f53013ac5f049f0a898e15b2224d2487a1f7835d7b' '0126184f0d838695261f2e9a6aed6bd68ccea3cdb8091e8c17f7a28b688c2a82' 'bddae8572686ffe1d3b2f09786a710fc45287952d0e14a17602f128219a0f2fc' '03b397cf1e02da93a19fe682e8e3240d2656ddffecaab5216780341c0d767cbb' '55d40252020d888b5154b9fe05a95084f045e8393b113e96253b7a198d57bb8b' + '986598c2ec47d3cd960abd94d0f9fb6e153dc3803db6fe4fe6288afeaed962d2' '82d0fa48947aff93cbbc9a0f0f3020bf95e860d604549b20f7ef8e1634798bd8' - '8f15be74707e3610512ae18de1f936e6f2a13f8c6eb1c235421ef94091002692' + '031e63e059989be76db3001f3b0f60c692be8fd5c3611d1a2bc087520f48f448' 'SKIP' '6d4c92e9c6c2f495598daf48ce881553ff751c7e64334dbeffae13f4440111a5' 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21' @@ -74,7 +76,7 @@ prepare() { patch -Np1 -i "${srcdir}/surfacedock.patch" patch -Np1 -i "${srcdir}/surfaceacpi.patch" patch -Np1 -i "${srcdir}/cameras.patch" - + patch -Np1 -i "${srcdir}/acpica.patch" cp -Tf ../config .config if [ "${_kernelname}" != "" ]; then diff --git a/build/acpica.patch b/build/acpica.patch new file mode 100644 index 000000000000..9201b031a0a6 --- /dev/null +++ b/build/acpica.patch @@ -0,0 +1,263 @@ +diff --git a/drivers/acpi/acpica/dbdisply.c b/drivers/acpi/acpica/dbdisply.c +index 5a606ea..7b5eb33 100644 +--- a/drivers/acpi/acpica/dbdisply.c ++++ b/drivers/acpi/acpica/dbdisply.c +@@ -642,9 +642,8 @@ void acpi_db_display_object_type(char *object_arg) + return; + } + +- acpi_os_printf("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n", +- ACPI_FORMAT_UINT64(info->address), +- info->current_status, info->flags); ++ acpi_os_printf("ADR: %8.8X%8.8X, Flags: %X\n", ++ ACPI_FORMAT_UINT64(info->address), info->flags); + + acpi_os_printf("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n", + info->highest_dstates[0], info->highest_dstates[1], +diff --git a/drivers/acpi/acpica/evevent.c b/drivers/acpi/acpica/evevent.c +index d3b6b31..37b0b4c 100644 +--- a/drivers/acpi/acpica/evevent.c ++++ b/drivers/acpi/acpica/evevent.c +@@ -204,6 +204,7 @@ u32 acpi_ev_fixed_event_detect(void) + u32 fixed_status; + u32 fixed_enable; + u32 i; ++ acpi_status status; + + ACPI_FUNCTION_NAME(ev_fixed_event_detect); + +@@ -211,8 +212,12 @@ u32 acpi_ev_fixed_event_detect(void) + * Read the fixed feature status and enable registers, as all the cases + * depend on their values. Ignore errors here. + */ +- (void)acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, &fixed_status); +- (void)acpi_hw_register_read(ACPI_REGISTER_PM1_ENABLE, &fixed_enable); ++ status = acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, &fixed_status); ++ status |= ++ acpi_hw_register_read(ACPI_REGISTER_PM1_ENABLE, &fixed_enable); ++ if (ACPI_FAILURE(status)) { ++ return (int_status); ++ } + + ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS, + "Fixed Event Block: Enable %08X Status %08X\n", +diff --git a/drivers/acpi/acpica/exdebug.c b/drivers/acpi/acpica/exdebug.c +index a8191d2..2ad13d8 100644 +--- a/drivers/acpi/acpica/exdebug.c ++++ b/drivers/acpi/acpica/exdebug.c +@@ -88,14 +88,13 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc, + return_VOID; + } + +- /* Null string or newline -- don't emit the line header */ ++ /* Newline -- don't emit the line header */ + + if (source_desc && + (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) && + (source_desc->common.type == ACPI_TYPE_STRING)) { +- if ((source_desc->string.length == 0) || +- ((source_desc->string.length == 1) && +- (*source_desc->string.pointer == '\n'))) { ++ if ((source_desc->string.length == 1) && ++ (*source_desc->string.pointer == '\n')) { + acpi_os_printf("\n"); + return_VOID; + } +diff --git a/drivers/acpi/acpica/nsdumpdv.c b/drivers/acpi/acpica/nsdumpdv.c +index 5026594..573a5f3 100644 +--- a/drivers/acpi/acpica/nsdumpdv.c ++++ b/drivers/acpi/acpica/nsdumpdv.c +@@ -88,10 +88,9 @@ acpi_ns_dump_one_device(acpi_handle obj_handle, + } + + ACPI_DEBUG_PRINT_RAW((ACPI_DB_TABLES, +- " HID: %s, ADR: %8.8X%8.8X, Status: %X\n", ++ " HID: %s, ADR: %8.8X%8.8X\n", + info->hardware_id.value, +- ACPI_FORMAT_UINT64(info->address), +- info->current_status)); ++ ACPI_FORMAT_UINT64(info->address)); + ACPI_FREE(info); + } + +diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c +index 1069662..0a9c600 100644 +--- a/drivers/acpi/acpica/nsxfname.c ++++ b/drivers/acpi/acpica/nsxfname.c +@@ -241,7 +241,7 @@ static char *acpi_ns_copy_device_id(struct acpi_pnp_device_id *dest, + * namespace node and possibly by running several standard + * control methods (Such as in the case of a device.) + * +- * For Device and Processor objects, run the Device _HID, _UID, _CID, _STA, ++ * For Device and Processor objects, run the Device _HID, _UID, _CID, + * _CLS, _ADR, _sx_w, and _sx_d methods. + * + * Note: Allocates the return buffer, must be freed by the caller. +@@ -250,8 +250,9 @@ static char *acpi_ns_copy_device_id(struct acpi_pnp_device_id *dest, + * discovery namespace traversal. Therefore, no complex methods can be + * executed, especially those that access operation regions. Therefore, do + * not add any additional methods that could cause problems in this area. +- * this was the fate of the _SUB method which was found to cause such +- * problems and was removed (11/2015). ++ * Because of this reason support for the following methods has been removed: ++ * 1) _SUB method was removed (11/2015) ++ * 2) _STA method was removed (02/2018) + * + ******************************************************************************/ + +@@ -374,20 +375,8 @@ acpi_get_object_info(acpi_handle handle, + * Notes: none of these methods are required, so they may or may + * not be present for this device. The Info->Valid bitfield is used + * to indicate which methods were found and run successfully. +- * +- * For _STA, if the method does not exist, then (as per the ACPI +- * specification), the returned current_status flags will indicate +- * that the device is present/functional/enabled. Otherwise, the +- * current_status flags reflect the value returned from _STA. + */ + +- /* Execute the Device._STA method */ +- +- status = acpi_ut_execute_STA(node, &info->current_status); +- if (ACPI_SUCCESS(status)) { +- valid |= ACPI_VALID_STA; +- } +- + /* Execute the Device._ADR method */ + + status = acpi_ut_evaluate_numeric_object(METHOD_NAME__ADR, node, +diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c +index eb9dfac..11ce4e5 100644 +--- a/drivers/acpi/acpica/psargs.c ++++ b/drivers/acpi/acpica/psargs.c +@@ -890,6 +890,10 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state, + ACPI_POSSIBLE_METHOD_CALL); + + if (arg->common.aml_opcode == AML_INT_METHODCALL_OP) { ++ ++ /* Free method call op and corresponding namestring sub-ob */ ++ ++ acpi_ps_free_op(arg->common.value.arg); + acpi_ps_free_op(arg); + arg = NULL; + walk_state->arg_count = 1; +diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c +index b6d58cc..5c00e5e 100644 +--- a/drivers/acpi/bus.c ++++ b/drivers/acpi/bus.c +@@ -135,6 +135,7 @@ acpi_status acpi_bus_get_status_handle(acpi_handle handle, + } + return status; + } ++EXPORT_SYMBOL_GPL(acpi_bus_get_status_handle); + + int acpi_bus_get_status(struct acpi_device *device) + { +@@ -146,6 +147,12 @@ int acpi_bus_get_status(struct acpi_device *device) + return 0; + } + ++ /* Battery devices must have their deps met before calling _STA */ ++ if (acpi_device_is_battery(device) && device->dep_unmet) { ++ acpi_set_device_status(device, 0); ++ return 0; ++ } ++ + status = acpi_bus_get_status_handle(device->handle, &sta); + if (ACPI_FAILURE(status)) + return -ENODEV; +diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c +index b0fe527..4c1b90e 100644 +--- a/drivers/acpi/scan.c ++++ b/drivers/acpi/scan.c +@@ -1565,6 +1565,8 @@ void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, + device_initialize(&device->dev); + dev_set_uevent_suppress(&device->dev, true); + acpi_init_coherency(device); ++ /* Assume there are unmet deps until acpi_device_dep_initialize runs */ ++ device->dep_unmet = 1; + } + + void acpi_device_add_finalize(struct acpi_device *device) +@@ -1588,6 +1590,14 @@ static int acpi_add_single_object(struct acpi_device **child, + } + + acpi_init_device_object(device, handle, type, sta); ++ /* ++ * For ACPI_BUS_TYPE_DEVICE getting the status is delayed till here so ++ * that we can call acpi_bus_get_status and use its quirk handling. ++ * Note this must be done before the get power-/wakeup_dev-flags calls. ++ */ ++ if (type == ACPI_BUS_TYPE_DEVICE) ++ acpi_bus_get_status(device); ++ + acpi_bus_get_power_flags(device); + acpi_bus_get_wakeup_device_flags(device); + +@@ -1660,9 +1670,11 @@ static int acpi_bus_type_and_status(acpi_handle handle, int *type, + return -ENODEV; + + *type = ACPI_BUS_TYPE_DEVICE; +- status = acpi_bus_get_status_handle(handle, sta); +- if (ACPI_FAILURE(status)) +- *sta = 0; ++ /* ++ * acpi_add_single_object updates this once we've an acpi_device ++ * so that acpi_bus_get_status' quirk handling can be used. ++ */ ++ *sta = 0; + break; + case ACPI_TYPE_PROCESSOR: + *type = ACPI_BUS_TYPE_PROCESSOR; +@@ -1760,6 +1772,8 @@ static void acpi_device_dep_initialize(struct acpi_device *adev) + acpi_status status; + int i; + ++ adev->dep_unmet = 0; ++ + if (!acpi_has_method(adev->handle, "_DEP")) + return; + +diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c +index 984c7e8..8472c4a 100644 +--- a/drivers/pci/hotplug/acpiphp_ibm.c ++++ b/drivers/pci/hotplug/acpiphp_ibm.c +@@ -399,6 +399,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle, + u32 lvl, void *context, void **rv) + { + acpi_handle *phandle = (acpi_handle *)context; ++ unsigned long long current_status = 0; + acpi_status status; + struct acpi_device_info *info; + int retval = 0; +@@ -410,7 +411,9 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle, + return retval; + } + +- if (info->current_status && (info->valid & ACPI_VALID_HID) && ++ acpi_bus_get_status_handle(handle, ¤t_status); ++ ++ if (current_status && (info->valid & ACPI_VALID_HID) && + (!strcmp(info->hardware_id.string, IBM_HARDWARE_ID1) || + !strcmp(info->hardware_id.string, IBM_HARDWARE_ID2))) { + pr_debug("found hardware: %s, handle: %p\n", +diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h +index 4f077ed..220ef86 100644 +--- a/include/acpi/actypes.h ++++ b/include/acpi/actypes.h +@@ -1191,7 +1191,6 @@ struct acpi_device_info { + u8 flags; /* Miscellaneous info */ + u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */ + u8 lowest_dstates[5]; /* _sx_w values: 0xFF indicates not valid */ +- u32 current_status; /* _STA value */ + u64 address; /* _ADR value */ + struct acpi_pnp_device_id hardware_id; /* _HID value */ + struct acpi_pnp_device_id unique_id; /* _UID value */ +@@ -1205,7 +1204,6 @@ struct acpi_device_info { + + /* Flags for Valid field above (acpi_get_object_info) */ + +-#define ACPI_VALID_STA 0x0001 + #define ACPI_VALID_ADR 0x0002 + #define ACPI_VALID_HID 0x0004 + #define ACPI_VALID_UID 0x0008 diff --git a/build/ipts.patch b/build/ipts.patch index 69ce5311360b..e60507019bad 100644 --- a/build/ipts.patch +++ b/build/ipts.patch @@ -120,7 +120,7 @@ index f84c267..c29d64b 100644 - if (is_high_priority(client)) { - offset = end; - end += offset; -+ if (IS_SKYLAKE(dev_priv)) { ++ if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) { + end = GUC_NUM_DOORBELLS; + } + else { @@ -172,7 +172,7 @@ index f84c267..c29d64b 100644 + /* client for execbuf submission */ + client = guc_client_alloc(dev_priv, + INTEL_INFO(dev_priv)->ring_mask, -+ IS_SKYLAKE(dev_priv) ? GUC_CLIENT_PRIORITY_HIGH : GUC_CLIENT_PRIORITY_NORMAL, ++ IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv) ? GUC_CLIENT_PRIORITY_HIGH : GUC_CLIENT_PRIORITY_NORMAL, + ctx); + if (!client) { + DRM_ERROR("Failed to create normal GuC client!\n");