Skip to content

Commit 9d598cd

Browse files
committed
Merge series "Extend regulator notification support" from Matti Vaittinen <[email protected]>:
Extend regulator notification support This series extends the regulator notification and error flag support. Initial discussion on the topic can be found here: https://lore.kernel.org/lkml/[email protected]/ In a nutshell - the series adds: 1. WARNING level events/error flags. (Patch 3) Current regulator 'ERROR' event notifications for over/under voltage, over current and over temperature are used to indicate condition where monitored entity is so badly "off" that it actually indicates a hardware error which can not be recovered. The most typical hanling for that is believed to be a (graceful) system-shutdown. Here we add set of 'WARNING' level flags to allow sending notifications to consumers before things are 'that badly off' so that consumer drivers can implement recovery-actions. 2. Device-tree properties for specifying limit values. (Patches 1, 5) Add limits for above mentioned 'ERROR' and 'WARNING' levels (which send notifications to consumers) and also for a 'PROTECTION' level (which will be used to immediately shut-down the regulator(s) W/O informing consumer drivers. Typically implemented by hardware). Property parsing is implemented in regulator core which then calls callback operations for limit setting from the IC drivers. A warning is emitted if protection is requested by device tree but the underlying IC does not support configuring requested protection. 3. Helpers which can be registered by IC. (Patch 4) Target is to avoid implementing IRQ handling and IRQ storm protection in each IC driver. (Many of the ICs implementin these IRQs do not allow masking or acking the IRQ but keep the IRQ asserted for the whole duration of problem keeping the processor in IRQ handling loop). 4. Emergency poweroff function (refactored out of the thermal_core to kernel/reboot.c) which is called if IC fires error IRQs but IC reading fails and given retry-count is exceeded. (Patches 2, 4) Please note that the mutex in the emergency shutdown was replaced by a simple atomic in order to allow call from any context. The helper was attempted to be done so it could be used to implement roughly same logic as is used in qcom-labibb regulator. This means amongst other things a safety shut-down if IC registers are not readable. Using these shut-down retry counters are optional. The idea is that the helper could be also used by simpler ICs which do not provide status register(s) which can be used to check if error is still active. ICs which do not have such status register can simply omit the 'renable' callback (and retry-counts etc) - and helper assumes the situation is Ok and re-enables IRQ after given time period. If problem persists the handler is ran again and another notification is sent - but at least the delay allows processor to avoid IRQ loop. Patch 7 takes this notification support in use at BD9576MUF. Patch 8 is related to MFD change which is not really related to the RFC here. It was added to this series in order to avoid potential conflicts. Patch 9 adds a maintainers entry. Changelog v10-RESEND: - rebased on v5.13-rc4 Changelog v10: - rebased on v5.13-rc2 - Move rdev_*() print macros to the internal.h and use rdev_dbg() from irq_helpers.c - Export rdev_get_name() and move it from coupler.h to driver.h for others to use. (It was already in coupler.h but not exported - usage was limited and coupler.h does not sound like optimal place as rdev_name is not only used by coupled regulators) - Send all regulator notifications from irq_helpers.c at one OR'd event for the sake of simplicity. For BD9576 this does not matter as it has own IRQ for each event case. Header defining events says they may be OR'd. - Change WARN() at protection shutdown to pr_emerg as suggested by Petr. Changelog v9: - rebases on v5.13-rc1 - Update thermal documentation - Fix regulator notification event number Changelog v8: - split shutdown API adding and thermal core taking it in use to own patches. - replace the spinlock with atomic when ensuring the emergency shutdown is only called once. Changelog v7: general: - rebased on v5.12-rc7 - new patch for refactoring the hw-failure reboot logic out of thermal_core.c for others to use. notification helpers: - fix regulator error_flags query - grammar/typos - do not BUG() but attempt to shut-down the system - use BITS_PER_TYPE() Changelog v6: Add MAINTAINERS entry Changes to IRQ notifiers - move devm functions to drivers/regulator/devres.c - drop irq validity check - use devm_add_action_or_reset() - fix styling issues - fix kerneldocs Changelog v5: - Fix the badly formatted pr_emerg() call. Changelog v4: - rebased on v5.12-rc6 - dropped RFC - fix external FET DT-binding. - improve prints for cases when expecting HW failure. - styling and typos Changelog v3: Regulator core: - Fix dangling pointer access at regulator_irq_helper() stpmic1_regulator: - fix function prototype (compile error) bd9576-regulator: - Update over current limits to what was given in new data-sheet (REV00K) - Allow over-current monitoring without external FET. Set limits to values given in data-sheet (REV00K). Changelog v2: Generic: - rebase on v5.12-rc2 + BD9576 series - Split devm variant of delayed wq to own series Regulator framework: - Provide non devm variant of IRQ notification helpers - shorten dt-property names as suggested by Rob - unconditionally call map_event in IRQ handling and require it to be populated BD9576 regulators: - change the FET resistance property to micro-ohms - fix voltage computation in OC limit setting
2 parents 57c045b + d55444a commit 9d598cd

