summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc
diff options
context:
space:
mode:
authorRobert Killick <robert@killick.dev>2026-10-05 14:56:45 +0100
committerSebastian Reichel <sebastian.reichel@collabora.com>2026-10-17 23:30:06 +0200
commit4d49915df53ddde71556e507bdc49b81cd4609c8 (patch)
tree2c2b030c966a905bfdbd1a427fa3940c106fe779 /rust/kernel/alloc
parent1f2a40f954c848dff9d8bb6d81e404f9e47f0e81 (diff)
power: supply: sysfs: Ratelimit "unavailable enum value" warning
power_supply_show_enum_with_available() warns every time a driver reports a value that is not in its declared set of available values. For usb_type this happens on every sysfs read and on every uevent, so a driver that reports such a value and calls power_supply_changed() frequently can flood the kernel log. This can happen with drivers that pass a firmware-provided value through unchanged, as qcom_battmgr does for usb_type. On a OnePlus 10 Pro (SM8450), whose firmware reports a vendor-specific usb_type, this produced ~128 warnings per second and kept systemd-journald at ~30% CPU. The bug that causes the bad value needs fixing in the driver itself, but one misbehaving driver should not be able to flood the kernel log. Use dev_warn_ratelimited(), as power_supply_show_property() already does for its own errors, so the problem is still reported, just not on every read. Signed-off-by: Robert Killick <robert@killick.dev> Link: https://patch.msgid.link/20261005-ratelimit-enum-warn-v1-1-b77b48de3c47@killick.dev Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'rust/kernel/alloc')
0 files changed, 0 insertions, 0 deletions