From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Alexandru Ardelean <ardeleanalex@gmail.com>,
Denis Ciocca <denis.ciocca@st.com>
Subject: Re: [PATCH v2 06/12] iio: st_sensors: Stop abusing mlock to ensure internal coherency
Date: Mon, 7 Feb 2022 15:31:56 +0100 [thread overview]
Message-ID: <20220207153156.38b36fe8@xps13> (raw)
In-Reply-To: <20220206154533.3153e610@jic23-huawei>
Hi Jonathan,
jic23@kernel.org wrote on Sun, 6 Feb 2022 15:45:33 +0000:
> On Wed, 2 Feb 2022 15:02:02 +0100
> Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> > An odr_lock has been introduced to protect local accesses to the odr
> > internal cache and ensure the cached value always reflected the actual
> > value. Using the mlock() for this purpose is no longer needed, so let's
> > drop these extra mutex_lock/unlock() calls.
> >
> > Suggested-by: Jonathan Cameron <jic23@kernel.org>
> > Cc: Denis Ciocca <denis.ciocca@st.com>
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
>
> Obviously a different issue but all the write_raw() functions should
> use the pattern used in st_pressure_core.c and do early
> returns seeing as there doesn't seem to be any cleanup to do.
I honestly hesitated when dropping the mlocks there. I've done it in
v3, so that we don't hurt our eyes on this anymore :)
>
> We can tidy that up in a follow up patch as I'm sure there are other
> areas in these drivers where direct returns would be nicer than
> what is there currently!
Thanks,
Miquèl
next prev parent reply other threads:[~2022-02-07 14:59 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-02 14:01 [PATCH v2 00/12] Miscellaneous IIO core enhancements Miquel Raynal
2022-02-02 14:01 ` [PATCH v2 01/12] iio: core: Enhance the kernel doc of modes and currentmodes iio_dev entries Miquel Raynal
2022-02-02 14:01 ` [PATCH v2 02/12] iio: magnetometer: rm3100: Stop abusing the ->currentmode Miquel Raynal
2022-02-02 14:01 ` [PATCH v2 03/12] iio: adc: stm32-dfsdm: Avoid dereferencing ->currentmode Miquel Raynal
2022-02-02 16:57 ` Fabrice Gasnier
2022-02-02 14:02 ` [PATCH v2 04/12] iio: st_sensors: Drop the protection on _avail functions Miquel Raynal
2022-02-02 14:02 ` [PATCH v2 05/12] iio: st_sensors: Add a local lock for protecting odr Miquel Raynal
2022-02-02 14:02 ` [PATCH v2 06/12] iio: st_sensors: Stop abusing mlock to ensure internal coherency Miquel Raynal
2022-02-06 15:45 ` Jonathan Cameron
2022-02-07 14:31 ` Miquel Raynal [this message]
2022-02-02 14:02 ` [PATCH v2 07/12] iio: st_sensors: Use iio_device_claim/release_direct_mode() when relevant Miquel Raynal
2022-02-06 15:55 ` Jonathan Cameron
2022-02-07 14:35 ` Miquel Raynal
2022-02-02 14:02 ` [PATCH v2 08/12] iio: Un-inline iio_buffer_enabled() Miquel Raynal
2022-02-02 14:02 ` [PATCH v2 09/12] iio: core: Hide read accesses to iio_dev->currentmode Miquel Raynal
2022-02-02 14:02 ` [PATCH v2 10/12] iio: core: Move the currentmode entry to the opaque structure Miquel Raynal
2022-02-02 14:02 ` [PATCH v2 11/12] iio: core: Simplify the registration of kfifo buffers Miquel Raynal
2022-02-02 14:02 ` [PATCH v2 12/12] iio: core: Clarify the modes Miquel Raynal
2022-02-06 16:09 ` Jonathan Cameron
2022-02-07 14:35 ` Miquel Raynal
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=20220207153156.38b36fe8@xps13 \
--to=miquel.raynal@bootlin.com \
--cc=ardeleanalex@gmail.com \
--cc=denis.ciocca@st.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=thomas.petazzoni@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.