File tree

1,070 files changed

+13843
-5883
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,070 files changed

+13843
-5883
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ Jeff Layton <[email protected]> <[email protected]>
160160
161161
Jens Axboe <[email protected]>
162162
Jens Osterkamp <[email protected]>
163+
163164
164165
165166

Documentation/ABI/obsolete/sysfs-class-dax

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
What: /sys/class/dax/
22
Date: May, 2016
33
KernelVersion: v4.7
4-
Contact: linux-nvdimm@lists.01.org
4+
Contact: nvdimm@lists.linux.dev
55
Description: Device DAX is the device-centric analogue of Filesystem
66
DAX (CONFIG_FS_DAX). It allows memory ranges to be
77
allocated and mapped without need of an intervening file

Documentation/ABI/obsolete/sysfs-kernel-fadump_registered

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This ABI is renamed and moved to a new location /sys/kernel/fadump/registered.¬
1+
This ABI is renamed and moved to a new location /sys/kernel/fadump/registered.
22

33
What: /sys/kernel/fadump_registered
44
Date: Feb 2012

Documentation/ABI/obsolete/sysfs-kernel-fadump_release_mem

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This ABI is renamed and moved to a new location /sys/kernel/fadump/release_mem.¬
1+
This ABI is renamed and moved to a new location /sys/kernel/fadump/release_mem.
22

33
What: /sys/kernel/fadump_release_mem
44
Date: Feb 2012

Documentation/ABI/removed/sysfs-bus-nfit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
What: /sys/bus/nd/devices/regionX/nfit/ecc_unit_size
22
Date: Aug, 2017
33
KernelVersion: v4.14 (Removed v4.18)
4-
Contact: linux-nvdimm@lists.01.org
4+
Contact: nvdimm@lists.linux.dev
55
Description:
66
(RO) Size of a write request to a DIMM that will not incur a
77
read-modify-write cycle at the memory controller.

Documentation/ABI/testing/sysfs-bus-nfit

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Interface Table (NFIT)' section in the ACPI specification
55
What: /sys/bus/nd/devices/nmemX/nfit/serial
66
Date: Jun, 2015
77
KernelVersion: v4.2
8-
Contact: linux-nvdimm@lists.01.org
8+
Contact: nvdimm@lists.linux.dev
99
Description:
1010
(RO) Serial number of the NVDIMM (non-volatile dual in-line
1111
memory module), assigned by the module vendor.
@@ -14,7 +14,7 @@ Description:
1414
What: /sys/bus/nd/devices/nmemX/nfit/handle
1515
Date: Apr, 2015
1616
KernelVersion: v4.2
17-
Contact: linux-nvdimm@lists.01.org
17+
Contact: nvdimm@lists.linux.dev
1818
Description:
1919
(RO) The address (given by the _ADR object) of the device on its
2020
parent bus of the NVDIMM device containing the NVDIMM region.
@@ -23,23 +23,23 @@ Description:
2323
What: /sys/bus/nd/devices/nmemX/nfit/device
2424
Date: Apr, 2015
2525
KernelVersion: v4.1
26-
Contact: linux-nvdimm@lists.01.org
26+
Contact: nvdimm@lists.linux.dev
2727
Description:
2828
(RO) Device id for the NVDIMM, assigned by the module vendor.
2929

