Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2187545ybm; Thu, 23 May 2019 12:48:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBFvZtVpFVPV7Iu4lBWQFjzIf4YSrpyWYrl1nXCJSOBDPkzMkUSpAlw4crhzTwFTI2pIYk X-Received: by 2002:a65:6681:: with SMTP id b1mr25028911pgw.301.1558640914207; Thu, 23 May 2019 12:48:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558640914; cv=none; d=google.com; s=arc-20160816; b=qbkcS3eGSlSaHOYRnr3eAZG0Ik/3hLn7974u6ZoyB8/CPBPIClHXW9Zx57EsKg8C/J nWenI7cIfVCJX9FwckZXAPYOMTMMPKGscrbndC8ygi3pXSzFMZz4o08OsUWLmFqTUkZy K6u/Lu6yAx1Z1ZQ0wVfKNc4x8iTpV+LoyVBtTbgcsFHOoGMWZ6hfPkjKS5c/1En66o08 fJO1Y954R4fX7bRrEijFxzRIRpKI48p0ZRbJV5rjf1byJVDaUfAvdmMsQ1LeL3jwl+pR qA0MvSmHsLHv4q2pHMHsylJCtIMyUqHEI/EH5R+ezmbvtQquSshOe0U329f5zidDwBEk 3Crw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4295g9d+vfpEjU/auluxXIgYhr6aMNp4z7zgPADiIk0=; b=ad3wwTh869GVxJlOPjiIfTkLyYKAIi7d7RbduKqiktWabcwVOiWe+STIjmoMehyqb5 YKx6SBm6Us/rHnq33XsW0jmZ/zx04NUpx4JfwAcVXzyo2+MoXyxb4Hhku5vaEbd6fQlx dbW/tJYMgXKCzZy4T69T/4x3s4mJbD2Tv+nuXw8360eliU6aJKMuEMp1GHvamSXPW89m MH+MD0r2kS1hTrEpG6qHthWpuQyQVRv8TwBViX1LIryHKfy5OtE9VNkk5VO3ZN9IDQ1F Q2N8YiBDUpCcf5JGslRusj/UIQC0Axc+DHaUYpymKCdVi+8GWSsr8xuQ84qvg0zPaZwn afEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="LiVC/f3G"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bo1si462000pjb.66.2019.05.23.12.48.19; Thu, 23 May 2019 12:48:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="LiVC/f3G"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388537AbfEWTNO (ORCPT + 99 others); Thu, 23 May 2019 15:13:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:47062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388526AbfEWTNL (ORCPT ); Thu, 23 May 2019 15:13:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7401C21851; Thu, 23 May 2019 19:13:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638790; bh=ZEwfjpa3BByobNODqn6OBVyqtxV0Nf0sRBLKEfZEVKE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LiVC/f3GBs2yV5n6CfJ8aAWhC7FVBVnsWF+0QenVhV83RjHvmB17j8uAuZNDfSicl sn8i8nrrFvKx4jrDCvMD75wjz7/17tzYe/DoP0HPQrSyhpaDRg2kza7qRSoks/BELV 8EIoxoiApSWkxGAlWKmrkxT2e5C742PvTxtPBw+g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrey Smirnov , Chris Healy , linux-pm@vger.kernel.org, Sebastian Reichel , Sasha Levin Subject: [PATCH 4.14 66/77] power: supply: sysfs: prevent endless uevent loop with CONFIG_POWER_SUPPLY_DEBUG Date: Thu, 23 May 2019 21:06:24 +0200 Message-Id: <20190523181729.111215044@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181719.982121681@linuxfoundation.org> References: <20190523181719.982121681@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 349ced9984ff540ce74ca8a0b2e9b03dc434b9dd ] Fix a similar endless event loop as was done in commit 8dcf32175b4e ("i2c: prevent endless uevent loop with CONFIG_I2C_DEBUG_CORE"): The culprit is the dev_dbg printk in the i2c uevent handler. If this is activated (for instance by CONFIG_I2C_DEBUG_CORE) it results in an endless loop with systemd-journald. This happens if user-space scans the system log and reads the uevent file to get information about a newly created device, which seems fair use to me. Unfortunately reading the "uevent" file uses the same function that runs for creating the uevent for a new device, generating the next syslog entry Both CONFIG_I2C_DEBUG_CORE and CONFIG_POWER_SUPPLY_DEBUG were reported in https://bugs.freedesktop.org/show_bug.cgi?id=76886 but only former seems to have been fixed. Drop debug prints as it was done in I2C subsystem to resolve the issue. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: linux-pm@vger.kernel.org Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin --- drivers/power/supply/power_supply_sysfs.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index 5204f115970fe..eb5dc74820539 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -325,15 +325,11 @@ int power_supply_uevent(struct device *dev, struct kobj_uevent_env *env) char *prop_buf; char *attrname; - dev_dbg(dev, "uevent\n"); - if (!psy || !psy->desc) { dev_dbg(dev, "No power supply yet\n"); return ret; } - dev_dbg(dev, "POWER_SUPPLY_NAME=%s\n", psy->desc->name); - ret = add_uevent_var(env, "POWER_SUPPLY_NAME=%s", psy->desc->name); if (ret) return ret; @@ -369,8 +365,6 @@ int power_supply_uevent(struct device *dev, struct kobj_uevent_env *env) goto out; } - dev_dbg(dev, "prop %s=%s\n", attrname, prop_buf); - ret = add_uevent_var(env, "POWER_SUPPLY_%s=%s", attrname, prop_buf); kfree(attrname); if (ret) -- 2.20.1