summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2023-03-05 21:52:26 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-06-21 15:39:56 +0200
commit417bd5473eb2c9671ac2465a71154871c307f552 (patch)
tree970cd71863d430ba41a4fcc7554dd2dbf0919c97
parentf86619236cf7a4cbb76a4822b99b577808255ff2 (diff)
downloadlinux-417bd5473eb2c9671ac2465a71154871c307f552.tar.gz
linux-417bd5473eb2c9671ac2465a71154871c307f552.tar.bz2
linux-417bd5473eb2c9671ac2465a71154871c307f552.zip
power: supply: Ratelimit no data debug output
[ Upstream commit 155c45a25679f571c2ae57d10db843a9dfc63430 ] Reduce the amount of output this dev_dbg() statement emits into logs, otherwise if system software polls the sysfs entry for data and keeps getting -ENODATA, it could end up filling the logs up. This does in fact make systemd journald choke, since during boot the sysfs power supply entries are polled and if journald starts at the same time, the journal is just being repeatedly filled up, and the system stops on trying to start journald without booting any further. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/power/supply/power_supply_sysfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index 5358a80d854f..7b293a50452e 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -128,7 +128,8 @@ static ssize_t power_supply_show_property(struct device *dev,
if (ret < 0) {
if (ret == -ENODATA)
- dev_dbg(dev, "driver has no data for `%s' property\n",
+ dev_dbg_ratelimited(dev,
+ "driver has no data for `%s' property\n",
attr->attr.name);
else if (ret != -ENODEV && ret != -EAGAIN)
dev_err_ratelimited(dev,