3030

3131
What: /sys/bus/nd/devices/nmemX/nfit/rev_id
3232
Date: Jun, 2015
3333
KernelVersion: v4.2
34-
Contact: linux-nvdimm@lists.01.org
34+
Contact: nvdimm@lists.linux.dev
3535
Description:
3636
(RO) Revision of the NVDIMM, assigned by the module vendor.
3737

3838

3939
What: /sys/bus/nd/devices/nmemX/nfit/phys_id
4040
Date: Apr, 2015
4141
KernelVersion: v4.2
42-
Contact: linux-nvdimm@lists.01.org
42+
Contact: nvdimm@lists.linux.dev
4343
Description:
4444
(RO) Handle (i.e., instance number) for the SMBIOS (system
4545
management BIOS) Memory Device structure describing the NVDIMM
@@ -49,7 +49,7 @@ Description:
4949
What: /sys/bus/nd/devices/nmemX/nfit/flags
5050
Date: Jun, 2015
5151
KernelVersion: v4.2
52-
Contact: linux-nvdimm@lists.01.org
52+
Contact: nvdimm@lists.linux.dev
5353
Description:
5454
(RO) The flags in the NFIT memory device sub-structure indicate
5555
the state of the data on the nvdimm relative to its energy
@@ -68,7 +68,7 @@ What: /sys/bus/nd/devices/nmemX/nfit/format1
6868
What: /sys/bus/nd/devices/nmemX/nfit/formats
6969
Date: Apr, 2016
7070
KernelVersion: v4.7
71-
Contact: linux-nvdimm@lists.01.org
71+
Contact: nvdimm@lists.linux.dev
7272
Description:
7373
(RO) The interface codes indicate support for persistent memory
7474
mapped directly into system physical address space and / or a
@@ -84,15 +84,15 @@ Description:
8484
What: /sys/bus/nd/devices/nmemX/nfit/vendor
8585
Date: Apr, 2016
8686
KernelVersion: v4.7
87-
Contact: linux-nvdimm@lists.01.org
87+
Contact: nvdimm@lists.linux.dev
8888
Description:
8989
(RO) Vendor id of the NVDIMM.
9090

9191

