From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DDF7923A9AB for ; Mon, 21 Jul 2025 20:25:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753129542; cv=none; b=lAMxEkjvoZx8/rF0uBBnAXMcK2sbs2JEH6LOJLsmqP1n4oKNTOt8A53fVDng/5Ceh+P4tKNoqJGiJrnQgzNhSovGDpwVDpO+orSU6LDhhpZU0x/KdaxbSzRDA7VL+bVbjH74BYtvuN+iiuAOG5YdHcHAjbnjZI2hGOjs85Itz2A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753129542; c=relaxed/simple; bh=hGFN/us4PJA4Xsf/DhXn3P6fmy4Y1hnlhz5wLuKVoqo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TqJyoFtq18hlXI9SFMyGOArg7Uh3FLYp65yP2Lify6P1o5ypGqEoN/ijQoxzk/KzDUkuN5GPT4AMMIm9fIc9CiLSrW9x7ZWkihsOFhO4jO0L/+tV+4O9gLneUF5bUVlxCwLNoz3fvEravZzqh16U670eLK1SqWGAEys4eneWWrM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=ga4uIzK2; arc=none smtp.client-ip=209.85.210.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="ga4uIzK2" Received: by mail-ot1-f48.google.com with SMTP id 46e09a7af769-72c14138668so1978568a34.2 for ; Mon, 21 Jul 2025 13:25:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1753129540; x=1753734340; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=4GRM/S7FS5n33a8EgF1WPjJ5PYFBbiyNz3lEYziTLbc=; b=ga4uIzK2PSMOO9pDXUSGq+vuJcXn1U3ljZdO7+FH8d+50DZs2KNiaSo66P/KGKwCpR ++6TO/Cu9KTpxoIQOBt8mF1TLwR8c2DI3BUn+Hal37GCtT0L+12g5v4groHj+wcRCu8h KQWlPwhg7VpDN+CPWq88C9UY9UvjoDTv/Ain7Jzrv9sYTbWbHpX+pZ4ukcDX4lMC5EOp oCD0k4WO4fqrSQkb41SToYsoyAqZf6LdDTdUowl5tzD77/kvkzjLp4nZVp1CKniOcZx7 fmq30LncP6/lCJFmPWfr6Xx7Ja2p0tfpFmcUvPjJJMqr8qr9QX+f02j/l3OsTIXJ5KSG A6UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753129540; x=1753734340; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4GRM/S7FS5n33a8EgF1WPjJ5PYFBbiyNz3lEYziTLbc=; b=C/rEkASa7WEZp9n6FGDLLhV9cHp0ql/cp4nxUimj9d7sT0JpqjvtYgrX4Lhp2BgtYw 3EFZ518sCi9A49WzmBKZVjn+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002:a05:6830:710c:b0:73c:f8be:988b with SMTP id 46e09a7af769-73e835a52bbmr13035612a34.26.1753129539787; Mon, 21 Jul 2025 13:25:39 -0700 (PDT) Received: from ?IPV6:2600:8803:e7e4:1d00:3bea:f296:60f2:c6cb? ([2600:8803:e7e4:1d00:3bea:f296:60f2:c6cb]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-73e83be5d8dsm3131100a34.64.2025.07.21.13.25.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Jul 2025 13:25:39 -0700 (PDT) Message-ID: Date: Mon, 21 Jul 2025 15:25:38 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] iio: light: ltr390: Add sysfs attribute to report data freshness To: Akshay Jindal , anshulusr@gmail.com, jic23@kernel.org, nuno.sa@analog.com, andy@kernel.org Cc: shuah@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20250721195419.526920-1-akshayaj.lkd@gmail.com> Content-Language: en-US From: David Lechner In-Reply-To: <20250721195419.526920-1-akshayaj.lkd@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 7/21/25 2:54 PM, Akshay Jindal wrote: > Some IIO sensors provide a status bit indicating whether the current data > register holds freshly measured data or stale data previously read. > > Expose this status via a new read-only sysfs attribute, 'data_fresh', > which returns: > - 1 if the data is freshly sampled > - 0 if the data is stale > > This attribute allows userspace to observe data freshness directly, which > can be useful for debugging or application-level filtering. For debugging, using debugfs would make more sense. For application level filtering, why does it matter if we have read the same value before or not? The sampling_frequency is available, so the application should be able to deduce when fresh data should be available based on time. I could see maybe polling this in the kernel in order to implement a buffered capture mode, but not sure passing this on to userspace is the best way to go about it.