From 1d5e5193373085a701c7a164c829938190dd1687 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 11 Dec 2023 14:58:00 +0100 Subject: [PATCH] 5.15-stable patches added patches: docs-process-howto-replace-c89-with-c11.patch platform-x86-asus-wmi-fix-kbd_dock_devid-tablet-switch-reporting.patch tools-headers-uapi-sync-linux-perf_event.h-with-the-kernel-sources.patch --- ...s-process-howto-replace-c89-with-c11.patch | 100 ++++++++++++++++++ ...d_dock_devid-tablet-switch-reporting.patch | 82 ++++++++++++++ queue-5.15/series | 3 + ...perf_event.h-with-the-kernel-sources.patch | 54 ++++++++++ 4 files changed, 239 insertions(+) create mode 100644 queue-5.15/docs-process-howto-replace-c89-with-c11.patch create mode 100644 queue-5.15/platform-x86-asus-wmi-fix-kbd_dock_devid-tablet-switch-reporting.patch create mode 100644 queue-5.15/tools-headers-uapi-sync-linux-perf_event.h-with-the-kernel-sources.patch diff --git a/queue-5.15/docs-process-howto-replace-c89-with-c11.patch b/queue-5.15/docs-process-howto-replace-c89-with-c11.patch new file mode 100644 index 00000000000..550e635645d --- /dev/null +++ b/queue-5.15/docs-process-howto-replace-c89-with-c11.patch @@ -0,0 +1,100 @@ +From 2f3f53d62307262f0086804ea7cea99b0e085450 Mon Sep 17 00:00:00 2001 +From: Akira Yokosawa +Date: Sat, 15 Oct 2022 18:22:01 +0900 +Subject: docs/process/howto: Replace C89 with C11 + +From: Akira Yokosawa + +commit 2f3f53d62307262f0086804ea7cea99b0e085450 upstream. + +Commit e8c07082a810 ("Kbuild: move to -std=gnu11") updated +process/programming-language.rst, but failed to update +process/howto.rst. + +Update howto.rst and resolve the inconsistency. + +Fixes: e8c07082a810 ("Kbuild: move to -std=gnu11") +Signed-off-by: Akira Yokosawa +Cc: Arnd Bergmann +Cc: Federico Vaga +Cc: Alex Shi +Cc: Hu Haowen +Cc: Tsugikazu Shibata +Link: https://lore.kernel.org/r/20221015092201.32099-1-akiyks@gmail.com +Signed-off-by: Jonathan Corbet +Signed-off-by: Greg Kroah-Hartman +--- + Documentation/process/howto.rst | 2 +- + Documentation/translations/it_IT/process/howto.rst | 2 +- + Documentation/translations/ja_JP/howto.rst | 2 +- + Documentation/translations/ko_KR/howto.rst | 2 +- + Documentation/translations/zh_CN/process/howto.rst | 2 +- + Documentation/translations/zh_TW/process/howto.rst | 2 +- + 6 files changed, 6 insertions(+), 6 deletions(-) + +--- a/Documentation/process/howto.rst ++++ b/Documentation/process/howto.rst +@@ -36,7 +36,7 @@ experience, the following books are good + - "C: A Reference Manual" by Harbison and Steele [Prentice Hall] + + The kernel is written using GNU C and the GNU toolchain. While it +-adheres to the ISO C89 standard, it uses a number of extensions that are ++adheres to the ISO C11 standard, it uses a number of extensions that are + not featured in the standard. The kernel is a freestanding C + environment, with no reliance on the standard C library, so some + portions of the C standard are not supported. Arbitrary long long +--- a/Documentation/translations/it_IT/process/howto.rst ++++ b/Documentation/translations/it_IT/process/howto.rst +@@ -44,7 +44,7 @@ altro, utili riferimenti: + - "C: A Reference Manual" di Harbison and Steele [Prentice Hall] + + Il kernel è stato scritto usando GNU C e la toolchain GNU. +-Sebbene si attenga allo standard ISO C89, esso utilizza una serie di ++Sebbene si attenga allo standard ISO C11, esso utilizza una serie di + estensioni che non sono previste in questo standard. Il kernel è un + ambiente C indipendente, che non ha alcuna dipendenza dalle librerie + C standard, così alcune parti del C standard non sono supportate. +--- a/Documentation/translations/ja_JP/howto.rst ++++ b/Documentation/translations/ja_JP/howto.rst +@@ -65,7 +65,7 @@ Linux カーネル開発のやり方 + - 『新・詳説 C 言語 H&S リファレンス』 (サミュエル P ハービソン/ガイ L スティール共著 斉藤 信男監訳)[ソフトバンク] + + カーネルは GNU C と GNU ツールチェインを使って書かれています。カーネル +-は ISO C89 仕様に準拠して書く一方で、標準には無い言語拡張を多く使って ++は ISO C11 仕様に準拠して書く一方で、標準には無い言語拡張を多く使って + います。カーネルは標準 C ライブラリに依存しない、C 言語非依存環境です。 + そのため、C の標準の中で使えないものもあります。特に任意の long long + の除算や浮動小数点は使えません。カーネルがツールチェインや C 言語拡張 +--- a/Documentation/translations/ko_KR/howto.rst ++++ b/Documentation/translations/ko_KR/howto.rst +@@ -62,7 +62,7 @@ Documentation/process/howto.rst + - "Practical C Programming" by Steve Oualline [O'Reilly] + - "C: A Reference Manual" by Harbison and Steele [Prentice Hall] + +-커널은 GNU C와 GNU 툴체인을 사용하여 작성되었다. 이 툴들은 ISO C89 표준을 ++커널은 GNU C와 GNU 툴체인을 사용하여 작성되었다. 이 툴들은 ISO C11 표준을 + 따르는 반면 표준에 있지 않은 많은 확장기능도 가지고 있다. 커널은 표준 C + 라이브러리와는 관계없이 freestanding C 환경이어서 C 표준의 일부는 + 지원되지 않는다. 임의의 long long 나누기나 floating point는 지원되지 않는다. +--- a/Documentation/translations/zh_CN/process/howto.rst ++++ b/Documentation/translations/zh_CN/process/howto.rst +@@ -45,7 +45,7 @@ Linux内核大部分是由C语言写成ç + - "C: A Reference Manual" by Harbison and Steele [Prentice Hall] + 《C语言参考手册(原书第5版)》(邱仲潘 等译)[机械工业出版社] + +-Linux内核使用GNU C和GNU工具链开发。虽然它遵循ISO C89标准,但也用到了一些 ++Linux内核使用GNU C和GNU工具链开发。虽然它遵循ISO C11标准,但也用到了一些 + 标准中没有定义的扩展。内核是自给自足的C环境,不依赖于标准C库的支持,所以 + 并不支持C标准中的部分定义。比如long long类型的大数除法和浮点运算就不允许 + 使用。有时候确实很难弄清楚内核对工具链的要求和它所使用的扩展,不幸的是目 +--- a/Documentation/translations/zh_TW/process/howto.rst ++++ b/Documentation/translations/zh_TW/process/howto.rst +@@ -48,7 +48,7 @@ Linux內核大部分是由C語言寫成ç + - "C: A Reference Manual" by Harbison and Steele [Prentice Hall] + 《C語言參考手冊(原書第5版)》(邱仲潘 等譯)[機械工業出版社] + +-Linux內核使用GNU C和GNU工具鏈開發。雖然它遵循ISO C89標準,但也用到了一些 ++Linux內核使用GNU C和GNU工具鏈開發。雖然它遵循ISO C11標準,但也用到了一些 + 標準中沒有定義的擴展。內核是自給自足的C環境,不依賴於標準C庫的支持,所以 + 並不支持C標準中的部分定義。比如long long類型的大數除法和浮點運算就不允許 + 使用。有時候確實很難弄清楚內核對工具鏈的要求和它所使用的擴展,不幸的是目 diff --git a/queue-5.15/platform-x86-asus-wmi-fix-kbd_dock_devid-tablet-switch-reporting.patch b/queue-5.15/platform-x86-asus-wmi-fix-kbd_dock_devid-tablet-switch-reporting.patch new file mode 100644 index 00000000000..856f219cd8e --- /dev/null +++ b/queue-5.15/platform-x86-asus-wmi-fix-kbd_dock_devid-tablet-switch-reporting.patch @@ -0,0 +1,82 @@ +From fdcc0602d64f22185f61c70747214b630049cc33 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 20 Jan 2023 15:34:41 +0100 +Subject: platform/x86: asus-wmi: Fix kbd_dock_devid tablet-switch reporting + +From: Hans de Goede + +commit fdcc0602d64f22185f61c70747214b630049cc33 upstream. + +Commit 1ea0d3b46798 ("platform/x86: asus-wmi: Simplify tablet-mode-switch +handling") unified the asus-wmi tablet-switch handling, but it did not take +into account that the value returned for the kbd_dock_devid WMI method is +inverted where as the other ones are not inverted. + +This causes asus-wmi to report an inverted tablet-switch state for devices +which use the kbd_dock_devid, which causes libinput to ignore touchpad +events while the affected T10x model 2-in-1s are docked. + +Add inverting of the return value in the kbd_dock_devid case to fix this. + +Fixes: 1ea0d3b46798 ("platform/x86: asus-wmi: Simplify tablet-mode-switch handling") +Signed-off-by: Hans de Goede +Link: https://lore.kernel.org/r/20230120143441.527334-1-hdegoede@redhat.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/platform/x86/asus-wmi.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +--- a/drivers/platform/x86/asus-wmi.c ++++ b/drivers/platform/x86/asus-wmi.c +@@ -206,6 +206,7 @@ struct asus_wmi { + + int tablet_switch_event_code; + u32 tablet_switch_dev_id; ++ bool tablet_switch_inverted; + + enum fan_type fan_type; + int fan_pwm_mode; +@@ -367,6 +368,13 @@ static bool asus_wmi_dev_is_present(stru + } + + /* Input **********************************************************************/ ++static void asus_wmi_tablet_sw_report(struct asus_wmi *asus, bool value) ++{ ++ input_report_switch(asus->inputdev, SW_TABLET_MODE, ++ asus->tablet_switch_inverted ? !value : value); ++ input_sync(asus->inputdev); ++} ++ + static void asus_wmi_tablet_sw_init(struct asus_wmi *asus, u32 dev_id, int event_code) + { + struct device *dev = &asus->platform_device->dev; +@@ -375,7 +383,7 @@ static void asus_wmi_tablet_sw_init(stru + result = asus_wmi_get_devstate_simple(asus, dev_id); + if (result >= 0) { + input_set_capability(asus->inputdev, EV_SW, SW_TABLET_MODE); +- input_report_switch(asus->inputdev, SW_TABLET_MODE, result); ++ asus_wmi_tablet_sw_report(asus, result); + asus->tablet_switch_dev_id = dev_id; + asus->tablet_switch_event_code = event_code; + } else if (result == -ENODEV) { +@@ -408,6 +416,7 @@ static int asus_wmi_input_init(struct as + case asus_wmi_no_tablet_switch: + break; + case asus_wmi_kbd_dock_devid: ++ asus->tablet_switch_inverted = true; + asus_wmi_tablet_sw_init(asus, ASUS_WMI_DEVID_KBD_DOCK, NOTIFY_KBD_DOCK_CHANGE); + break; + case asus_wmi_lid_flip_devid: +@@ -447,10 +456,8 @@ static void asus_wmi_tablet_mode_get_sta + return; + + result = asus_wmi_get_devstate_simple(asus, asus->tablet_switch_dev_id); +- if (result >= 0) { +- input_report_switch(asus->inputdev, SW_TABLET_MODE, result); +- input_sync(asus->inputdev); +- } ++ if (result >= 0) ++ asus_wmi_tablet_sw_report(asus, result); + } + + /* dGPU ********************************************************************/ diff --git a/queue-5.15/series b/queue-5.15/series index 0604037488f..91cdcbdf479 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -106,6 +106,9 @@ r8169-fix-rtl8125b-pause-frames-blasting-when-suspen.patch mm-fix-oops-when-filemap_map_pmd-without-prealloc_pte.patch io_uring-af_unix-disable-sending-io_uring-over-sockets.patch netfilter-nft_set_pipapo-skip-inactive-elements-during-set-walk.patch +platform-x86-asus-wmi-fix-kbd_dock_devid-tablet-switch-reporting.patch +docs-process-howto-replace-c89-with-c11.patch +tools-headers-uapi-sync-linux-perf_event.h-with-the-kernel-sources.patch arm64-dts-mediatek-align-thermal-zone-node-names-wit.patch arm64-dts-mediatek-mt8183-move-thermal-zones-to-the-.patch arm64-dts-mediatek-add-missing-space-before.patch diff --git a/queue-5.15/tools-headers-uapi-sync-linux-perf_event.h-with-the-kernel-sources.patch b/queue-5.15/tools-headers-uapi-sync-linux-perf_event.h-with-the-kernel-sources.patch new file mode 100644 index 00000000000..9c5a5674f1d --- /dev/null +++ b/queue-5.15/tools-headers-uapi-sync-linux-perf_event.h-with-the-kernel-sources.patch @@ -0,0 +1,54 @@ +From 65ba872a6971c11ceb342c3330f059289c0e6bdb Mon Sep 17 00:00:00 2001 +From: Namhyung Kim +Date: Thu, 18 Aug 2022 17:36:41 -0700 +Subject: tools headers UAPI: Sync linux/perf_event.h with the kernel sources + +From: Namhyung Kim + +commit 65ba872a6971c11ceb342c3330f059289c0e6bdb upstream. + +To pick the trivial change in: + + 119a784c81270eb8 ("perf/core: Add a new read format to get a number of lost samples") + +Signed-off-by: Namhyung Kim +Acked-by: Jiri Olsa +Cc: Ian Rogers +Cc: Ingo Molnar +Cc: Peter Zijlstra +Link: https://lore.kernel.org/r/20220819003644.508916-2-namhyung@kernel.org +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman +--- + tools/include/uapi/linux/perf_event.h | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/tools/include/uapi/linux/perf_event.h ++++ b/tools/include/uapi/linux/perf_event.h +@@ -301,6 +301,7 @@ enum { + * { u64 time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED + * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING + * { u64 id; } && PERF_FORMAT_ID ++ * { u64 lost; } && PERF_FORMAT_LOST + * } && !PERF_FORMAT_GROUP + * + * { u64 nr; +@@ -308,6 +309,7 @@ enum { + * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING + * { u64 value; + * { u64 id; } && PERF_FORMAT_ID ++ * { u64 lost; } && PERF_FORMAT_LOST + * } cntr[nr]; + * } && PERF_FORMAT_GROUP + * }; +@@ -317,8 +319,9 @@ enum perf_event_read_format { + PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1, + PERF_FORMAT_ID = 1U << 2, + PERF_FORMAT_GROUP = 1U << 3, ++ PERF_FORMAT_LOST = 1U << 4, + +- PERF_FORMAT_MAX = 1U << 4, /* non-ABI */ ++ PERF_FORMAT_MAX = 1U << 5, /* non-ABI */ + }; + + #define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */ -- 2.47.3