From 68c4147cec892a6567b730db1e9028a5f8c9967e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 25 Mar 2022 12:05:13 +0100 Subject: [PATCH] 5.16-stable patches added patches: acpi-battery-add-device-hid-and-quirk-for-microsoft-surface-go-3.patch acpi-video-force-backlight-native-for-clevo-nl5xru-and-nl5xnu.patch acpi-x86-work-around-broken-xsdt-on-advantech-dac-bj01-board.patch crypto-qat-disable-registration-of-algorithms.patch --- ...and-quirk-for-microsoft-surface-go-3.patch | 53 +++++++++ ...t-native-for-clevo-nl5xru-and-nl5xnu.patch | 110 ++++++++++++++++++ ...ken-xsdt-on-advantech-dac-bj01-board.patch | 75 ++++++++++++ ...t-disable-registration-of-algorithms.patch | 61 ++++++++++ queue-5.16/series | 4 + 5 files changed, 303 insertions(+) create mode 100644 queue-5.16/acpi-battery-add-device-hid-and-quirk-for-microsoft-surface-go-3.patch create mode 100644 queue-5.16/acpi-video-force-backlight-native-for-clevo-nl5xru-and-nl5xnu.patch create mode 100644 queue-5.16/acpi-x86-work-around-broken-xsdt-on-advantech-dac-bj01-board.patch create mode 100644 queue-5.16/crypto-qat-disable-registration-of-algorithms.patch diff --git a/queue-5.16/acpi-battery-add-device-hid-and-quirk-for-microsoft-surface-go-3.patch b/queue-5.16/acpi-battery-add-device-hid-and-quirk-for-microsoft-surface-go-3.patch new file mode 100644 index 00000000000..f24728cf918 --- /dev/null +++ b/queue-5.16/acpi-battery-add-device-hid-and-quirk-for-microsoft-surface-go-3.patch @@ -0,0 +1,53 @@ +From 7dacee0b9efc8bd061f097b1a8d4daa6591af0c6 Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Sun, 13 Feb 2022 16:49:20 +0100 +Subject: ACPI: battery: Add device HID and quirk for Microsoft Surface Go 3 + +From: Maximilian Luz + +commit 7dacee0b9efc8bd061f097b1a8d4daa6591af0c6 upstream. + +For some reason, the Microsoft Surface Go 3 uses the standard ACPI +interface for battery information, but does not use the standard PNP0C0A +HID. Instead it uses MSHW0146 as identifier. Add that ID to the driver +as this seems to work well. + +Additionally, the power state is not updated immediately after the AC +has been (un-)plugged, so add the respective quirk for that. + +Signed-off-by: Maximilian Luz +Cc: All applicable +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/acpi/battery.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/drivers/acpi/battery.c ++++ b/drivers/acpi/battery.c +@@ -60,6 +60,10 @@ MODULE_PARM_DESC(cache_time, "cache time + + static const struct acpi_device_id battery_device_ids[] = { + {"PNP0C0A", 0}, ++ ++ /* Microsoft Surface Go 3 */ ++ {"MSHW0146", 0}, ++ + {"", 0}, + }; + +@@ -1177,6 +1181,14 @@ static const struct dmi_system_id bat_dm + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad"), + }, + }, ++ { ++ /* Microsoft Surface Go 3 */ ++ .callback = battery_notification_delay_quirk, ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "Surface Go 3"), ++ }, ++ }, + {}, + }; + diff --git a/queue-5.16/acpi-video-force-backlight-native-for-clevo-nl5xru-and-nl5xnu.patch b/queue-5.16/acpi-video-force-backlight-native-for-clevo-nl5xru-and-nl5xnu.patch new file mode 100644 index 00000000000..2acdac99bcd --- /dev/null +++ b/queue-5.16/acpi-video-force-backlight-native-for-clevo-nl5xru-and-nl5xnu.patch @@ -0,0 +1,110 @@ +From c844d22fe0c0b37dc809adbdde6ceb6462c43acf Mon Sep 17 00:00:00 2001 +From: Werner Sembach +Date: Tue, 15 Mar 2022 20:02:28 +0100 +Subject: ACPI: video: Force backlight native for Clevo NL5xRU and NL5xNU + +From: Werner Sembach + +commit c844d22fe0c0b37dc809adbdde6ceb6462c43acf upstream. + +Clevo NL5xRU and NL5xNU/TUXEDO Aura 15 Gen1 and Gen2 have both a working +native and video interface. However the default detection mechanism first +registers the video interface before unregistering it again and switching +to the native interface during boot. This results in a dangling SBIOS +request for backlight change for some reason, causing the backlight to +switch to ~2% once per boot on the first power cord connect or disconnect +event. Setting the native interface explicitly circumvents this buggy +behaviour by avoiding the unregistering process. + +Signed-off-by: Werner Sembach +Cc: All applicable +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/acpi/video_detect.c | 75 ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 75 insertions(+) + +--- a/drivers/acpi/video_detect.c ++++ b/drivers/acpi/video_detect.c +@@ -417,6 +417,81 @@ static const struct dmi_system_id video_ + DMI_MATCH(DMI_PRODUCT_NAME, "GA503"), + }, + }, ++ /* ++ * Clevo NL5xRU and NL5xNU/TUXEDO Aura 15 Gen1 and Gen2 have both a ++ * working native and video interface. However the default detection ++ * mechanism first registers the video interface before unregistering ++ * it again and switching to the native interface during boot. This ++ * results in a dangling SBIOS request for backlight change for some ++ * reason, causing the backlight to switch to ~2% once per boot on the ++ * first power cord connect or disconnect event. Setting the native ++ * interface explicitly circumvents this buggy behaviour, by avoiding ++ * the unregistering process. ++ */ ++ { ++ .callback = video_detect_force_native, ++ .ident = "Clevo NL5xRU", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), ++ DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"), ++ }, ++ }, ++ { ++ .callback = video_detect_force_native, ++ .ident = "Clevo NL5xRU", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "SchenkerTechnologiesGmbH"), ++ DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"), ++ }, ++ }, ++ { ++ .callback = video_detect_force_native, ++ .ident = "Clevo NL5xRU", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Notebook"), ++ DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"), ++ }, ++ }, ++ { ++ .callback = video_detect_force_native, ++ .ident = "Clevo NL5xRU", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), ++ DMI_MATCH(DMI_BOARD_NAME, "AURA1501"), ++ }, ++ }, ++ { ++ .callback = video_detect_force_native, ++ .ident = "Clevo NL5xRU", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), ++ DMI_MATCH(DMI_BOARD_NAME, "EDUBOOK1502"), ++ }, ++ }, ++ { ++ .callback = video_detect_force_native, ++ .ident = "Clevo NL5xNU", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), ++ DMI_MATCH(DMI_BOARD_NAME, "NL5xNU"), ++ }, ++ }, ++ { ++ .callback = video_detect_force_native, ++ .ident = "Clevo NL5xNU", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "SchenkerTechnologiesGmbH"), ++ DMI_MATCH(DMI_BOARD_NAME, "NL5xNU"), ++ }, ++ }, ++ { ++ .callback = video_detect_force_native, ++ .ident = "Clevo NL5xNU", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Notebook"), ++ DMI_MATCH(DMI_BOARD_NAME, "NL5xNU"), ++ }, ++ }, + + /* + * Desktops which falsely report a backlight and which our heuristics diff --git a/queue-5.16/acpi-x86-work-around-broken-xsdt-on-advantech-dac-bj01-board.patch b/queue-5.16/acpi-x86-work-around-broken-xsdt-on-advantech-dac-bj01-board.patch new file mode 100644 index 00000000000..df6ad642e2c --- /dev/null +++ b/queue-5.16/acpi-x86-work-around-broken-xsdt-on-advantech-dac-bj01-board.patch @@ -0,0 +1,75 @@ +From e702196bf85778f2c5527ca47f33ef2e2fca8297 Mon Sep 17 00:00:00 2001 +From: Mark Cilissen +Date: Mon, 7 Mar 2022 04:16:58 +0100 +Subject: ACPI / x86: Work around broken XSDT on Advantech DAC-BJ01 board + +From: Mark Cilissen + +commit e702196bf85778f2c5527ca47f33ef2e2fca8297 upstream. + +On this board the ACPI RSDP structure points to both a RSDT and an XSDT, +but the XSDT points to a truncated FADT. This causes all sorts of trouble +and usually a complete failure to boot after the following error occurs: + + ACPI Error: Unsupported address space: 0x20 (*/hwregs-*) + ACPI Error: AE_SUPPORT, Unable to initialize fixed events (*/evevent-*) + ACPI: Unable to start ACPI Interpreter + +This leaves the ACPI implementation in such a broken state that subsequent +kernel subsystem initialisations go wrong, resulting in among others +mismapped PCI memory, SATA and USB enumeration failures, and freezes. + +As this is an older embedded platform that will likely never see any BIOS +updates to address this issue and its default shipping OS only complies to +ACPI 1.0, work around this by forcing `acpi=rsdt`. This patch, applied on +top of Linux 5.10.102, was confirmed on real hardware to fix the issue. + +Signed-off-by: Mark Cilissen +Cc: All applicable +Reviewed-by: Hans de Goede +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kernel/acpi/boot.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +--- a/arch/x86/kernel/acpi/boot.c ++++ b/arch/x86/kernel/acpi/boot.c +@@ -1328,6 +1328,17 @@ static int __init disable_acpi_pci(const + return 0; + } + ++static int __init disable_acpi_xsdt(const struct dmi_system_id *d) ++{ ++ if (!acpi_force) { ++ pr_notice("%s detected: force use of acpi=rsdt\n", d->ident); ++ acpi_gbl_do_not_use_xsdt = TRUE; ++ } else { ++ pr_notice("Warning: DMI blacklist says broken, but acpi XSDT forced\n"); ++ } ++ return 0; ++} ++ + static int __init dmi_disable_acpi(const struct dmi_system_id *d) + { + if (!acpi_force) { +@@ -1451,6 +1462,19 @@ static const struct dmi_system_id acpi_d + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), + }, + }, ++ /* ++ * Boxes that need ACPI XSDT use disabled due to corrupted tables ++ */ ++ { ++ .callback = disable_acpi_xsdt, ++ .ident = "Advantech DAC-BJ01", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "NEC"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "Bearlake CRB Board"), ++ DMI_MATCH(DMI_BIOS_VERSION, "V1.12"), ++ DMI_MATCH(DMI_BIOS_DATE, "02/01/2011"), ++ }, ++ }, + {} + }; + diff --git a/queue-5.16/crypto-qat-disable-registration-of-algorithms.patch b/queue-5.16/crypto-qat-disable-registration-of-algorithms.patch new file mode 100644 index 00000000000..8a9facd7044 --- /dev/null +++ b/queue-5.16/crypto-qat-disable-registration-of-algorithms.patch @@ -0,0 +1,61 @@ +From 8893d27ffcaf6ec6267038a177cb87bcde4dd3de Mon Sep 17 00:00:00 2001 +From: Giovanni Cabiddu +Date: Fri, 4 Mar 2022 17:54:47 +0000 +Subject: crypto: qat - disable registration of algorithms + +From: Giovanni Cabiddu + +commit 8893d27ffcaf6ec6267038a177cb87bcde4dd3de upstream. + +The implementations of aead and skcipher in the QAT driver do not +support properly requests with the CRYPTO_TFM_REQ_MAY_BACKLOG flag set. +If the HW queue is full, the driver returns -EBUSY but does not enqueue +the request. +This can result in applications like dm-crypt waiting indefinitely for a +completion of a request that was never submitted to the hardware. + +To avoid this problem, disable the registration of all crypto algorithms +in the QAT driver by setting the number of crypto instances to 0 at +configuration time. + +Cc: stable@vger.kernel.org +Signed-off-by: Giovanni Cabiddu +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/crypto/qat/qat_4xxx/adf_drv.c | 7 +++++++ + drivers/crypto/qat/qat_common/qat_crypto.c | 7 +++++++ + 2 files changed, 14 insertions(+) + +--- a/drivers/crypto/qat/qat_4xxx/adf_drv.c ++++ b/drivers/crypto/qat/qat_4xxx/adf_drv.c +@@ -52,6 +52,13 @@ static int adf_crypto_dev_config(struct + if (ret) + goto err; + ++ /* Temporarily set the number of crypto instances to zero to avoid ++ * registering the crypto algorithms. ++ * This will be removed when the algorithms will support the ++ * CRYPTO_TFM_REQ_MAY_BACKLOG flag ++ */ ++ instances = 0; ++ + for (i = 0; i < instances; i++) { + val = i; + bank = i * 2; +--- a/drivers/crypto/qat/qat_common/qat_crypto.c ++++ b/drivers/crypto/qat/qat_common/qat_crypto.c +@@ -136,6 +136,13 @@ int qat_crypto_dev_config(struct adf_acc + if (ret) + goto err; + ++ /* Temporarily set the number of crypto instances to zero to avoid ++ * registering the crypto algorithms. ++ * This will be removed when the algorithms will support the ++ * CRYPTO_TFM_REQ_MAY_BACKLOG flag ++ */ ++ instances = 0; ++ + for (i = 0; i < instances; i++) { + val = i; + snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_ASYM_BANK_NUM, i); diff --git a/queue-5.16/series b/queue-5.16/series index c42418ef2e0..3b0475194d2 100644 --- a/queue-5.16/series +++ b/queue-5.16/series @@ -21,3 +21,7 @@ alsa-pci-fix-reading-of-swapped-values-from-pcmreg-in-ac97-codec.patch drivers-net-xgene-fix-regression-in-crc-stripping.patch netfilter-nf_tables-initialize-registers-in-nft_do_chain.patch netfilter-nf_tables-validate-registers-coming-from-userspace.patch +acpi-x86-work-around-broken-xsdt-on-advantech-dac-bj01-board.patch +acpi-battery-add-device-hid-and-quirk-for-microsoft-surface-go-3.patch +acpi-video-force-backlight-native-for-clevo-nl5xru-and-nl5xnu.patch +crypto-qat-disable-registration-of-algorithms.patch -- 2.47.3