9292
What: /sys/bus/nd/devices/nmemX/nfit/dsm_mask
9393
Date: May, 2016
9494
KernelVersion: v4.7
95-
Contact: linux-nvdimm@lists.01.org
95+
Contact: nvdimm@lists.linux.dev
9696
Description:
9797
(RO) The bitmask indicates the supported device specific control
9898
functions relative to the NVDIMM command family supported by the
@@ -102,7 +102,7 @@ Description:
102102
What: /sys/bus/nd/devices/nmemX/nfit/family
103103
Date: Apr, 2016
104104
KernelVersion: v4.7
105-
Contact: linux-nvdimm@lists.01.org
105+
Contact: nvdimm@lists.linux.dev
106106
Description:
107107
(RO) Displays the NVDIMM family command sets. Values
108108
0, 1, 2 and 3 correspond to NVDIMM_FAMILY_INTEL,
@@ -118,7 +118,7 @@ Description:
118118
What: /sys/bus/nd/devices/nmemX/nfit/id
119119
Date: Apr, 2016
120120
KernelVersion: v4.7
121-
Contact: linux-nvdimm@lists.01.org
121+
Contact: nvdimm@lists.linux.dev
122122
Description:
123123
(RO) ACPI specification 6.2 section 5.2.25.9, defines an
124124
identifier for an NVDIMM, which refelects the id attribute.
@@ -127,7 +127,7 @@ Description:
127127
What: /sys/bus/nd/devices/nmemX/nfit/subsystem_vendor
128128
Date: Apr, 2016
129129
KernelVersion: v4.7
130-
Contact: linux-nvdimm@lists.01.org
130+
Contact: nvdimm@lists.linux.dev
131131
Description:
132132
(RO) Sub-system vendor id of the NVDIMM non-volatile memory
133133
subsystem controller.
@@ -136,7 +136,7 @@ Description:
136136
What: /sys/bus/nd/devices/nmemX/nfit/subsystem_rev_id
137137
Date: Apr, 2016
138138
KernelVersion: v4.7
139-
Contact: linux-nvdimm@lists.01.org
139+
Contact: nvdimm@lists.linux.dev
140140
Description:
141141
(RO) Sub-system revision id of the NVDIMM non-volatile memory subsystem
142142
controller, assigned by the non-volatile memory subsystem
@@ -146,7 +146,7 @@ Description:
146146
What: /sys/bus/nd/devices/nmemX/nfit/subsystem_device
147147
Date: Apr, 2016
148148
KernelVersion: v4.7
149-
Contact: linux-nvdimm@lists.01.org
149+
Contact: nvdimm@lists.linux.dev
150150
Description:
151151
(RO) Sub-system device id for the NVDIMM non-volatile memory
152152
subsystem controller, assigned by the non-volatile memory
@@ -156,15 +156,15 @@ Description:
156156
What: /sys/bus/nd/devices/ndbusX/nfit/revision
157157
Date: Jun, 2015
158158
KernelVersion: v4.2
159-
Contact: linux-nvdimm@lists.01.org
159+
Contact: nvdimm@lists.linux.dev
160160
Description:
161161
(RO) ACPI NFIT table revision number.
162162

163163

164164
What: /sys/bus/nd/devices/ndbusX/nfit/scrub
165165
Date: Sep, 2016
166166
KernelVersion: v4.9
167-
Contact: linux-nvdimm@lists.01.org
167+
Contact: nvdimm@lists.linux.dev
168168
Description:
169169
(RW) This shows the number of full Address Range Scrubs (ARS)
170170
that have been completed since driver load time. Userspace can
@@ -177,7 +177,7 @@ Description:
177177
What: /sys/bus/nd/devices/ndbusX/nfit/hw_error_scrub
178178
Date: Sep, 2016
179179
KernelVersion: v4.9
180-
Contact: linux-nvdimm@lists.01.org
180+
Contact: nvdimm@lists.linux.dev
181181
Description:
182182
(RW) Provides a way to toggle the behavior between just adding
183183
the address (cache line) where the MCE happened to the poison
@@ -196,7 +196,7 @@ Description:
196196
What: /sys/bus/nd/devices/ndbusX/nfit/dsm_mask
197197
Date: Jun, 2017
198198
KernelVersion: v4.13
199-
Contact: linux-nvdimm@lists.01.org
199+
Contact: nvdimm@lists.linux.dev
200200
Description:
201201
(RO) The bitmask indicates the supported bus specific control
202202
functions. See the section named 'NVDIMM Root Device _DSMs' in
@@ -205,7 +205,7 @@ Description:
205205
What: /sys/bus/nd/devices/ndbusX/nfit/firmware_activate_noidle
206206
Date: Apr, 2020
207207
KernelVersion: v5.8
208-
Contact: linux-nvdimm@lists.01.org
208+
Contact: nvdimm@lists.linux.dev
209209
Description:
210210
(RW) The Intel platform implementation of firmware activate
211211
support exposes an option let the platform force idle devices in
@@ -225,7 +225,7 @@ Description:
225225
What: /sys/bus/nd/devices/regionX/nfit/range_index
226226
Date: Jun, 2015
227227
KernelVersion: v4.2
228-
Contact: linux-nvdimm@lists.01.org
228+
Contact: nvdimm@lists.linux.dev
229229
Description:
230230
(RO) A unique number provided by the BIOS to identify an address
231231
range. Used by NVDIMM Region Mapping Structure to uniquely refer

