From: Jonathan Cameron <jic23@kernel.org>
To: Mike Looijmans <mike.looijmans@topic.nl>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
devicetree@vger.kernel.org, linux-iio@vger.kernel.org,
Arnd Bergmann <arnd@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Liam Beguin <liambeguin@gmail.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Maksim Kiselev <bigunclemax@gmail.com>,
Marcus Folkesson <marcus.folkesson@gmail.com>,
Marius Cristea <marius.cristea@microchip.com>,
Mark Brown <broonie@kernel.org>,
Niklas Schnelle <schnelle@linux.ibm.com>,
Okan Sahin <okan.sahin@analog.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 2/2] iio: adc: ti-ads1298: Add driver
Date: Fri, 16 Feb 2024 17:19:21 +0000 [thread overview]
Message-ID: <20240216171921.5a6b6b20@jic23-huawei> (raw)
In-Reply-To: <fb7d41fc-328a-4ce1-88ad-5ce22ee158e4@topic.nl>
On Fri, 16 Feb 2024 17:07:49 +0100
Mike Looijmans <mike.looijmans@topic.nl> wrote:
> On 16-02-2024 16:53, Andy Shevchenko wrote:
>
> ...
>
> + if (reset_gpio) {
> + /*
> + * Deassert reset now that clock and power are active.
> + * Minimum reset pulsewidth is 2 clock cycles.
> + */
> + udelay(ADS1298_CLOCKS_TO_USECS(2));
>
> This is sleeping context and you are calling unsleeping function. I haven't
> checked the macro implementation and I have no idea what is the maximum it may
> give, but making code robust just use fsleep() call.
>
> It'll actually delay for 1 us (the "clock" is ~2MHz). So fsleep will compile to udelay anyway, which is fine, fsleep might get smarter in future and this would then profit.
>
>
>
> + gpiod_set_value_cansleep(reset_gpio, 0);
> + } else {
> + ret = ads1298_write_cmd(priv, ADS1298_CMD_RESET);
> + if (ret)
> + return dev_err_probe(dev, ret, "RESET failed\n");
> + }
> + /* Wait 18 clock cycles for reset command to complete */
> + udelay(ADS1298_CLOCKS_TO_USECS(18));
>
> Ditto.
>
> ...
>
>
> If it's the only issue I think Jonathan can modify when applying
> (no new patch version would be needed).
>
> That'd be nice.
ok. As this is still the top of my tree I'll just tweak it.
Does anyone else read fsleep as femtosecond sleep every time? :)
Maybe computers will go that fast one day.
Jonathan
>
>
> --
> Mike Looijmans
> System Expert
>
> TOPIC Embedded Products B.V.
> Materiaalweg 4, 5681 RJ Best
> The Netherlands
>
> T: +31 (0) 499 33 69 69
> E: mike.looijmans@topic.nl<mailto:mike.looijmans@topic.nl>
> W: www.topic.nl<http://www.topic.nl>
>
>
next prev parent reply other threads:[~2024-02-16 17:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-16 15:53 [PATCH v5 2/2] iio: adc: ti-ads1298: Add driver Andy Shevchenko
[not found] ` <fb7d41fc-328a-4ce1-88ad-5ce22ee158e4@topic.nl>
2024-02-16 17:19 ` Jonathan Cameron [this message]
2024-02-19 6:56 ` Mike Looijmans
[not found] <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.52058f93-4994-4138-8075-7b04acaef74b@emailsignatures365.codetwo.com>
2024-02-16 15:30 ` [PATCH v5 1/2] dt-bindings: iio: adc: ti-ads1298: Add bindings Mike Looijmans
2024-02-16 15:30 ` [PATCH v5 2/2] iio: adc: ti-ads1298: Add driver Mike Looijmans
2024-02-16 17:01 ` 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=20240216171921.5a6b6b20@jic23-huawei \
--to=jic23@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=arnd@kernel.org \
--cc=bigunclemax@gmail.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=liambeguin@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcus.folkesson@gmail.com \
--cc=marius.cristea@microchip.com \
--cc=mike.looijmans@topic.nl \
--cc=okan.sahin@analog.com \
--cc=schnelle@linux.ibm.com \
/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