Linux IIO development
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: Petre Rodan <petre.rodan@subdimension.ro>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jonathan Cameron <jic23@kernel.org>,
	Nuno S?? <nuno.sa@analog.com>, Andy Shevchenko <andy@kernel.org>,
	Rob Herring <robh@kernel.org>, Conor Dooley <conor+dt@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>
Subject: Re: [PATCH 01/10] dt-bindings: iio: accel: bosch,BMA220 improvements
Date: Sat, 6 Sep 2025 09:36:49 -0500	[thread overview]
Message-ID: <b4713092-62d1-433a-863a-e7c000797f39@baylibre.com> (raw)
In-Reply-To: <aLugeZiJjJhTpwUO@sunspire>

On 9/5/25 9:46 PM, Petre Rodan wrote:
> 
> Good morning.
> 
> Thank you for your feedback.
> 
> On Fri, Sep 05, 2025 at 03:15:55PM -0500, David Lechner wrote:
>> On 9/1/25 2:47 PM, Petre Rodan wrote:
>>> diff --git a/Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml b/Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml
> 
> [..]
> 
>>> +  bosch,watchdog:
>>> +    description:
>>> +      In order to prevent the built-in I2C slave to lock-up the I2C bus, a
>>> +      watchdog timer is introduced. The WDT observes internal I2C signals and
>>> +      resets the I2C interface if the bus is locked-up by the BMA220.
>>> +      0 - off
>>> +      1 - 1ms
>>> +      2 - 10ms
>>> +    enum: [0, 1, 2]
>>> +    $ref: /schemas/types.yaml#/definitions/uint32
>>
>> Why should this depend on how the chip is wired up? Normally, we don't have this
>> sort of control in devicetree.
> 
> I was also unsure on how it would be best to implement the feature, bellow is my thought process.
> 
> The feature itself is definitely required for the i2c implementation of this chip. I have witnessed it pull sda low for no good reason twice over a 100h period and this would render not only the chip but the entire bus unusable until a power cycle.
> 
> I think from a driver perspective ideally WDT should be set very early - within bma220_common_probe() would be ideal.
> 
>> E.g. if it is useful, why shouldn't drivers just always enable it?
> 
> The registers holding the watchdog are all zeroed out after power on which mean it's off. I think the driver should also default on this setting. In my first implementation I had it hard-wired to 1ms, but I felt this would impose my point of view on users and it would be nicer to give them control over it.
> 
> If you guys think that the devicetree is not the place where the WDT should be set that is fine by me, would you recommend something like module_param() instead?

I wish I had a good answer, but I don't have the right kind of
experience with this sort of thing to know what works best.

We could start with just always enabling it and if we find it
actually does cause some problem for someone, then we would have
more information about that use case and could make a more
informed decision on how to handle it at that point in time.

> 
>> If we can make the case that it belongs in the devicetree, it should use
>> standard units, e.g. property should be watchdog-timeout-ms with enum: [1, 10].
>> Maybe 0 for disabled is OK too - in that case should have default: 0.
> 
> Oh yes I can see it in bq256xx.yaml, to me this sounds absolutely perfect.
> 
> 
> On a different note, from a reviewer's perspective would you prefer the next revision of this patch series to cover less ground? I was thinking about leaving everything event related for later since I might go past 15 separate patches if I split every modification into it's own separate entry.

Yes, smaller series will get more thorough reviews so I'm always
in favor of splitting things up like that.

> 
> thank you again,
> peter
> 


  reply	other threads:[~2025-09-06 14:36 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-01 19:47 [PATCH 0/10] iio: accel: BMA220 improvements Petre Rodan
2025-09-01 19:47 ` [PATCH 01/10] dt-bindings: iio: accel: bosch,BMA220 improvements Petre Rodan
2025-09-02  5:57   ` Krzysztof Kozlowski
2025-09-02 16:02     ` Petre Rodan
2025-09-02 16:14       ` David Lechner
2025-09-02 19:22       ` Krzysztof Kozlowski
2025-09-05 20:15   ` David Lechner
2025-09-06  2:46     ` Petre Rodan
2025-09-06 14:36       ` David Lechner [this message]
2025-09-01 19:47 ` [PATCH 02/10] iio: accel: BMA220 split original spi driver Petre Rodan
2025-09-07 12:29   ` Jonathan Cameron
2025-09-01 19:47 ` [PATCH 03/10] iio: accel: BMA220 migrate to regmap API Petre Rodan
2025-09-07 12:45   ` Jonathan Cameron
2025-09-08  3:27     ` Petre Rodan
2025-09-09 16:15       ` Jonathan Cameron
2025-09-01 19:47 ` [PATCH 04/10] iio: accel: BMA220 add i2c module Petre Rodan
2025-09-07 12:46   ` Jonathan Cameron
2025-09-01 19:47 ` [PATCH 05/10] iio: accel: BMA220 make use of the watchdog functionality Petre Rodan
2025-09-07 12:48   ` Jonathan Cameron
2025-09-01 19:47 ` [PATCH 06/10] iio: accel: BMA220 add LPF cut-off frequency mapping Petre Rodan
2025-09-05 19:59   ` David Lechner
2025-09-07 12:50     ` Jonathan Cameron
2025-09-01 19:47 ` [PATCH 07/10] iio: accel: BMA220 add debugfs reg access Petre Rodan
2025-09-01 19:47 ` [PATCH 08/10] iio: accel: BMA220 add events Petre Rodan
2025-09-07 13:02   ` Jonathan Cameron
2025-09-01 19:47 ` [PATCH 09/10] iio: accel: BMA220 add event attrs Petre Rodan
2025-09-07 13:15   ` Jonathan Cameron
2025-09-07 13:28     ` Petre Rodan
2025-09-09 16:20       ` Jonathan Cameron
2025-09-01 19:47 ` [PATCH 10/10] iio: accel: BMA220 add maintainer Petre Rodan

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=b4713092-62d1-433a-863a-e7c000797f39@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=petre.rodan@subdimension.ro \
    --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