Documentation/ABI/testing/sysfs-bus-papr-pmem

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
What: /sys/bus/nd/devices/nmemX/papr/flags
22
Date: Apr, 2020
33
KernelVersion: v5.8
4-
Contact: linuxppc-dev <[email protected]>, linux-nvdimm@lists.01.org,
4+
Contact: linuxppc-dev <[email protected]>, nvdimm@lists.linux.dev,
55
Description:
66
(RO) Report flags indicating various states of a
77
papr-pmem NVDIMM device. Each flag maps to a one or
@@ -36,7 +36,7 @@ Description:
3636
What: /sys/bus/nd/devices/nmemX/papr/perf_stats
3737
Date: May, 2020
3838
KernelVersion: v5.9
39-
Contact: linuxppc-dev <[email protected]>, linux-nvdimm@lists.01.org,
39+
Contact: linuxppc-dev <[email protected]>, nvdimm@lists.linux.dev,
4040
Description:
4141
(RO) Report various performance stats related to papr-scm NVDIMM
4242
device. Each stat is reported on a new line with each line

Documentation/ABI/testing/sysfs-module

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ Description: Maximum time allowed for periodic transfers per microframe (μs)
3737

3838
What: /sys/module/*/{coresize,initsize}
3939
Date: Jan 2012
40-
KernelVersion:»·3.3
40+
KernelVersion: 3.3
4141
Contact: Kay Sievers <[email protected]>
4242
Description: Module size in bytes.
4343

4444
What: /sys/module/*/taint
4545
Date: Jan 2012
46-
KernelVersion:»·3.3
46+
KernelVersion: 3.3
4747
Contact: Kay Sievers <[email protected]>
4848
Description: Module taint flags:
4949
== =====================

Documentation/admin-guide/sysctl/kernel.rst

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,11 @@ modprobe
483483
========
484484

485485
The full path to the usermode helper for autoloading kernel modules,
486-
by default "/sbin/modprobe". This binary is executed when the kernel
487-
requests a module. For example, if userspace passes an unknown
488-
filesystem type to mount(), then the kernel will automatically request
489-
the corresponding filesystem module by executing this usermode helper.
486+
by default ``CONFIG_MODPROBE_PATH``, which in turn defaults to
487+
"/sbin/modprobe". This binary is executed when the kernel requests a
488+
module. For example, if userspace passes an unknown filesystem type
489+
to mount(), then the kernel will automatically request the
490+
corresponding filesystem module by executing this usermode helper.
490491
This usermode helper should insert the needed module into the kernel.
491492

492493
This sysctl only affects module autoloading. It has no effect on the
@@ -1457,11 +1458,22 @@ unprivileged_bpf_disabled
14571458
=========================
14581459

14591460
Writing 1 to this entry will disable unprivileged calls to ``bpf()``;
1460-
once disabled, calling ``bpf()`` without ``CAP_SYS_ADMIN`` will return
1461-
``-EPERM``.
1461+
once disabled, calling ``bpf()`` without ``CAP_SYS_ADMIN`` or ``CAP_BPF``
1462+
will return ``-EPERM``. Once set to 1, this can't be cleared from the
1463+
running kernel anymore.
14621464

1463-
Once set, this can't be cleared.
1465+
Writing 2 to this entry will also disable unprivileged calls to ``bpf()``,
1466+
however, an admin can still change this setting later on, if needed, by
1467+
writing 0 or 1 to this entry.
14641468

1469+
If ``BPF_UNPRIV_DEFAULT_OFF`` is enabled in the kernel config, then this
1470+
entry will default to 2 instead of 0.
1471+
1472+
= =============================================================
1473+
0 Unprivileged calls to ``bpf()`` are enabled
1474+
1 Unprivileged calls to ``bpf()`` are disabled without recovery
1475+
2 Unprivileged calls to ``bpf()`` are disabled
1476+
= =============================================================
14651477

14661478
watchdog
14671479
========

Documentation/block/data-integrity.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
==============
1+
==============
22
Data Integrity
33
==============
44

0 commit comments

Comments
 (0)