- 15 7月, 2020 1 次提交
-
-
由 Andy Shevchenko 提交于
This reverts commit 35d13c7a. This broke procfs interface due to neglecting the fact that the strings are not coming NULL terminated. Revert the change till we will have a better clean up. Fixes: 35d13c7a ("platform/x86: thinkpad_acpi: Use strndup_user() in dispatch_proc_write()") Reported-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 15 5月, 2020 3 次提交
-
-
由 Andy Shevchenko 提交于
Call kstrtoint(), where appropriate, instead of using custom approach. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
由 Andy Shevchenko 提交于
Simplify the user copy code by using strndup_user(). Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
由 Andy Shevchenko 提交于
It seems next_cmd() predates the strsep() implementation in the kernel. For a long time we have the latter one, thus, replace next_cmd(&buf) with strsep(&buf, ","). Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 08 5月, 2020 1 次提交
-
-
由 Andy Shevchenko 提交于
led_classdev_unregister() already has the similar check, so, drop a duplicate in the driver. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 06 5月, 2020 1 次提交
-
-
由 Xiongfeng Wang 提交于
Since 'value' is declared as unsigned long, the following statement is always false. value < 0 So let's remove it. Reported-by: NHulk Robot <hulkci@huawei.com> Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 05 5月, 2020 1 次提交
-
-
由 Xiongfeng Wang 提交于
Since 'value' is declared as unsigned long, the following statement is always false. value < 0 So let's remove it. Reported-by: NHulk Robot <hulkci@huawei.com> Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 27 4月, 2020 1 次提交
-
-
由 Lars Hofhansl 提交于
This adds dual fan control for the following models: P50, P51, P52, P70, P71, P72, P1 gen1, P2 gen2, X1E gen1 and X1E gen2. Both fans are controlled together as if they were a single fan. Tested on an X1 Extreme Gen1, an X1 Extreme Gen2, and a P50. The patch is defensive, it adds only specific supported machines, and falls back to the old behavior if both fans cannot be controlled. Background: I tested the BIOS default behavior on my X1E gen2 and both fans are always changed together. So rather than adding controls for each fan, this controls both fans together as the BIOS would do. This was inspired by a discussion on dual fan support for the thinkfan tool (see link below). All BIOS IDs are taken from there. The X1E gen2 ID is verified on my machine. Thanks to GitHub users voidworker and civic9 for the earlier patches and BIOS IDs, and to users peter-stoll and sassman for testing the patch on their machines. BugLink: https://github.com/vmatare/thinkfan/issues/58Signed-off-by: NLars Hofhansl <larsh@apache.org> [andy: massaged commit message to capitalize ID and convert to BugLink] Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 04 2月, 2020 1 次提交
-
-
由 Alexey Dobriyan 提交于
The most notable change is DEFINE_SHOW_ATTRIBUTE macro split in seq_file.h. Conversion rule is: llseek => proc_lseek unlocked_ioctl => proc_ioctl xxx => proc_xxx delete ".owner = THIS_MODULE" line [akpm@linux-foundation.org: fix drivers/isdn/capi/kcapi_proc.c] [sfr@canb.auug.org.au: fix kernel/sched/psi.c] Link: http://lkml.kernel.org/r/20200122180545.36222f50@canb.auug.org.au Link: http://lkml.kernel.org/r/20191225172546.GB13378@avx2Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com> Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 08 9月, 2019 1 次提交
-
-
由 Alexander Schremmer 提交于
This feature is found optionally in T480s, T490, T490s. The feature is called lcdshadow and visible via /proc/acpi/ibm/lcdshadow. The ACPI methods \_SB.PCI0.LPCB.EC.HKEY.{GSSS,SSSS,TSSS,CSSS} are available in these machines. They get, set, toggle or change the state apparently. The patch was tested on a 5.0 series kernel on a T480s. Signed-off-by: NAlexander Schremmer <alex@alexanderweb.de> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 29 7月, 2019 1 次提交
-
-
由 Fuqian Huang 提交于
kmemdup is introduced to duplicate a region of memory in a neat way. Rather than kmalloc/kzalloc + memcpy, which the programmer needs to write the size twice (sometimes lead to mistakes), kmemdup improves readability, leads to smaller code and also reduce the chances of mistakes. Suggestion to use kmemdup rather than using kmalloc/kzalloc + memcpy. Signed-off-by: NFuqian Huang <huangfq.daxian@gmail.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 21 5月, 2019 1 次提交
-
-
由 Thomas Gleixner 提交于
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 51 franklin street fifth floor boston ma 02110 1301 usa this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option [no]_[pad]_[ctrl] any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 51 franklin street fifth floor boston ma 02110 1301 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 176 file(s). Signed-off-by: NThomas Gleixner <tglx@linutronix.de> Reviewed-by: NJilayne Lovejoy <opensource@jilayne.com> Reviewed-by: NSteve Winslow <swinslow@gmail.com> Reviewed-by: NAllison Randal <allison@lohutok.net> Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190519154040.652910950@linutronix.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 09 5月, 2019 2 次提交
-
-
由 Pavel Machek 提交于
Make error returns more consistent... no behaviour change intended. Signed-off-by: NPavel Machek <pavel@ucw.cz> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
由 Gustavo A. R. Silva 提交于
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warnings: drivers/platform/x86/thinkpad_acpi.c: In function ‘thermal_get_sensor’: drivers/platform/x86/thinkpad_acpi.c:6316:6: warning: this statement may fall through [-Wimplicit-fallthrough=] if (idx >= 8 && idx <= 15) { ^ drivers/platform/x86/thinkpad_acpi.c:6322:2: note: here case TPACPI_THERMAL_TPEC_8: ^~~~ drivers/platform/x86/thinkpad_acpi.c: In function ‘hotkey_notify’: drivers/platform/x86/thinkpad_acpi.c:4208:7: warning: this statement may fall through [-Wimplicit-fallthrough=] if (tp_features.hotkey_wlsw && ^ drivers/platform/x86/thinkpad_acpi.c:4216:3: note: here default: ^~~~~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 Notice that, in this particular case, the code comments are modified in accordance with what GCC is expecting to find. This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com> Reviewed-by: NKees Cook <keescook@chromium.org> Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 06 5月, 2019 1 次提交
-
-
由 Colin Ian King 提交于
There is a spelling mistake in a module parameter description. Fix it. Signed-off-by: NColin Ian King <colin.king@canonical.com> Reviewed-by: NMukesh Ojha <mojha@codeaurora.org> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 09 4月, 2019 2 次提交
-
-
由 Jiaxun Yang 提交于
Newer ThinkPads have a totally different EC program information DMI table. And thermal subdriver can't work without correct EC version. Read from this entry if the old method failed to get EC information. Signed-off-by: NJiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
由 Jiaxun Yang 提交于
Some AMD based ThinkPads have a firmware bug that calling "GBDC" will cause Bluetooth on Intel wireless cards blocked. Probe these models by DMI match and disable Bluetooth subdriver if specified Intel wireless card exist. Cc: stable <stable@vger.kernel.org> # 4.14+ Signed-off-by: NJiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 10 12月, 2018 1 次提交
-
-
由 Jouke Witteveen 提交于
- Use generic quirks macros for fan quirks The fan-specific quirks macros were duplicates of the generic ones. - Remove useless #undef lines The referenced macros are not defined anywhere. Signed-off-by: NJouke Witteveen <j.witteveen@gmail.com> Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 29 11月, 2018 2 次提交
-
-
由 Takashi Iwai 提交于
Since we've switched to the LED trigger for binding with HD-audio, we can drop the exported function as well as the whole linux/thinkpad_acpi.h. The own TPACPI_LED_MUTE and TPACPI_LED_MICMUTE definitions are replaced with the identical ones for LEDS, i.e. LED_AUDIO_MUTE and LED_AUDIO_MICMUTE, respectively. They are no longer needed as referred only locally. Acked-by: NJacek Anaszewski <jacek.anaszewski@gmail.com> Acked-by: NPavel Machek <pavel@ucw.cz> Acked-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br> Acked-by: NPali Rohár <pali.rohar@gmail.com> Signed-off-by: NTakashi Iwai <tiwai@suse.de>
-
由 Takashi Iwai 提交于
In the upcoming change, the binding of audio mute / mic-mute LED controls will be switched with LED trigger. This patch is the last piece of preparation: adding the audio mute / mic-mute LED class devices to thinkpad_acpi driver. Two devices, platform::mute and platform::micmute, will be added for controlling the mute LED and mic-mute LED, respectively. The new prefix "platform" is the suggestion by upstream for indicating the generic laptop attribute. Also this selects CONFIG_LEDS_TRIGGERS and CONFIG_LEDS_TRIGGERS_AUDIO unconditionally. Strictly speaking, these aren't 100% mandatory, but leaving these manual selections would lead to a functional regression easily once after converting from the dynamic symbol binding to the LEDs trigger in a later patch. Acked-by: NJacek Anaszewski <jacek.anaszewski@gmail.com> Acked-by: NPavel Machek <pavel@ucw.cz> Acked-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br> Acked-by: NPali Rohár <pali.rohar@gmail.com> Signed-off-by: NTakashi Iwai <tiwai@suse.de>
-
- 07 11月, 2018 1 次提交
-
-
由 Zhang Xianwei 提交于
The keycode KEY_FAVORITES(0x16c) used in thinkpad_acpi driver is too big (out of range > 255) for xorg to handle. xkeyboard-config has already mapped KEY_BOOKMARKS(156) to XF86Favorites: keycodes/evdev: <I164> = 164; // #define KEY_BOOKMARKS 156 symbols/inet: key <I164> { [ XF86Favorites ] }; So change the keymap to KEY_BOOKMARKS for Favorites hotkey. Signed-off-by: NZhang Xianwei <zhang.xianwei8@zte.com.cn> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 15 8月, 2018 2 次提交
-
-
由 Thomas Weißschuh 提交于
The struct containing the supported operations for all batteries is being zeroed on each battery probe. This prevents all other batteries except the lastly probed one from being configured. Signed-off-by: NThomas Weißschuh <linux@weissschuh.net> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
由 Jouke Witteveen 提交于
Based on bug reports and a web search for "Thinkpad_acpi: Error probing battery 2" four more models were found that require the battery quirk: Lenovo B5400, Thinkpad 11e, Thinkpad 11e gen 3, Thinkpad 13 gen 3. Signed-off-by: NJouke Witteveen <j.witteveen@gmail.com> Tested-by: NJames Cheshire <jermizzey@gmail.com> Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 21 7月, 2018 1 次提交
-
-
由 Eric W. Biederman 提交于
The cost is the the same and this removes the need to worry about complications that come from de_thread and group_leader changing. __task_pid_nr_ns has been updated to take advantage of this change. Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
-
- 18 7月, 2018 2 次提交
-
-
由 Jouke Witteveen 提交于
Some Thinkpads have a single battery, but expose it as BAT1. Use the quirks engine to force these machines into always addressing the primary battery. Without this, the battery name would resolve to the non-existent secondary battery and ACPI calls would fail. Signed-off-by: NJouke Witteveen <j.witteveen@gmail.com> Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
由 Jouke Witteveen 提交于
Modern Thinkpads have three character model designators. Previously, they would be accepted, but recorded incompletely. Revision matching extracted the wrong bytes from the ID string. This made the use of quirks for modern machines impossible. Fixes: 1b0eb5bcSigned-off-by: NJouke Witteveen <j.witteveen@gmail.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 27 6月, 2018 1 次提交
-
-
由 Benjamin Berg 提交于
The P52 has a keyboard which features a calculator key above the numpad. Add support for this the calculator key (0x1313). Signed-off-by: NBenjamin Berg <bberg@redhat.com> Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: NDarren Hart (VMware) <dvhart@infradead.org>
-
- 13 6月, 2018 1 次提交
-
-
由 Kees Cook 提交于
The kzalloc() function has a 2-factor argument form, kcalloc(). This patch replaces cases of: kzalloc(a * b, gfp) with: kcalloc(a * b, gfp) as well as handling cases of: kzalloc(a * b * c, gfp) with: kzalloc(array3_size(a, b, c), gfp) as it's slightly less ugly than: kzalloc_array(array_size(a, b), c, gfp) This does, however, attempt to ignore constant size factors like: kzalloc(4 * 1024, gfp) though any constants defined via macros get caught up in the conversion. Any factors with a sizeof() of "unsigned char", "char", and "u8" were dropped, since they're redundant. The Coccinelle script used for this was: // Fix redundant parens around sizeof(). @@ type TYPE; expression THING, E; @@ ( kzalloc( - (sizeof(TYPE)) * E + sizeof(TYPE) * E , ...) | kzalloc( - (sizeof(THING)) * E + sizeof(THING) * E , ...) ) // Drop single-byte sizes and redundant parens. @@ expression COUNT; typedef u8; typedef __u8; @@ ( kzalloc( - sizeof(u8) * (COUNT) + COUNT , ...) | kzalloc( - sizeof(__u8) * (COUNT) + COUNT , ...) | kzalloc( - sizeof(char) * (COUNT) + COUNT , ...) | kzalloc( - sizeof(unsigned char) * (COUNT) + COUNT , ...) | kzalloc( - sizeof(u8) * COUNT + COUNT , ...) | kzalloc( - sizeof(__u8) * COUNT + COUNT , ...) | kzalloc( - sizeof(char) * COUNT + COUNT , ...) | kzalloc( - sizeof(unsigned char) * COUNT + COUNT , ...) ) // 2-factor product with sizeof(type/expression) and identifier or constant. @@ type TYPE; expression THING; identifier COUNT_ID; constant COUNT_CONST; @@ ( - kzalloc + kcalloc ( - sizeof(TYPE) * (COUNT_ID) + COUNT_ID, sizeof(TYPE) , ...) | - kzalloc + kcalloc ( - sizeof(TYPE) * COUNT_ID + COUNT_ID, sizeof(TYPE) , ...) | - kzalloc + kcalloc ( - sizeof(TYPE) * (COUNT_CONST) + COUNT_CONST, sizeof(TYPE) , ...) | - kzalloc + kcalloc ( - sizeof(TYPE) * COUNT_CONST + COUNT_CONST, sizeof(TYPE) , ...) | - kzalloc + kcalloc ( - sizeof(THING) * (COUNT_ID) + COUNT_ID, sizeof(THING) , ...) | - kzalloc + kcalloc ( - sizeof(THING) * COUNT_ID + COUNT_ID, sizeof(THING) , ...) | - kzalloc + kcalloc ( - sizeof(THING) * (COUNT_CONST) + COUNT_CONST, sizeof(THING) , ...) | - kzalloc + kcalloc ( - sizeof(THING) * COUNT_CONST + COUNT_CONST, sizeof(THING) , ...) ) // 2-factor product, only identifiers. @@ identifier SIZE, COUNT; @@ - kzalloc + kcalloc ( - SIZE * COUNT + COUNT, SIZE , ...) // 3-factor product with 1 sizeof(type) or sizeof(expression), with // redundant parens removed. @@ expression THING; identifier STRIDE, COUNT; type TYPE; @@ ( kzalloc( - sizeof(TYPE) * (COUNT) * (STRIDE) + array3_size(COUNT, STRIDE, sizeof(TYPE)) , ...) | kzalloc( - sizeof(TYPE) * (COUNT) * STRIDE + array3_size(COUNT, STRIDE, sizeof(TYPE)) , ...) | kzalloc( - sizeof(TYPE) * COUNT * (STRIDE) + array3_size(COUNT, STRIDE, sizeof(TYPE)) , ...) | kzalloc( - sizeof(TYPE) * COUNT * STRIDE + array3_size(COUNT, STRIDE, sizeof(TYPE)) , ...) | kzalloc( - sizeof(THING) * (COUNT) * (STRIDE) + array3_size(COUNT, STRIDE, sizeof(THING)) , ...) | kzalloc( - sizeof(THING) * (COUNT) * STRIDE + array3_size(COUNT, STRIDE, sizeof(THING)) , ...) | kzalloc( - sizeof(THING) * COUNT * (STRIDE) + array3_size(COUNT, STRIDE, sizeof(THING)) , ...) | kzalloc( - sizeof(THING) * COUNT * STRIDE + array3_size(COUNT, STRIDE, sizeof(THING)) , ...) ) // 3-factor product with 2 sizeof(variable), with redundant parens removed. @@ expression THING1, THING2; identifier COUNT; type TYPE1, TYPE2; @@ ( kzalloc( - sizeof(TYPE1) * sizeof(TYPE2) * COUNT + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2)) , ...) | kzalloc( - sizeof(TYPE1) * sizeof(THING2) * (COUNT) + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2)) , ...) | kzalloc( - sizeof(THING1) * sizeof(THING2) * COUNT + array3_size(COUNT, sizeof(THING1), sizeof(THING2)) , ...) | kzalloc( - sizeof(THING1) * sizeof(THING2) * (COUNT) + array3_size(COUNT, sizeof(THING1), sizeof(THING2)) , ...) | kzalloc( - sizeof(TYPE1) * sizeof(THING2) * COUNT + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2)) , ...) | kzalloc( - sizeof(TYPE1) * sizeof(THING2) * (COUNT) + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2)) , ...) ) // 3-factor product, only identifiers, with redundant parens removed. @@ identifier STRIDE, SIZE, COUNT; @@ ( kzalloc( - (COUNT) * STRIDE * SIZE + array3_size(COUNT, STRIDE, SIZE) , ...) | kzalloc( - COUNT * (STRIDE) * SIZE + array3_size(COUNT, STRIDE, SIZE) , ...) | kzalloc( - COUNT * STRIDE * (SIZE) + array3_size(COUNT, STRIDE, SIZE) , ...) | kzalloc( - (COUNT) * (STRIDE) * SIZE + array3_size(COUNT, STRIDE, SIZE) , ...) | kzalloc( - COUNT * (STRIDE) * (SIZE) + array3_size(COUNT, STRIDE, SIZE) , ...) | kzalloc( - (COUNT) * STRIDE * (SIZE) + array3_size(COUNT, STRIDE, SIZE) , ...) | kzalloc( - (COUNT) * (STRIDE) * (SIZE) + array3_size(COUNT, STRIDE, SIZE) , ...) | kzalloc( - COUNT * STRIDE * SIZE + array3_size(COUNT, STRIDE, SIZE) , ...) ) // Any remaining multi-factor products, first at least 3-factor products, // when they're not all constants... @@ expression E1, E2, E3; constant C1, C2, C3; @@ ( kzalloc(C1 * C2 * C3, ...) | kzalloc( - (E1) * E2 * E3 + array3_size(E1, E2, E3) , ...) | kzalloc( - (E1) * (E2) * E3 + array3_size(E1, E2, E3) , ...) | kzalloc( - (E1) * (E2) * (E3) + array3_size(E1, E2, E3) , ...) | kzalloc( - E1 * E2 * E3 + array3_size(E1, E2, E3) , ...) ) // And then all remaining 2 factors products when they're not all constants, // keeping sizeof() as the second factor argument. @@ expression THING, E1, E2; type TYPE; constant C1, C2, C3; @@ ( kzalloc(sizeof(THING) * C2, ...) | kzalloc(sizeof(TYPE) * C2, ...) | kzalloc(C1 * C2 * C3, ...) | kzalloc(C1 * C2, ...) | - kzalloc + kcalloc ( - sizeof(TYPE) * (E2) + E2, sizeof(TYPE) , ...) | - kzalloc + kcalloc ( - sizeof(TYPE) * E2 + E2, sizeof(TYPE) , ...) | - kzalloc + kcalloc ( - sizeof(THING) * (E2) + E2, sizeof(THING) , ...) | - kzalloc + kcalloc ( - sizeof(THING) * E2 + E2, sizeof(THING) , ...) | - kzalloc + kcalloc ( - (E1) * E2 + E1, E2 , ...) | - kzalloc + kcalloc ( - (E1) * (E2) + E1, E2 , ...) | - kzalloc + kcalloc ( - E1 * E2 + E1, E2 , ...) ) Signed-off-by: NKees Cook <keescook@chromium.org>
-
- 07 5月, 2018 3 次提交
-
-
Do not consider unknown HKEY events in the 0x6000 range to be thermal warnings. Instead, handle them as a generic unknown HKEY event, which are reported to the kernel log at priority "notice", and do not trigger a thermal registers state dump to the log. Signed-off-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br> Tested-by: NJordan Glover <Golden_Miller83@protonmail.ch> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
We should not do a thermal sensors state dump to the kernel log just because the laptop is reporting that it changed into or out of tablet mode. Signed-off-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br> Tested-by: NJordan Glover <Golden_Miller83@protonmail.ch> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
Demote to debug level one existing thermal-control related event, and also add two new ones that would otherwise trigger unknown event warnings. These events are Windows-only for now. We do report them to userspace in case they become useful in the future. Signed-off-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br> Reported-by: NJordan Glover <Golden_Miller83@protonmail.ch> Tested-by: NJordan Glover <Golden_Miller83@protonmail.ch> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 03 4月, 2018 1 次提交
-
-
由 Alexander Kappner 提交于
The Thinkpad P50 has 2 fans. Add the 2FAN quirk so the tpacpi driver properly reports both fan speeds. Because the P50 doesn't report the version of its EC controller, we need to identify it by BIOS version (N1). Signed-off-by: NAlexander Kappner <agk@godking.net> Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br> [andy: renamed macro, massaged changelog] Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 22 2月, 2018 1 次提交
-
-
由 Ognjen Galic 提交于
1) Charge start threshold /sys/class/power_supply/BATN/charge_start_threshold Valid values are [0, 99]. A value of 0 turns off the start threshold wear control. 2) Charge stop threshold /sys/class/power_supply/BATN/charge_stop_threshold Valid values are [1, 100]. A value of 100 turns off the stop threshold wear control. This must be configured first. Signed-off-by: NOgnjen Galic <smclt30p@gmail.com> Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 24 1月, 2018 1 次提交
-
-
由 David Herrmann 提交于
This patch prevents the thinkpad_acpi driver from warning about 2 event codes returned for keyboard palm-detection. No behavioral changes, other than suppressing the warning in the kernel log. The events are still forwarded via acpi-netlink channels. We could, optionally, decide to forward the event through a input-switch on the tpacpi input device. However, so far no suitable input-code exists, and no similar drivers report such events. Hence, leave it an acpi event for now. Note that the event-codes are named based on empirical studies. On the ThinkPad X1 5th Gen the sensor can be found underneath the arrow key. Cc: Matthew Thode <mthode@mthode.org> Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com> Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 21 12月, 2017 1 次提交
-
-
由 Benjamin Berg 提交于
On the X1 Yoga 2nd Generation and most likely other notebooks the FLAT mode is reported. Decode it correctly rather than warning about an unexpected multi mode status to be reported. Signed-off-by: NBenjamin Berg <bberg@redhat.com> Cc: Peter FP1 Zhang <zhangfp1@lenovo.com Cc: Lyude <lyude@redhat.com> Reviewed-by: NLyude Paul <lyude@redhat.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 31 10月, 2017 1 次提交
-
-
由 Kees Cook 提交于
Several function prototypes for the set/get functions defined by module_param_call() have a slightly wrong argument types. This fixes those in an effort to clean up the calls when running under type-enforced compiler instrumentation for CFI. This is the result of running the following semantic patch: @match_module_param_call_function@ declarer name module_param_call; identifier _name, _set_func, _get_func; expression _arg, _mode; @@ module_param_call(_name, _set_func, _get_func, _arg, _mode); @fix_set_prototype depends on match_module_param_call_function@ identifier match_module_param_call_function._set_func; identifier _val, _param; type _val_type, _param_type; @@ int _set_func( -_val_type _val +const char * _val , -_param_type _param +const struct kernel_param * _param ) { ... } @fix_get_prototype depends on match_module_param_call_function@ identifier match_module_param_call_function._get_func; identifier _val, _param; type _val_type, _param_type; @@ int _get_func( -_val_type _val +char * _val , -_param_type _param +const struct kernel_param * _param ) { ... } Two additional by-hand changes are included for places where the above Coccinelle script didn't notice them: drivers/platform/x86/thinkpad_acpi.c fs/lockd/svc.c Signed-off-by: NKees Cook <keescook@chromium.org> Signed-off-by: NJessica Yu <jeyu@kernel.org>
-
- 01 10月, 2017 1 次提交
-
-
由 Benjamin Berg 提交于
Many thinkpad laptops and convertibles provide the GMMS method to resolve how far the laptop has been opened and whether it has been converted into tablet mode. This allows reporting a more precise tablet mode state to userspace. The current implementation only reports a summarized tablet mode state which is triggered as soon as the input devices become unusable as they are folded away from the display. This will work on all models where the CMMD method was used previously and it may also work in other cases. Thanks to Peter Zhang of Lenovo for providing information on how to use the GMMS method to query the tablet mode. Signed-off-by: NBenjamin Berg <bberg@redhat.com> Cc: Peter FP1 Zhang <zhangfp1@lenovo.com> Cc: Lyude Paul <lyude@redhat.com> Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br> Reviewed-by: NLyude Paul <lyude@redhat.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 19 8月, 2017 1 次提交
-
-
由 Stanislav Fomichev 提交于
Use hwmon_device_register_with_groups instead of deprecated hwmon_device_register and fix a dmesg warning. This patch however changes the userspace API. hwmon_device_register_with_groups takes `hwmon' name as an argument and creates a name file in the `hwmon' device, not in the `platform_device'. This allows us to remove custom `name' device attribute, but in order to make lm-sensors happy we also have to move fans and thermal attributes to the `hwmon' device. Even though this patch changes userspace API, it's still compatible with the lm-sensors. Starting with lm-sensors 3.0 (circa 2007), it looks at both hwmon and the backing device for the name and other attributes. before: $ cat /sys/devices/platform/thinkpad_hwmon/{name,fan1_input} thinkpad 2007 $ cat /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon1/{name,fan1_input} cat: /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon1/name: No such file or directory cat: /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon1/fan1_input: No such file or directory $ cat /sys/class/hwmon/hwmon1/{name,fan1_input} cat: /sys/class/hwmon/hwmon1/name: No such file or directory cat: /sys/class/hwmon/hwmon1/fan1_input: No such file or directory $ sensors thinkpad-isa-0000 Adapter: ISA adapter fan1: 3533 RPM after: $ cat /sys/devices/platform/thinkpad_hwmon/{name,fan1_input} cat: /sys/devices/platform/thinkpad_hwmon/name: No such file or directory cat: /sys/devices/platform/thinkpad_hwmon/fan1_input: No such file or directory $ cat /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon1/{name,fan1_input} thinkpad 3478 $ cat /sys/class/hwmon/hwmon1/{name,fan1_input} thinkpad 3478 $ sensors thinkpad-isa-0000 Adapter: ISA adapter fan1: 3489 RPM $ sensors -v sensors version 3.4.0 with libsensors version 3.4.0 Signed-off-by: NStanislav Fomichev <kernel@fomichev.me> [dvhart: cleaned up commit log, bumped version to 4.14 in the doc change] Signed-off-by: NDarren Hart (VMware) <dvhart@infradead.org>
-
- 12 6月, 2017 1 次提交
-
-
由 Greg Kroah-Hartman 提交于
We are trying to get rid of DRIVER_ATTR(), and the thinkpad_acpi driver's attributes can be trivially changed to use DRIVER_ATTR_RO() and DRIVER_ATTR_RW(). Cc: Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br> Cc: Andy Shevchenko <andy@infradead.org> Cc: <ibm-acpi-devel@lists.sourceforge.net> Cc: <platform-driver-x86@vger.kernel.org> Reviewed-by: NDarren Hart (VMware) <dvhart@infradead.org> Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 15 5月, 2017 1 次提交
-
-
由 Andy Shevchenko 提交于
As per discussion [1] there are only few users of module_param_call() in kernel which prevent to read module parameters back. It thinkpad_acpi driver there is even no method do so. Thus, for now, add just a comment to explain why 0 is used as permissions in module_param_call(). [1]: https://patchwork.ozlabs.org/patch/713245/ Cc: Richard Weinberger <richard.weinberger@gmail.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br>
-