From patchwork Sun Mar 5 20:52:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 660927 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 710C4C6FA8E for ; Sun, 5 Mar 2023 20:52:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229510AbjCEUwk (ORCPT ); Sun, 5 Mar 2023 15:52:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbjCEUwk (ORCPT ); Sun, 5 Mar 2023 15:52:40 -0500 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58461D32F for ; Sun, 5 Mar 2023 12:52:39 -0800 (PST) Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id C299C85A97; Sun, 5 Mar 2023 21:52:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1678049558; bh=kiPYzVmvGhd8fwFBZqGwpnbm3uifrIw+iYtUoTl143U=; h=From:To:Cc:Subject:Date:From; b=sJWEG65YzuEgvAUJoF21ISu3HtbGBjT68W7EjxKad5sKrnE92I3uDBTc81OOI2zYc a0VZGZquhBLGZ5XQJAaWWZ6+AhWcR0aIeBt1HpYotVZvb9s2Ro1uh/vTIc0kN56W5a 7GdqReqb6CO2GME5qyzPu78CUk5SHvQuEuWjxHU0ylDRLyozgijrqfNKWlTwYHElHC Py55rFCffpKlfaa/6jiVeApB4bo7PJBgA5Py2I0YLupv5qd4ZLhLIN1LzYFhg2CZh+ LhJl07OnHYMYteHPRrwryJLIIQ7Pfyzg1Dd7BjNKuPLk2AfTQaAwqCB7L2ALP3zdM/ EIayroyRqo2mg== From: Marek Vasut To: linux-pm@vger.kernel.org Cc: Marek Vasut , Hans de Goede , Sebastian Reichel Subject: [PATCH] power: supply: Ratelimit no data debug output Date: Sun, 5 Mar 2023 21:52:26 +0100 Message-Id: <20230305205226.773025-1-marex@denx.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 --- Cc: Hans de Goede Cc: Sebastian Reichel Cc: linux-pm@vger.kernel.org --- drivers/power/supply/power_supply_sysfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index c228205e09538..4bbb3053eef44 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -285,7 +285,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,