| Age | Commit message (Collapse) | Author | Files | Lines |
|
Commit b50db7095fe0 ("x86/tsc: Disable clocksource watchdog for TSC on
qualified platorms") was introduced to solve problem that sometimes TSC
clocksource is wrongly judged as unstable by watchdog like 'jiffies', HPET,
etc.
In it, the hardware package number is a key factor for judging whether to
disable the watchdog for TSC, and 'nr_online_nodes' was chosen due to, at
that time (kernel v5.1x), it is available in early boot phase before
registering 'tsc-early' clocksource, where all non-boot CPUs are not
brought up yet.
Dave and Rui pointed out there are many cases in which 'nr_online_nodes'
is cheated and not accurate, like:
* SNC (sub-numa cluster) mode enabled
* numa emulation (numa=fake=8 etc.)
* numa=off
* platforms with CPU-less HBM nodes, CPU-less Optane memory nodes.
* 'maxcpus=' cmdline setup, where chopped CPUs could be onlined later
* 'nr_cpus=', 'possible_cpus=' cmdline setup, where chopped CPUs can
not be onlined after boot
The SNC case is the most user-visible case, as many CSP (Cloud Service
Provider) enable this feature in their server fleets. When SNC3 enabled, a
2 socket machine will appear to have 6 NUMA nodes, and get impacted by the
issue in reality.
Thomas' recent patchset of refactoring x86 topology code improves
topology_max_packages() greatly, by making it more accurate and available
in early boot phase, which works well in most of the above cases.
The only exceptions are 'nr_cpus=' and 'possible_cpus=' setup, which may
under-estimate the package number. As during topology setup, the boot CPU
iterates through all enumerated APIC IDs and either accepts or rejects the
APIC ID. For accepted IDs, it figures out which bits of the ID map to the
package number. It tracks which package numbers have been seen in a
bitmap. topology_max_packages() just returns the number of bits set in
that bitmap.
'nr_cpus=' and 'possible_cpus=' can cause more APIC IDs to be rejected and
can artificially lower the number of bits in the package bitmap and thus
topology_max_packages(). This means that, for example, a system with 8
physical packages might reject all the CPUs on 6 of those packages and be
left with only 2 packages and 2 bits set in the package bitmap. It needs
the TSC watchdog, but would disable it anyway. This isn't ideal, but it
only happens for debug-oriented options. This is fixable by tracking the
package numbers for rejected CPUs. But it's not worth the trouble for
debugging.
So use topology_max_packages() to replace nr_online_nodes().
Reported-by: Dave Hansen <[email protected]>
Signed-off-by: Feng Tang <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Waiman Long <[email protected]>
Link: https://lore.kernel.org/all/[email protected]
Closes: https://lore.kernel.org/lkml/[email protected]/
|
|
Allow userspace to use damage clips with atomic async flips. Damage
clips are useful for partial plane updates, which can be helpful for
clients that want to do flips asynchronously.
Fixes: 0e26cc72c71c ("drm: Refuse to async flip with atomic prop changes")
Signed-off-by: André Almeida <[email protected]>
Reviewed-by: Simon Ser <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
Allow userspace to use explicit synchronization with atomic async flips.
That means that the flip will wait for some hardware fence, and then
will flip as soon as possible (async) in regard of the vblank.
Fixes: 0e26cc72c71c ("drm: Refuse to async flip with atomic prop changes")
Signed-off-by: André Almeida <[email protected]>
Reviewed-by: Simon Ser <[email protected]>
Signed-off-by: Simon Ser <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
To be consistent with most LSM hooks, convert the return value of
hook inode_copy_up_xattr to 0 or a negative error code.
Before:
- Hook inode_copy_up_xattr returns 0 when accepting xattr, 1 when
discarding xattr, -EOPNOTSUPP if it does not know xattr, or any
other negative error code otherwise.
After:
- Hook inode_copy_up_xattr returns 0 when accepting xattr, *-ECANCELED*
when discarding xattr, -EOPNOTSUPP if it does not know xattr, or
any other negative error code otherwise.
Signed-off-by: Xu Kuohai <[email protected]>
Reviewed-by: Casey Schaufler <[email protected]>
Signed-off-by: Paul Moore <[email protected]>
|
|
To be consistent with most LSM hooks, convert the return value of
hook vm_enough_memory to 0 or a negative error code.
Before:
- Hook vm_enough_memory returns 1 if permission is granted, 0 if not.
- LSM_RET_DEFAULT(vm_enough_memory_mm) is 1.
After:
- Hook vm_enough_memory reutrns 0 if permission is granted, negative
error code if not.
- LSM_RET_DEFAULT(vm_enough_memory_mm) is 0.
Signed-off-by: Xu Kuohai <[email protected]>
Reviewed-by: Casey Schaufler <[email protected]>
Signed-off-by: Paul Moore <[email protected]>
|
|
We already have some testcases verifying that we can call
BPF_PROG_TYPE_SYSCALL progs and invoke scx_bpf_exit(). Let's extend that to
also call scx_bpf_create_dsq() so we get coverage for that as well.
Signed-off-by: David Vernet <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
|
|
We currently only allow calling sleepable scx kfuncs (i.e.
scx_bpf_create_dsq()) from BPF_PROG_TYPE_STRUCT_OPS progs. The idea here
was that we'd never have to call scx_bpf_create_dsq() outside of a
sched_ext struct_ops callback, but that might not actually be true. For
example, a scheduler could do something like the following:
1. Open and load (not yet attach) a scheduler skel
2. Synchronously call into a BPF_PROG_TYPE_SYSCALL prog from user space.
For example, to initialize an LLC domain, or some other global,
read-only state.
3. Attach the skel, which actually enables the scheduler
The advantage of doing this is that it can preclude having to do pretty
ugly boilerplate like initializing a read-only, statically sized array of
u64[]'s which the kernel consumes literally once at init time to then
create struct bpf_cpumask objects which are actually queried at runtime.
Doing the above is already possible given that we can invoke core BPF
kfuncs, such as bpf_cpumask_create(), from BPF_PROG_TYPE_SYSCALL progs. We
already allow many scx kfuncs to be called from BPF_PROG_TYPE_SYSCALL progs
(e.g. scx_bpf_kick_cpu()). Let's allow the sleepable kfuncs as well.
Signed-off-by: David Vernet <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
|
|
Bail out immediately if reading any of the registers used for chip
detection fails, or if it returns an unexpected value. Drop all log
messages from detection code.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
The chip supports reading and writing the conversion rate.
Add support for the update_interval sysfs attribute.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Convert driver to with_info hwmon API to simplify the code and
with it its maintainability.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use regmap for local caching, to hide register read/write address
differences, and for multi-byte operations. With this change,
the driver specific lock is no longer necessary.
While at it, check errors seen when initializing the chip and bail out
if chip initialization fails.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Bit 0, 5, and 6 in the status register are reserved and, if set, do not
indicate an alarm. Bit 7 is the 'busy' bit and also does not indicate
an alarm. Mask the non-alarm bits to avoid reporting them to userspace.
Cc: Tzung-Bi Shih <[email protected]>
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Simplify maintenance by reordering include files to alphabetic order.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Module test code reports underflows when writing sensor limits.
temp2_min: Suspected underflow: [min=-77000, read 101000, written -2147483648]
temp2_max: Suspected underflow: [min=-77000, read 101000, written -2147483648]
temp2_crit: Suspected underflow: [min=-77000, read 101000, written -2147483648]
Clamp temperature ranges when writing limits to fix the problem.
While at it, use sign_extend32() when reading temperatures to make
the code easier to understand.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
In the MAX6581 datasheet Revision 0 to 3, the local channel overtemperature
status is reported in bit 6 of register 0x45, and the overtemperature
status for remote channel 7 is reported in bit 7. In Revision 4 and later,
the local channel overtemperature status is reported in bit 7, and the
remote channel 7 overtemperature status is reported in bit 6. A real
chip was found to match the functionality documented in Revision 4 and
later.
The code was fixed with commit 1ea3fd1eb986 ("hwmon: (max6697) Fix swapped
temp{1,8} critical alarms"). At that time it looked like this was an
original bug. It only turned out later that the problem was the result of
incorrect information in the chip datasheet.
Document the discrepancy to avoid confusion caused by old versions of the
datasheet.
Cc: Tzung-Bi Shih <[email protected]>
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Convert to use with_info API to simplify the code and to reduce its size.
This patch reduces object file size by approximately 25%.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
The only difference between supported chips is the number of channels.
Drop enum chips and list the number of channels in struct i2c_device_id
directly.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use regmap for caching to simplify the code and to hide read/write
register address differences.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use bit macro to make the code easier to understand and reduce duplication.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Reorder include files to alphabetic order to simplify driver maintenance.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
RMP -> RPM
Signed-off-by: Cryolitia PukNgae <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use the device property APIs so the driver does not depend on OF to
work.
While at it, properly include mod_devicetable for struct of_device_id
and fix some parameter alignment in the changed places.
Signed-off-by: Nuno Sa <[email protected]>
Link: https://lore.kernel.org/r/20240726-dev-hwmon-ltc6947-fw-agnostic-v1-1-f7d6cab7d438@analog.com
Signed-off-by: Guenter Roeck <[email protected]>
|
|
By default the PWM duty cycle in hardware is 100%. On some systems this
can cause unwanted fan noise. Add the ability to specify the fan
connections and initial state of the PWMs via device properties.
Signed-off-by: Chris Packham <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[groeck: Cleaned up formatting]
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Now that we have fan child nodes that can specify flags for the PWM
outputs we no longer need the adi,pwm-active-state property.
Signed-off-by: Chris Packham <[email protected]>
Acked-by: Rob Herring (Arm) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Add fan child nodes that allow describing the connections for the
ADT7475 to the fans it controls. This also allows setting some
initial values for the pwm duty cycle and frequency.
Signed-off-by: Chris Packham <[email protected]>
Reviewed-by: Rob Herring (Arm) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
|
|
MAX6581 supports setting the minimum temperature as well as minimum
temperature alarms. Add support for it.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Convert to with_info hwmon API to simplify the code and reduce its size.
This patch reduces object file size by approximately 25%.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use regmap for register caching, and use regmap API for bit operations
to simplify the code.
This patch reduces object file size by approximately 10%.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use bit operations to improve code maintainability.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Platform data is not used anywhere in the upstram kernel.
Drop support for it to simplify code maintenance.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Reorder include files to alphabetic order to improve maintainability.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Chips reporting overcurrent alarms report it in the second alarm register.
That means the second alarm register has to be read, even if the chip only
supports 8 or fewer ADC channels.
MAX16067 and MAX16068 report undervoltage and overvoltage alarms in
separate registers. Fold register contents together to report both with
the existing alarm attribute. This requires actually storing the chip type
in struct max16065_data. Rename the variable 'chip' to match the variable
name used in the probe function.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Fixes: f5bae2642e3d ("hwmon: Driver for MAX16065 System Manager and compatibles")
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Writing large limits resulted in overflows as reported by module tests.
in0_lcrit: Suspected overflow: [max=5538, read 0, written 2147483647]
in0_crit: Suspected overflow: [max=5538, read 0, written 2147483647]
in0_min: Suspected overflow: [max=5538, read 0, written 2147483647]
Fix the problem by clamping prior to multiplications and the use of
DIV_ROUND_CLOSEST, and by using consistent variable types.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Fixes: f5bae2642e3d ("hwmon: Driver for MAX16065 System Manager and compatibles")
Signed-off-by: Guenter Roeck <[email protected]>
|
|
The iterated nodes are direct children of the device node, and the
`device_for_each_child_node()` macro accounts for child node
availability.
`fwnode_for_each_available_child_node()` is meant to access the child
nodes of an fwnode, and therefore not direct child nodes of the device
node.
In this case, the child nodes are not required outside the loop, and
the scoped version of the macro can be used to remove the repetitive
`goto put` pattern.
Use `device_for_each_child_node_scoped_scoped()` to indicate device's
direct child nodes.
Reviewed-by: Jonathan Cameron <[email protected]>
Signed-off-by: Javier Carrasco <[email protected]>
Link: https://lore.kernel.org/r/20240721-device_for_each_child_node-available-v2-2-f33748fd8b2d@gmail.com
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Add the Dell Latitude 7320 to the fan control whitelist to allow
for manual fan control.
Closes: https://github.com/Wer-Wolf/i8kutils/issues/8
Signed-off-by: Armin Wolf <[email protected]>
Acked-by: Pali Rohár <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use multi-byte regmap operations to simplify the code
and to reduce dependency on locking.
No functional change.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
LM95233/LM95234 support enabling temperature channels one by one.
Add support for tempX_enable attribute to be able to use that
functionality.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Convert to with_info API to simplify the code and reduce its size.
This patch reduces the object file size by about 30%.
No functional change.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use regmap to replace local caching and to be able to use regmap API
functions.
No functional change.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use find_closest() instead of manually coding it to find best update
interval.
Since find_closest() uses rounding to find the best match, the resulting
update interval will now reflect the update interval that is closest to
the requested value, not the value that is lower or equal to the requested
value.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Alphabetic include file order simplifies maintenance and makes it easier
to add or remove files.
No functional change.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use multi-byte regmap operations where possible to reduce code size.
No functional changes.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use multi-byte regmap operations where possible to reduce code size
and the need for mutex protection.
No functional changes.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use multi-byte regmap operations where possible to reduce code size
and the need for mutex protection.
No functional changes.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use multi-byte regmap operations where possible to reduce code size
and the need for mutex protection.
No functional changes.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use multi-byte regmap operations where possible to reduce code size
and the need for mutex protection.
No functional changes.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use multi-byte regmap operations where possible to reduce code size
and the need for mutex protection.
No functional change.
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use multi-byte regmap operations where possible to reduce code size
and the need for mutex protection.
No functional change.
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Use multi-byte regmap operations where possible to reduce code size
and the need for mutex protection.
No functional change.
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Add RTC wakeup alarm for devices to resume after specific time interval.
This improvement in the test will help in enabling this test
in the CI systems and will eliminate the need of manual intervention
for resuming back the devices after suspend/hibernation.
Signed-off-by: Shreeya Patel <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
|