Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2885868lqp; Mon, 25 Mar 2024 12:00:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUFm6JMTkB3iC9mTWX2U1JCtmdGx3VgNlLjUYZHdVQxZLdcJPNt9Vdu9W8D0qMogPSUhKKu85wg7kylWpDDCvUW4+JvWV+EmJbs9InnKQ== X-Google-Smtp-Source: AGHT+IFaazcQsUZ9d+mNnxfcUFp6eQ3UPegsZD5TakHPudQyYrPpb2H+8yWR9UR1mQRmlksAmtzt X-Received: by 2002:a50:9344:0:b0:56b:d0d8:a00a with SMTP id n4-20020a509344000000b0056bd0d8a00amr538593eda.33.1711393248993; Mon, 25 Mar 2024 12:00:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711393248; cv=pass; d=google.com; s=arc-20160816; b=J/ijqZWwXDQs8K4Jr1kq/r4oK2RuBTOdc0zLJZoc85BgYmBJI2uUaojJ0TKp23YVcx gHhAx3krnG++ITWKu5G0fKwXx/mb0zXkC2Sd3ceokH21mlyEaJVns88reOMXGPsWUx8K WIIw+0rVii4cJx0tcE+mLYtBqitcc0AJw3V/Ogxv9Ls5CKbC2kpgGH0jXMV3qlR1hEuf 0FjGBSeGQQAr9JjHlbL/qazgTsVvKhN5AA8IraIcKCkTVkMD/c/2YYYCzn6nnvzGVSU/ md+G5LoReAXt6407zpXdtqw3gnycwpEtoGs2tw5N1iuP9M1fvCfo2/UL3KtTg/vYYpV9 jA9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=NyyAZJSSGrCTUFGc9OJFG4mJqS6OcJzmjq75LpNVV7Q=; fh=7nVdrn/0DH7LFC9pTw7JMOssAyYgFJBnRN2Q55kFhZM=; b=cQf2xGj2EyntwsaLNA1AgcJv2Uv8fQcxAZF59ZmQbq0JpiACagAR7tTEOX8pHIs4bw kFxe6NHAD//qBJLzZokt6L2L7wIbDwItMlY9aUFoQ8mnuhOq8b3/eeIKkMyZ7YrS12Js e9PU3Z72dkfb4NnpyaMI3p4Mx6pTeYl65hgQJn/OWVUzH+bHZNPlhgbYnc8tXNbZ9quD FNeN/rYLxU2xm0F6HCy4vemAbGABrDBPOvWY/F0Mm3cP03RvxGg0VB3FnnYm6ghSKDMi Uor28ri0OqXlXn1JPW1cqkLB2/bfTx8Lih6rdaQVwvNBvyQa7QnyCPuPxHLn3UDeFhv4 IvAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ccbib.org header.s=20220806 header.b=M0p8rRvh; arc=pass (i=1 spf=pass spfdomain=ccbib.org dkim=pass dkdomain=ccbib.org dmarc=pass fromdomain=ccbib.org); spf=pass (google.com: domain of linux-kernel+bounces-117754-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117754-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=ccbib.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w6-20020a05640234c600b0056bfc2cddcfsi2351319edc.412.2024.03.25.12.00.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 12:00:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117754-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ccbib.org header.s=20220806 header.b=M0p8rRvh; arc=pass (i=1 spf=pass spfdomain=ccbib.org dkim=pass dkdomain=ccbib.org dmarc=pass fromdomain=ccbib.org); spf=pass (google.com: domain of linux-kernel+bounces-117754-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117754-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=ccbib.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6B6F11F66EDB for ; Mon, 25 Mar 2024 18:57:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 18ECD4A24; Mon, 25 Mar 2024 18:57:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=ccbib.org header.i=@ccbib.org header.b="M0p8rRvh" Received: from mail.multiname.org (h4.multiname.org [94.130.68.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2EC4D63C7; Mon, 25 Mar 2024 18:57:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=94.130.68.253 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711393033; cv=none; b=BJp3FSuAggNSW8lu+cVGENcPZd4wWt9NeRxA/97JkbFj7HnqDxsL68ldqG4M0kRGp3xSlkNOJmtkbZ5LST12JIjnqgxv4uey1VmIdGg4JEvWe41WhzVN0Voi+MGuXNzGPVWZcRSbDFTfAiwdxzt6RX2xbYgrz1gbixsQ0cvr3w4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711393033; c=relaxed/simple; bh=iKrKQs6gu/1W/XFPp5YwYP46/FGNk4CUHMBRezq0H+A=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=WLug3uxMuFI4zH7ouV7bYlBvtiw9wR7PqUSoclZYQKDqp3Ff/hspZVU8QaukzDQBLAVNrHAUSdymPuTuVhB4vxRoRhtzt8i9aCI0IY7FWijv5Sd1jzaFfX8IebR5uUpV4pIIdKbdzONjwi4QBTyUPCQ+AM88AvDPbSYo3XMFVm4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ccbib.org; spf=pass smtp.mailfrom=ccbib.org; dkim=pass (4096-bit key) header.d=ccbib.org header.i=@ccbib.org header.b=M0p8rRvh; arc=none smtp.client-ip=94.130.68.253 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ccbib.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ccbib.org Received: from raab.fritz.box (unknown [IPv6:2a02:1748:dd5c:fec0:221:9bff:fe61:eebd]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.multiname.org (Postfix) with ESMTPSA id 4V3MPs0dmlzPLsB2; Mon, 25 Mar 2024 19:48:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccbib.org; s=20220806; t=1711392481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NyyAZJSSGrCTUFGc9OJFG4mJqS6OcJzmjq75LpNVV7Q=; b=M0p8rRvh6Z0cducA4rEuwCBqh/QKRN1jAjjXmeYDOoa7jsrf7+lSqLhDl8aSFJrELbv1++ YdUiLbEfHOePypk9OyqZgnfrYrKd7D/LJ7wB68s4EhysCV0kwHAGWhEsvSKtd0wcy6UTyS FDgESpH8ov5k0cznyHZdMDuV+Zcbuq5UzKD2E23OhKzk4O7+5tZeBKAlvGaFCLiy3vITWg Xnfcko66v+MdJoSwAWkHCPYQ8Hpn3YPN0+cUY8SeA0WlX5k8o61d8et2b2G9HBaf9Vc3+5 zuWQsc3eCCCfvpTUeap1XhdbPTulMlLxq3/UL0+noXGvYJyPCp/OVhmzhGv1/dNBjzOvpA EsNG/z8Nlou6ZuuV1DyC0GtsqmcSWrimnwuRK7w7rqFrLYHK8pYxoOX7REJ4YMw1Cq3Kdj Ej5ygeCtRK1Heurn7HrGjs7ZGms3N/47QQ0kWFt4V2SbsxV88B4fc/s4Je0nkwWbYxNMOp krcsMA24kMS3p0KvPdUyW0UQHZujheRFC6j8PE+drvbxY6KtRrnjU4T/6I2KACZ3BqnHRk 0VxDEtM6nKRGOqbSW2B1tK/79nW6o3Nyv/dS8Q5KBe9tpGn5o6jscZZm2LoC2hwvkzrVbA PHTohzP+iX/SjVwvCK7hMfgnT/iozjiM059A0C+qcCmkivt9cNDQU= Message-ID: Subject: Re: [PATCH] iio: dht11: set debug log level for parsing error messages From: Harald Geyer To: George Stark , jic23@kernel.org, lars@metafoo.de Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@salutedevices.com Date: Mon, 25 Mar 2024 19:48:00 +0100 In-Reply-To: <20240325165406.226916-1-gnstark@salutedevices.com> References: <20240325165406.226916-1-gnstark@salutedevices.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4-2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi George! I'm torn on this: Am Montag, dem 25.03.2024 um 19:54 +0300 schrieb George Stark: > Protocol parsing errors could happen due to several reasons like > noise > environment, heavy load on system etc. If to poll the sensor > frequently > and/or for a long period kernel log will become polluted with error > messages if their log level is err (i.e. on by default). Yes, these error are often recoverable. (As are many other HW errors, that typically are logged. Eg USB bus resets due to EMI) However they are still genuine errors of the HW. > Also some types > of those messages already have dbg level so use unified log level for > all such cases. My take so far has been: Debug level messages are for debugging the code (ie adding/testing support of new device variants etc). Users aren't expected to know about or enable debug output. OTOH anything actually going wrong is an error and should be logged as such. The idea is, that these messages help users understand issues with their HW (like too long cables, broken cables etc). But it is true, that they will slowly accumulate in many real world scenarios without anything being truly wrong. I don't consider the dmesg buffer being rotated after a month or two a bug. But I suppose this is a corner case. I'll happily accept whatever Jonathan thinks is reasonable. Best regards, Harald > Signed-off-by: George Stark > --- > I use DHT22 sensor with Raspberry Pi Zero W as a simple home meteo > station. > Even if to poll the sensor once per tens of seconds after month or > two dmesg > may become full of useless parsing error messages. Anyway those > errors are caught > in the user software thru return values. >=20 > =C2=A0drivers/iio/humidity/dht11.c | 4 ++-- > =C2=A01 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/iio/humidity/dht11.c > b/drivers/iio/humidity/dht11.c > index c97e25448772..e2cbc442177b 100644 > --- a/drivers/iio/humidity/dht11.c > +++ b/drivers/iio/humidity/dht11.c > @@ -156,7 +156,7 @@ static int dht11_decode(struct dht11 *dht11, int > offset) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0dht11->temperature =3D temp_int * 1000; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0dht11->humidity =3D hum_int * 1000; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} else { > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0dev_err(dht11->dev, > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0dev_dbg(dht11->dev, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"Do= n't know how to decode data: %d %d %d > %d\n", > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0hum= _int, hum_dec, temp_int, temp_dec); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0return -EIO; > @@ -239,7 +239,7 @@ static int dht11_read_raw(struct iio_dev > *iio_dev, > =C2=A0#endif >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0if (ret =3D=3D 0 && dht11->num_edges < > DHT11_EDGES_PER_READ - 1) { > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0dev_err(d= ht11->dev, "Only %d signal edges > detected\n", > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0dev_dbg(d= ht11->dev, "Only %d signal edges > detected\n", > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0dht11->num_edges); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ret= =3D -ETIMEDOUT; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0} > -- > 2.25.1 >=20