aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-12-26hwmon: add driver for NZXT RGB&Fan Controller/Smart Device v2.Aleksandr Mezin6-0/+910
This driver implements monitoring and control of fans plugged into the device. Besides typical speed monitoring and PWM duty cycle control, voltage and current are reported for every fan. The device also has 2 connectors for RGB LEDs, support for them isn't implemented (mainly because there is no standardized sysfs interface). Also, the device has a noise sensor, but the sensor seems to be completely useless (and very imprecise), so support for it isn't implemented too. The driver coexists with userspace tools that access the device through hidraw interface with no known issues. The driver has been tested on x86_64, built in and as a module. Some changes/improvements were suggested by Jonas Malaco. Signed-off-by: Aleksandr Mezin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (nct6775) add ROG STRIX B550-A/X570-I GAMINGDenis Pauk1-0/+2
ASUS ROG STRIX B550-A/X570-I GAMING boards have got an nct6775 chip, but by default there's no use of it because of resource conflict with WMI method. This commit adds "ROG STRIX B550-A GAMING" and "ROG STRIX X570-I GAMING" to the list of boards that can be monitored using ASUS WMI. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204807 Signed-off-by: Denis Pauk <[email protected]> Tested-by: Daniel Gibson <[email protected]> Tested-by: Michael Altizer <[email protected]> Tested-by: Mikhail Gavrilov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (pmbus) Add support for MPS Multi-phase mp5023[email protected]5-0/+162
Add support for mp5023 device from Monolithic Power Systems, Inc. (MPS) vendor. This is a Hot-Swap Controller. Signed-off-by: Howard Chiu <[email protected]> Link: https://lore.kernel.org/r/HKAPR04MB400349AA406694FB976D78D096709@HKAPR04MB4003.apcprd04.prod.outlook.com [groeck: Added MODULE_IMPORT_NS, entry in index.rst] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26dt-bindings: add Delta AHE-50DC fan control moduleZev Weiss1-0/+2
This is the integrated fan control module of the Delta AHE-50DC Open19 power shelf. Signed-off-by: Zev Weiss <[email protected]> Acked-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (pmbus) Add Delta AHE-50DC fan control module driverZev Weiss4-0/+131
This device is an integrated module of the Delta AHE-50DC Open19 power shelf. I haven't been able to procure any proper documentation for it, but it seems to be a (somewhat minimally) PMBus-compliant device. It provides four fan speeds, four temperatures (three standard and one manufacturer-specific via a virtual second page), and a vin reading. Signed-off-by: Zev Weiss <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: prefix kernel-doc comments for structs with structLukas Bulwahn1-2/+2
The command ./scripts/kernel-doc -none include/linux/hwmon.h warns: include/linux/hwmon.h:406: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Channel information include/linux/hwmon.h:425: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Chip configuration Address those kernel-doc warnings by prefixing kernel-doc descriptions for structs with the keyword 'struct'. Signed-off-by: Lukas Bulwahn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (ntc_thermistor) Add Samsung 1404-001221 NTCLinus Walleij2-0/+5
This adds the Samsung 1404-001221 NTC thermistor to the NTC thermistor driver. As far as I can tell it is electrically compatible with the Murata 47K NTC thermistor. This thermistor is mounted in a variety of Samsung products. Cc: Peter Rosin <[email protected]> Cc: Chris Lesiak <[email protected]> Cc: [email protected] Signed-off-by: Linus Walleij <[email protected]> Acked-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (ntc_thermistor) Drop OF dependencyLinus Walleij1-1/+0
The driver has been augmented to just use device properties so the OF dependency can be dropped. Cc: Peter Rosin <[email protected]> Cc: Chris Lesiak <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (dell-smm) Unify i8k_ioctl() and i8k_ioctl_unlocked()Armin Wolf1-19/+9
The only purpose of i8k_ioctl() is to call i8k_ioctl_unlocked() with i8k_mutex held. Judging from the hwmon code, this mutex only needs to be held when setting the fan speed/mode, so the operation of I8K_SET_FAN is guaranteed to be atomic. Unify both functions and reduce the locking of i8k_mutex to I8K_SET_FAN. Tested on a Dell Inspiron 3505. Signed-off-by: Armin Wolf <[email protected]> Reviewed-by: Pali Rohár <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (dell-smm) Simplify ioctl handlerArmin Wolf1-21/+9
The second switch-case has no real purpose: - for I8K_BIOS_VERSION, val does not represent a return value, making the check for error values unnecessary. - for I8K_MACHINE_ID, val remains zero, so the error check is unnecessary too. Remove the switch-case and move the calls to copy_to_user() into the first switch-case for I8K_BIOS_VERSION/_MACHINE_ID. Omit buff[] since data->bios_machineid already contains the string with the necessary zero padding through devm_kzalloc(). Tested on a Dell Inspiron 3505. Signed-off-by: Armin Wolf <[email protected]> Reviewed-by: Pali Rohár <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (raspberrypi) Exit immediately in case of error in initArmin Wolf1-3/+4
Exit immediately if devm_hwmon_device_register_with_info() fails since registering a delayed work whould be useless in such a case anyway. Signed-off-by: Armin Wolf <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (nct6775) delete some extension linesDan Carpenter1-4/+2
This code can fit on one line. No need to break it up. Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/20211215114050.GB14967@kili Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (ntc_thermistor) Move DT matches to the driver blockLinus Walleij1-35/+35
This moves the device tree match data toward the end of the driver which is the convention, here we can also add ACPI and similar match data in a conforming manner. Cc: Peter Rosin <[email protected]> Cc: Chris Lesiak <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (ntc_thermistor) Switch to generic firmware propsLinus Walleij1-17/+19
This switches to retrieveing the configuration of the NTC from generic firmware properties so that we get neutral from device tree: now ACPI or, more importantly, software nodes can be used to spawn NTC devices provided they have the required properties. This was inspired by the similar changes made to the IIO drivers. This was tested on the Ux500 HREF with the NTC devices probing from device tree just as fine after this as before. Cc: Peter Rosin <[email protected]> Cc: Chris Lesiak <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (ntc_thermistor) Move and refactor DT parsingLinus Walleij1-50/+43
Move the parsing of the DT config right above probe(). Allocate the state container for the driver in probe() instead of inside the DT config parsing function: as a result return an int instead of a pointer. Drop the check for !np: we can only probe from DT right now so no risk of ending up here. Cc: Peter Rosin <[email protected]> Cc: Chris Lesiak <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (adm1031) Remove redundant assignment to variable rangeColin Ian King1-2/+1
Variable range is being initialized with a value that is never read, it is being re-assigned in the next statement. The assignment is redundant, remove it and initialize range using the second assigned value. Clean up the formatting too by adding missing spaces. Signed-off-by: Colin Ian King <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (asus_wmi_sensors) fix an array overflowDan Carpenter1-1/+1
Smatch detects this array overflow: drivers/hwmon/asus_wmi_sensors.c:569 asus_wmi_configure_sensor_setup() error: buffer overflow 'hwmon_attributes' 8 <= 9 The hwmon_attributes[] array should have "hwmon_max" so that it gets larger when more attributes are added. Fixes: 9d07e54a25b8 ("hwmon: (asus_wmi_sensors) Support X370 Asus WMI.") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/20211130105117.GH5827@kili Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (asus_wmi_ec_sensors) fix array overflowDan Carpenter1-1/+1
Smatch detected an array out of bounds error: drivers/hwmon/asus_wmi_ec_sensors.c:562 asus_wmi_ec_configure_sensor_setup() error: buffer overflow 'hwmon_attributes' 8 <= 9 The hwmon_attributes[] array needs to be declared with "hwmon_max" elements. Fixes: c04c7f7bfcbe ("hwmon: (asus_wmi_ec_sensors) Support B550 Asus WMI.") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/20211130105034.GG5827@kili Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (sht4x) Add device tree match tableDavid Mosberger-Tang1-0/+7
This patch enables automatic loading of the sht4x module via a device tree table entry. Signed-off-by: David Mosberger-Tang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (ntc_thermistor) Merge platform dataLinus Walleij1-61/+48
Allocate one state container for the device: struct ntc_data. Move all items from struct ntc_thermistor_platform_data into this struct and simplify. Cc: Peter Rosin <[email protected]> Cc: Chris Lesiak <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (ntc_thermistor) Drop read_uv() depend on OF and IIOLinus Walleij2-38/+16
The only possible assignment of a function to get a voltage to convert to a resistance is to use the internal function ntc_adc_iio_read() which is only available when using IIO and OF. Bite the bullet and mandate OF and IIO, drop the read_uv() callback abstraction and some ifdefs. As no board is using the platform data, all users are using OF and IIO anyway. Cc: Peter Rosin <[email protected]> Cc: Chris Lesiak <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (ntc_thermistor) Drop get_ohm()Linus Walleij1-19/+2
Nothing in the kernel (this driver) is using the callback to read ohms directly. We always read a voltage and convert it to a resistance. Drop this callback. Cc: Peter Rosin <[email protected]> Cc: Chris Lesiak <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (ntc_thermistor) Merge platform data into driverLinus Walleij2-55/+36
Platform data is supposed to be used with "board files", device descriptions in C. Since the introduction of the NTC driver in 2011, no such platforms have been submitted to the Linux kernel, and their use is strongly discouraged in favor of Device Tree, ACPI or as last resort software firmware nodes. Drop the external header and copy the platform data into the driver file. Cc: Peter Rosin <[email protected]> Cc: Chris Lesiak <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (jc42) Add support for ONSEMI N34TS04Guenter Roeck1-0/+4
N34TS04 is a JC42.4 compatible temperature sensor from ONSEMI. Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (k10temp) Support up to 12 CCDs on AMD Family of processorsBabu Moger1-3/+14
The current driver can read the temperatures from upto 8 CCDs (Core-Complex Die). The newer AMD Family 19h Models 10h-1Fh and A0h-AFh can support up to 12 CCDs. Update the driver to read up to 12 CCDs. Signed-off-by: Babu Moger <[email protected]> Link: https://lore.kernel.org/r/163776976762.904164.5618896687524494215.stgit@bmoger-ubuntu Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (asus_wmi_sensors) Support X370 Asus WMI.Denis Pauk6-0/+763
Provides a Linux kernel module "asus_wmi_sensors" that provides sensor readouts via ASUS' WMI interface present in the UEFI of X370/X470/B450/X399 Ryzen motherboards. Supported motherboards: * ROG CROSSHAIR VI HERO, * PRIME X399-A, * PRIME X470-PRO, * ROG CROSSHAIR VI EXTREME, * ROG CROSSHAIR VI HERO (WI-FI AC), * ROG CROSSHAIR VII HERO, * ROG CROSSHAIR VII HERO (WI-FI), * ROG STRIX B450-E GAMING, * ROG STRIX B450-F GAMING, * ROG STRIX B450-I GAMING, * ROG STRIX X399-E GAMING, * ROG STRIX X470-F GAMING, * ROG STRIX X470-I GAMING, * ROG ZENITH EXTREME, * ROG ZENITH EXTREME ALPHA. Co-developed-by: Ed Brindley <[email protected]> Signed-off-by: Ed Brindley <[email protected]> Signed-off-by: Denis Pauk <[email protected]> [groeck: Squashed: "hwmon: Fix warnings in asus_wmi_sensors.rst documetation."] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (asus_wmi_ec_sensors) Support B550 Asus WMI.Denis Pauk6-0/+680
Linux HWMON sensors driver for ASUS motherboards to read sensors from the embedded controller. Many ASUS motherboards do not publish all the available sensors via the Super I/O chip but the missing ones are available through the embedded controller (EC) registers. This driver implements reading those sensor data via the WMI method BREC, which is known to be present in all ASUS motherboards based on the AMD 500 series chipsets (and probably is available in other models too). The driver needs to know exact register addresses for the sensors and thus support for each motherboard has to be added explicitly. The EC registers do not provide critical values for the sensors and as such they are not published to the HWMON. Supported motherboards: * PRIME X570-PRO * Pro WS X570-ACE * ROG CROSSHAIR VIII HERO * ROG CROSSHAIR VIII DARK HERO * ROG CROSSHAIR VIII FORMULA * ROG STRIX X570-E GAMING * ROG STRIX B550-I GAMING * ROG STRIX B550-E GAMING Co-developed-by: Eugene Shalygin <[email protected]> Signed-off-by: Eugene Shalygin <[email protected]> Co-developed-by: Andy Shevchenko <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Denis Pauk <[email protected]> Tested-by: Tor Vic <[email protected]> Tested-by: Oleksandr Natalenko <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (f71882fg) Add F81966 supportMenghui Wu1-0/+2
This adds hardware monitor support the Fintek F81966 Super I/O chip. Testing was done on the Aaeon SSE-IPTI Signed-off-by: Menghui Wu <[email protected]> Signed-off-by: Chia-Lin Kao (AceLan) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (adm1021) Improve detection of LM84, MAX1617, and MAX1617AGuenter Roeck1-4/+19
The adm1021 driver is quite generous with its automatic chip detection and easily misdetects several chips. Strengthen detection of MAX1617, MAX1617A, and LM84 to make the driver less vulnerable to false matches. Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (tmp401) Hide register write address differences in regmap codeGuenter Roeck1-44/+25
Since we are using regmap access functions to write into chip registers, we can hide the difference in register write addresses within regmap code. By doing this we do not need to clear the regmap cache on register writes, and the high level code does not need to bother about different read/write register addresses. Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (tmp401) Use regmapGuenter Roeck2-76/+150
Use regmap for register accesses to be able to utilize its caching functionality. This also lets us hide register access differences in regmap code. Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (tmp401) Convert to _info APIGuenter Roeck1-386/+348
The new API is cleaner and reduces code size significantly. All chip accesses are 'hidden' in chip access to prepare for using regmap. Local caching code is removed, to be replaced by regmap based caching in a follow-up patch. Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (tmp401) Simplify temperature register arraysGuenter Roeck1-28/+11
The difference between TMP431 and other chips of this series is that the TMP431 has an additional sensor. The register addresses for other sensors are the same for all chips. It is therefore unnecessary to maintain two different arrays for TMP431 and the other chips. Just use the same array for all chips and add the TMP431 register addresses as third column. Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: Driver for Texas Instruments INA238Nathan Rossi5-0/+714
The INA238 is a I2C power monitor similar to other INA2xx devices, providing shunt voltage, bus voltage, current, power and temperature measurements. Signed-off-by: Nathan Rossi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain propertyNathan Rossi1-0/+21
Add a property to the binding to define the selected shunt voltage gain. This specifies the range and accuracy that applies to the shunt circuit. This property only applies to devices that have a selectable shunt voltage range via PGA or ADCRANGE register configuration. Signed-off-by: Nathan Rossi <[email protected]> Reviewed-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible stringNathan Rossi1-0/+1
Document the compatible string for the Texas Instruments INA238, this device is a variant of the existing INA2xx devices and has the same device tree bindings (shunt resistor). Signed-off-by: Nathan Rossi <[email protected]> Acked-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (k10temp) Add support for AMD Family 19h Models 10h-1Fh and A0h-AFhBabu Moger1-0/+3
Add thermal info support for AMD Family 19h Models 10h-1Fh and A0h-AFh. Thermal info is supported via a new PCI device ID at offset 0x300h. Signed-off-by: Babu Moger <[email protected]> Link: https://lore.kernel.org/r/163640829419.955062.12539219969781039915.stgit@bmoger-ubuntu Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26hwmon: (k10temp) Remove unused definitionsBabu Moger1-20/+0
Usage of these definitions were removed after the commit 0a4e668b5d52 ("hwmon: (k10temp) Remove support for displaying voltage and current on Zen CPUs"). So, cleanup them up. Signed-off-by: Babu Moger <[email protected]> Link: https://lore.kernel.org/r/163640828776.955062.15863375803675701204.stgit@bmoger-ubuntu Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26x86/amd_nb: Add AMD Family 19h Models (10h-1Fh) and (A0h-AFh) PCI IDsYazen Ghannam2-0/+6
Add the new PCI Device IDs to support new generation of AMD 19h family of processors. Signed-off-by: Yazen Ghannam <[email protected]> Signed-off-by: Babu Moger <[email protected]> Acked-by: Krzysztof Wilczyński <[email protected]> Acked-by: Borislav Petkov <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> # pci_ids.h Link: https://lore.kernel.org/r/163640828133.955062.18349019796157170473.stgit@bmoger-ubuntu Signed-off-by: Guenter Roeck <[email protected]>
2021-12-26Linux 5.16-rc7Linus Torvalds1-1/+1
2021-12-26Merge tag 'x86_urgent_for_v5.16_rc7' of ↵Linus Torvalds2-44/+32
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - Prevent potential undefined behavior due to shifting pkey constants into the sign bit - Move the EFI memory reservation code *after* the efi= cmdline parsing has happened - Revert two commits which turned out to be the wrong direction to chase when accommodating early memblock reservations consolidation and command line parameters parsing * tag 'x86_urgent_for_v5.16_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/pkey: Fix undefined behaviour with PKRU_WD_BIT x86/boot: Move EFI range reservation after cmdline parsing Revert "x86/boot: Pull up cmdline preparation and early param parsing" Revert "x86/boot: Mark prepare_command_line() __init"
2021-12-26Merge tag 'objtool_urgent_for_v5.16_rc7' of ↵Linus Torvalds4-4/+6
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool fixes from Borislav Petkov: - Prevent clang from reordering the reachable annotation in an inline asm statement without inputs - Fix objtool builds on non-glibc systems due to undefined __always_inline * tag 'objtool_urgent_for_v5.16_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: compiler.h: Fix annotation macro misplacement with Clang uapi: Fix undefined __always_inline on non-glibc systems
2021-12-25Merge tag 'pinctrl-v5.16-3' of ↵Linus Torvalds3-19/+26
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: "Some hopefully final pin control fixes for the v5.16 kernel: - Fix an out-of-bounds bug in the Mediatek driver - Fix an init order bug in the Broadcom BCM2835 driver - Fix a GPIO offset bug in the STM32 driver" * tag 'pinctrl-v5.16-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: stm32: consider the GPIO offset to expose all the GPIO lines pinctrl: bcm2835: Change init order for gpio hogs pinctrl: mediatek: fix global-out-of-bounds issue
2021-12-25Merge tag 'hwmon-for-v5.16-rc7' of ↵Linus Torvalds1-44/+62
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: "A couple of lm90 driver fixes. None of them are critical, but they should nevertheless be fixed" * tag 'hwmon-for-v5.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (lm90) Do not report 'busy' status bit as alarm hwmom: (lm90) Fix citical alarm status for MAX6680/MAX6681 hwmon: (lm90) Drop critical attribute support for MAX6654 hwmon: (lm90) Prevent integer overflow/underflow in hysteresis calculations hwmon: (lm90) Fix usage of CONFIG2 register in detect function
2021-12-25Merge branch 'for-linus' of ↵Linus Torvalds10-37/+151
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fixes from Dmitry Torokhov: "A few small updates to drivers. Of note we are now deferring probes of i8042 on some Asus devices as the controller is not ready to respond to queries first time around when the driver is compiled into the kernel" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: elants_i2c - do not check Remark ID on eKTH3900/eKTH5312 Input: atmel_mxt_ts - fix double free in mxt_read_info_block Input: goodix - fix memory leak in goodix_firmware_upload Input: goodix - add id->model mapping for the "9111" model Input: goodix - try not to touch the reset-pin on x86/ACPI devices Input: i8042 - enable deferred probe quirk for ASUS UM325UA Input: elantech - fix stack out of bound access in elantech_change_report_id() Input: iqs626a - prohibit inlining of channel parsing functions Input: i8042 - add deferred probe support
2021-12-25Merge branch 'akpm' (patches from Andrew)Linus Torvalds8-15/+23
Merge misc fixes from Andrew Morton: "9 patches. Subsystems affected by this patch series: mm (kfence, mempolicy, memory-failure, pagemap, pagealloc, damon, and memory-failure), core-kernel, and MAINTAINERS" * emailed patches from Andrew Morton <[email protected]>: mm/hwpoison: clear MF_COUNT_INCREASED before retrying get_any_page() mm/damon/dbgfs: protect targets destructions with kdamond_lock mm/page_alloc: fix __alloc_size attribute for alloc_pages_exact_nid mm: delete unsafe BUG from page_cache_add_speculative() mm, hwpoison: fix condition in free hugetlb page path MAINTAINERS: mark more list instances as moderated kernel/crash_core: suppress unknown crashkernel parameter warning mm: mempolicy: fix THP allocations escaping mempolicy restrictions kfence: fix memory leak when cat kfence objects
2021-12-25mm/hwpoison: clear MF_COUNT_INCREASED before retrying get_any_page()Liu Shixin1-0/+1
Hulk Robot reported a panic in put_page_testzero() when testing madvise() with MADV_SOFT_OFFLINE. The BUG() is triggered when retrying get_any_page(). This is because we keep MF_COUNT_INCREASED flag in second try but the refcnt is not increased. page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0) ------------[ cut here ]------------ kernel BUG at include/linux/mm.h:737! invalid opcode: 0000 [#1] PREEMPT SMP CPU: 5 PID: 2135 Comm: sshd Tainted: G B 5.16.0-rc6-dirty #373 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 RIP: release_pages+0x53f/0x840 Call Trace: free_pages_and_swap_cache+0x64/0x80 tlb_flush_mmu+0x6f/0x220 unmap_page_range+0xe6c/0x12c0 unmap_single_vma+0x90/0x170 unmap_vmas+0xc4/0x180 exit_mmap+0xde/0x3a0 mmput+0xa3/0x250 do_exit+0x564/0x1470 do_group_exit+0x3b/0x100 __do_sys_exit_group+0x13/0x20 __x64_sys_exit_group+0x16/0x20 do_syscall_64+0x34/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae Modules linked in: ---[ end trace e99579b570fe0649 ]--- RIP: 0010:release_pages+0x53f/0x840 Link: https://lkml.kernel.org/r/[email protected] Fixes: b94e02822deb ("mm,hwpoison: try to narrow window race for free pages") Signed-off-by: Liu Shixin <[email protected]> Reported-by: Hulk Robot <[email protected]> Reviewed-by: Oscar Salvador <[email protected]> Acked-by: Naoya Horiguchi <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2021-12-25mm/damon/dbgfs: protect targets destructions with kdamond_lockSeongJae Park1-0/+2
DAMON debugfs interface iterates current monitoring targets in 'dbgfs_target_ids_read()' while holding the corresponding 'kdamond_lock'. However, it also destructs the monitoring targets in 'dbgfs_before_terminate()' without holding the lock. This can result in a use_after_free bug. This commit avoids the race by protecting the destruction with the corresponding 'kdamond_lock'. Link: https://lkml.kernel.org/r/[email protected] Reported-by: Sangwoo Bae <[email protected]> Fixes: 4bc05954d007 ("mm/damon: implement a debugfs-based user space interface") Signed-off-by: SeongJae Park <[email protected]> Cc: <[email protected]> [5.15.x] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2021-12-25mm/page_alloc: fix __alloc_size attribute for alloc_pages_exact_nidThibaut Sautereau1-1/+1
The second parameter of alloc_pages_exact_nid is the one indicating the size of memory pointed by the returned pointer. Link: https://lkml.kernel.org/r/YbjEgwhn4bGblp//@coeus Fixes: abd58f38dfb4 ("mm/page_alloc: add __alloc_size attributes for better bounds checking") Signed-off-by: Thibaut Sautereau <[email protected]> Acked-by: Kees Cook <[email protected]> Cc: Daniel Micay <[email protected]> Cc: Levente Polyak <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2021-12-25mm: delete unsafe BUG from page_cache_add_speculative()Hugh Dickins1-1/+0
It is not easily reproducible, but on 5.16-rc I have several times hit the VM_BUG_ON_PAGE(PageTail(page), page) in page_cache_add_speculative(): usually from filemap_get_read_batch() for an ext4 read, yesterday from next_uptodate_page() from filemap_map_pages() for a shmem fault. That BUG used to be placed where page_ref_add_unless() had succeeded, but now it is placed before folio_ref_add_unless() is attempted: that is not safe, since it is only the acquired reference which makes the page safe from racing THP collapse or split. We could keep the BUG, checking PageTail only when folio_ref_try_add_rcu() has succeeded; but I don't think it adds much value - just delete it. Link: https://lkml.kernel.org/r/[email protected] Fixes: 020853b6f5ea ("mm: Add folio_try_get_rcu()") Signed-off-by: Hugh Dickins <[email protected]> Acked-by: Kirill A. Shutemov <[email protected]> Reviewed-by: Matthew Wilcox (Oracle) <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: William Kucharski <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Mike Rapoport <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>