From: Hermes Zhang <chenhuiz@axis.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Hermes Zhang <Hermes.Zhang@axis.com>,
robh@kernel.org, lars@metafoo.de, krzk+dt@kernel.org,
kernel@axis.com, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org
Subject: Re: [PATCH 3/3] iio: chemical: add support for Sensirion SEN5x/SEN6x
Date: Tue, 11 Feb 2025 10:29:54 +0800 [thread overview]
Message-ID: <c397401d-63b7-7a6e-80fa-16dd4ceb0537@axis.com> (raw)
In-Reply-To: <20250210190942.21ba97cc@jic23-huawei>
On 2025/2/11 3:09, Jonathan Cameron wrote:
> On Mon, 10 Feb 2025 17:16:57 +0800
> Hermes Zhang <chenhuiz@axis.com> wrote:
>
>> Hi Jonathan,
>>
>> Thanks a lot for your review. I will fix most of them in v2, just one
>> question below.
>>
>> Best Regards,
>> Hermes
>>
>>
>> On 2025/2/9 0:15, Jonathan Cameron wrote:
>>> On Thu, 6 Feb 2025 14:15:17 +0800
>>> Hermes Zhang <Hermes.Zhang@axis.com> wrote:
>>>
>>>
>>>> +
>>>> + state->last_update = jiffies;
>>>> +
>>>> + return 0;
>>>> +}
>>>> +
>>>> +static ssize_t status_show(struct device *dev, struct device_attribute *attr,
>>>> + char *buf)
>>>> +{
>>>> + struct iio_dev *indio_dev = dev_to_iio_dev(dev);
>>>> + struct sen_common_state *state = iio_priv(indio_dev);
>>>> + int status;
>>>> + int ret;
>>>> +
>>>> + ret = sen_common_status(state->client, &status);
>>> This is custom ABI. So it would need documentation and will need
>>> to overcome quite a high barrier.
>>>
>>> Superficially this looks like debug perhaps that should be
>>> in debugfs?
>> The status is one of the support commands from the chip, we (from
>> userspace) could read it and notify customer if the sensor is wrong or
>> not. So it is ued in normal usage, regarding the ABI, I see your point,
>> so instead of my way, do you have any suggestion for how to handle it in
>> iio? Thanks.
> What is actually reporting? I hope something more specific than
> 'wrong'. Also when do you read it? Standard software is never going to
> so you may be better of doing some scheduled reading or reading it
> on the back of a channel read. Unfortunately the nature of failure modes
> is that they are not easy to describe in a generic ABI - sometimes
> our best bet is to just log an error (rate limited).
>
> Some of these look like they mean the data read is garbage when they
> are happening?
>
> Jonathan
>
It's e.g. a 32bit data which some of the bits indicate if the
PM/CO2/GAS/RHT/FAN is error. Yes, the software will scheduled to read it
and deal the error based on some policy configurable (e.g reboot the
device). I hope if the driver can provide such inteface to read it, so
userspace can decide how to handle it. Is there some similar case
already in driver now? Thanks.
Best Regards,
Hermes
next prev parent reply other threads:[~2025-02-11 2:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250206061521.2546108-1-Hermes.Zhang@axis.com>
2025-02-06 6:15 ` [PATCH 1/3] iio: add IIO_MOD_NOX modifier Hermes Zhang
2025-02-08 15:53 ` Jonathan Cameron
2025-02-06 6:15 ` [PATCH 2/3] dt-bindings: iio: chemical: sensirion,senxx: Add yaml description Hermes Zhang
2025-02-06 18:20 ` Conor Dooley
2025-02-08 7:07 ` Hermes Zhang
2025-02-11 18:44 ` Conor Dooley
2025-02-12 6:27 ` Hermes Zhang
2025-02-06 6:15 ` [PATCH 3/3] iio: chemical: add support for Sensirion SEN5x/SEN6x Hermes Zhang
2025-02-08 16:15 ` Jonathan Cameron
2025-02-10 9:16 ` Hermes Zhang
2025-02-10 19:09 ` Jonathan Cameron
2025-02-11 2:29 ` Hermes Zhang [this message]
2025-02-11 19:22 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c397401d-63b7-7a6e-80fa-16dd4ceb0537@axis.com \
--to=chenhuiz@axis.com \
--cc=Hermes.Zhang@axis.com \
--cc=jic23@kernel.org \
--cc=kernel@axis.com \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox