Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp60953yba; Wed, 17 Apr 2019 19:37:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9AcGXrriehNHcLyxsuRGBv0o/sua3sE0DJqPr0/b3qP6HWTEQhDshxtWu5LoIP9WpT7Kz X-Received: by 2002:aa7:800e:: with SMTP id j14mr32162816pfi.157.1555555071177; Wed, 17 Apr 2019 19:37:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555555071; cv=none; d=google.com; s=arc-20160816; b=YyVihSUkgIOPIBfdKhbY7wA9yNDD5Lw+jgUXjq8ov7kZDN5eWMn4780Q96f6vcDI0u w5+LMknH9WO4jFAE2z7p49OJ9qU4Vru68npk2BgVAhSH7hZg18NT8PacndPbBt6gwfgH zX15LHDysn4GCxqii3h5g6Efhb2MkIyl/M77MkV5EkH/f+oIHsPc6/8PfEGDk8VYUrMd eBQeeH1X8y0KN3RfAaAHj/+nd1BAn8bCf+jZ94X9oUyAf9BhxVUEoUD+b4qrZvVdkoVB FS0s+Reh05cIXBH9HZsRC0Z2aZgezanFDASxGLizUJgxPq6VpI4jGj3THK50npbF+63V 4fIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=1tTleVlF3U5evyaswhblwCKcE6TBfEUNmf4hEKo9Dn8=; b=IDR/8+ATv/BDRJ5GAKeydLglENGoYnHig6I1MvhCByuO7f08GUWqM7XD/JwSEQNata egP5irnIxAY3vDBZEOP/Lp/LRJbRHVH3hmgyWdEL1d0TRk5bIPtfwRCO5U4csG4NrrJv h0aooJWdTHbVUbj6WQRPu6FCgoFKGm/UBnIvu+Z6wlXh8EpI9GMyjwkM6ZROgHL/bZI8 Ezf3F+xKApA2aJiNNNy09ehrBVbVgmCuEq9kPtAbwZMfF4L0UsdPPVahvxlgdH4R1FGf df3mpn6CqP/vINio4w5JhsRBlRHmH0WwIFE/eE2UtgZ23QjjGOtcNwZC0OKDyY5K1ngM Sw3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VYLaWUEy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v77si933985pfa.219.2019.04.17.19.37.36; Wed, 17 Apr 2019 19:37:51 -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=VYLaWUEy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388010AbfDRCfn (ORCPT + 99 others); Wed, 17 Apr 2019 22:35:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:54084 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387839AbfDRCfQ (ORCPT ); Wed, 17 Apr 2019 22:35:16 -0400 Received: from earth.universe (dyndsl-037-138-087-229.ewe-ip-backbone.de [37.138.87.229]) (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 D0DF321871; Thu, 18 Apr 2019 02:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555554915; bh=9tvhrTqKB3szgb6yq7OydqhhWOzHUAaudyWsUudeAtg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VYLaWUEynyzqCHh/YZO28y19TbP7ZQOhvaMnKftwp1dquKbGYaCKKj6XIxIJK2fR0 RMT5NbqbWjeLtGKW2DhDuW9L6Joo5eRDAJAeG4iYVW9/xs/EibB8DqGaoEAM8gD7V2 Z4FLs5tvuSTf6YqBcCW/XAnmGY7mOCPWBIEbr0R0= Received: by earth.universe (Postfix, from userid 1000) id A48F33C0986; Thu, 18 Apr 2019 00:37:08 +0200 (CEST) Date: Thu, 18 Apr 2019 00:37:08 +0200 From: Sebastian Reichel To: Andrey Smirnov Cc: Chris Healy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] power: supply: sysfs: prevent endless uevent loop with CONFIG_POWER_SUPPLY_DEBUG Message-ID: <20190417223708.4irrwrm4q7vig3vh@earth.universe> References: <20190405073020.10361-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xjgjrdmhm5424q6v" Content-Disposition: inline In-Reply-To: <20190405073020.10361-1-andrew.smirnov@gmail.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --xjgjrdmhm5424q6v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Fri, Apr 05, 2019 at 12:30:20AM -0700, Andrey Smirnov wrote: > Fix a similar endless event loop as was done in commit 8dcf32175b4e > ("i2c: prevent endless uevent loop with CONFIG_I2C_DEBUG_CORE"): >=20 > 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. >=20 > 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 >=20 > Both CONFIG_I2C_DEBUG_CORE and CONFIG_POWER_SUPPLY_DEBUG were reported > in https://bugs.freedesktop.org/show_bug.cgi?id=3D76886 but only former > seems to have been fixed. Change debug prints to use pr_debug insted > to resolve the issue. >=20 > Signed-off-by: Andrey Smirnov > Cc: Chris Healy > Cc: Sebastian Reichel > Cc: linux-pm@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > --- I think we should just drop these debug messages, just like I2C did. They don't offer any useful information considering the info is already exposed to userspace via the uevent. -- Sebastian > drivers/power/supply/power_supply_sysfs.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/su= pply/power_supply_sysfs.c > index dce24f596160..5e91946731fd 100644 > --- a/drivers/power/supply/power_supply_sysfs.c > +++ b/drivers/power/supply/power_supply_sysfs.c > @@ -383,14 +383,14 @@ int power_supply_uevent(struct device *dev, struct = kobj_uevent_env *env) > char *prop_buf; > char *attrname; > =20 > - dev_dbg(dev, "uevent\n"); > + pr_debug("%s: uevent\n", dev_name(dev)); > =20 > if (!psy || !psy->desc) { > dev_dbg(dev, "No power supply yet\n"); > return ret; > } > =20 > - dev_dbg(dev, "POWER_SUPPLY_NAME=3D%s\n", psy->desc->name); > + pr_debug("%s: POWER_SUPPLY_NAME=3D%s\n", dev_name(dev), psy->desc->name= ); > =20 > ret =3D add_uevent_var(env, "POWER_SUPPLY_NAME=3D%s", psy->desc->name); > if (ret) > @@ -427,7 +427,8 @@ int power_supply_uevent(struct device *dev, struct ko= bj_uevent_env *env) > goto out; > } > =20 > - dev_dbg(dev, "prop %s=3D%s\n", attrname, prop_buf); > + pr_debug("%s: prop %s=3D%s\n", dev_name(dev), attrname, > + prop_buf); > =20 > ret =3D add_uevent_var(env, "POWER_SUPPLY_%s=3D%s", attrname, prop_buf= ); > kfree(attrname); > --=20 > 2.20.1 >=20 --xjgjrdmhm5424q6v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAly3qpEACgkQ2O7X88g7 +pqOSQ//QuszE8iHqFMu2cJSEUKk0bWMOrbSpl/rEsxCFW0+hQPXNxLy/Yscs11l cTTSMX11dDp8JYHtZFBEsccX052mg/+W0DGzdIRNQ2X9cPjTgF+mWAcBR7wzcD2O LkON9QAroF6K6Lsc/oiu3BNg8us6dJu0YdBIKa+L4OBE6MBhq/wvtAHOsmK1n7m2 lP3rLTzeojKODAuhyLt568DhJ57V3Bq5ioPumf9b1+FEJlGCrwpnyFM5LvM0Jg2u f3TdCVdVHiDLGGyj1jMZ91vQ8Zb4mSYC3h3UZaTYTdus6vgbYda8c2vI/FiP8UIG CxVHrOVFQEOGkAyBMGro7BR6107TF6SH4nizIQSgKGS7GhdnJaM96wqoiZFKutuT asR5NB3W/CBX5iHZ1jBUqld1fVZJezht2GVonbWJrVWARqGjVioKNPdCQQino/du ULSMJnhftce97Ku1GHMNmgFGRAj6OEmsiArLhiE9r9Jgn67n8yt0VEJJleCTqmTa 50y1CjjiGEtSuyar1DcElLtz3slqsM/oSbmkje1X1PGoIjLa+Hm9kvsDCKyeTxXl J7i9O9zLPsUKSrnefrysTzizy216DOfS0ssJjxAvmlNlnVmN5jGWg9HbtXtv+rkj JC3OU7ElMgHzcB92FOYdUAxcgkbWSMG3/t+p0vPas0ZVL0ln5P4= =7bQo -----END PGP SIGNATURE----- --xjgjrdmhm5424q6v--