All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandru Ardelean <ardeleanalex@gmail.com>
To: Fabrice Gasnier <fabrice.gasnier@st.com>
Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>,
	linux-iio <linux-iio@vger.kernel.org>,
	linux-stm32@st-md-mailman.stormreply.com,
	LKML <linux-kernel@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	Jonathan Cameron <jic23@kernel.org>,
	alexandre.torgue@st.com,
	Sergiu Cuciurean <sergiu.cuciurean@analog.com>
Subject: Re: [PATCH v2] iio: stm32-dac: Replace indio_dev->mlock with own device lock
Date: Thu, 27 Aug 2020 13:00:36 +0300	[thread overview]
Message-ID: <CA+U=DspjGUhXCY7c8P6zOYZsx17ybcU4Kdr52yujmdYOaa1JSQ@mail.gmail.com> (raw)
In-Reply-To: <c3a9411e-186d-a3ac-5ad0-bd70ad78f147@st.com>

On Thu, Aug 27, 2020 at 12:03 PM Fabrice Gasnier <fabrice.gasnier@st.com> wrote:
>
> On 8/27/20 10:55 AM, Alexandru Ardelean wrote:
> > On Wed, Aug 26, 2020 at 3:03 PM Alexandru Ardelean
> > <alexandru.ardelean@analog.com> wrote:
> >> From: Sergiu Cuciurean <sergiu.cuciurean@analog.com>
> >>
> >> As part of the general cleanup of indio_dev->mlock, this change replaces
> >> it with a local lock. The lock protects against potential races when
> >> reading the CR reg and then updating, so that the state of pm_runtime
> >> is consistent between the two operations.
> >>
> >> Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com>
> >> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> >> ---
> > Forgot the changelog here.
> > Apologies.
> >
> > Changelog v1 -> v2:
> > * removed whitespace change for 'common' field
> > * updated comment about the lock usage
>
> Hi Alexandru,
>
> Sorry if I missed it... is there an update on the comment :-) ?

For a moment there, I thought I didn't.
GMail's threading is confusing.

----------------------------------------------------------------------------
As part of the general cleanup of indio_dev->mlock, this change replaces
it with a local lock. The lock protects against potential races when
reading the CR reg and then updating, so that the state of pm_runtime
is consistent between the two operations.
----------------------------------------------------------------------------

>
> Best Regards,
> Fabrice
> >
> >>  drivers/iio/dac/stm32-dac.c | 12 ++++++++----
> >>  1 file changed, 8 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/iio/dac/stm32-dac.c b/drivers/iio/dac/stm32-dac.c
> >> index 092c796fa3d9..7a8aed476850 100644
> >> --- a/drivers/iio/dac/stm32-dac.c
> >> +++ b/drivers/iio/dac/stm32-dac.c
> >> @@ -26,9 +26,11 @@
> >>  /**
> >>   * struct stm32_dac - private data of DAC driver
> >>   * @common:            reference to DAC common data
> >> + * @lock:              lock to protect the data buffer during regmap ops
> >>   */
> >>  struct stm32_dac {
> >>         struct stm32_dac_common *common;
> >> +       struct mutex            lock;
> >>  };

WARNING: multiple messages have this Message-ID (diff)
From: Alexandru Ardelean <ardeleanalex@gmail.com>
To: Fabrice Gasnier <fabrice.gasnier@st.com>
Cc: alexandre.torgue@st.com, linux-iio <linux-iio@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Sergiu Cuciurean <sergiu.cuciurean@analog.com>,
	linux-arm-kernel@lists.infradead.org,
	Alexandru Ardelean <alexandru.ardelean@analog.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	Jonathan Cameron <jic23@kernel.org>
Subject: Re: [PATCH v2] iio: stm32-dac: Replace indio_dev->mlock with own device lock
Date: Thu, 27 Aug 2020 13:00:36 +0300	[thread overview]
Message-ID: <CA+U=DspjGUhXCY7c8P6zOYZsx17ybcU4Kdr52yujmdYOaa1JSQ@mail.gmail.com> (raw)
In-Reply-To: <c3a9411e-186d-a3ac-5ad0-bd70ad78f147@st.com>

On Thu, Aug 27, 2020 at 12:03 PM Fabrice Gasnier <fabrice.gasnier@st.com> wrote:
>
> On 8/27/20 10:55 AM, Alexandru Ardelean wrote:
> > On Wed, Aug 26, 2020 at 3:03 PM Alexandru Ardelean
> > <alexandru.ardelean@analog.com> wrote:
> >> From: Sergiu Cuciurean <sergiu.cuciurean@analog.com>
> >>
> >> As part of the general cleanup of indio_dev->mlock, this change replaces
> >> it with a local lock. The lock protects against potential races when
> >> reading the CR reg and then updating, so that the state of pm_runtime
> >> is consistent between the two operations.
> >>
> >> Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com>
> >> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> >> ---
> > Forgot the changelog here.
> > Apologies.
> >
> > Changelog v1 -> v2:
> > * removed whitespace change for 'common' field
> > * updated comment about the lock usage
>
> Hi Alexandru,
>
> Sorry if I missed it... is there an update on the comment :-) ?

For a moment there, I thought I didn't.
GMail's threading is confusing.

----------------------------------------------------------------------------
As part of the general cleanup of indio_dev->mlock, this change replaces
it with a local lock. The lock protects against potential races when
reading the CR reg and then updating, so that the state of pm_runtime
is consistent between the two operations.
----------------------------------------------------------------------------

>
> Best Regards,
> Fabrice
> >
> >>  drivers/iio/dac/stm32-dac.c | 12 ++++++++----
> >>  1 file changed, 8 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/iio/dac/stm32-dac.c b/drivers/iio/dac/stm32-dac.c
> >> index 092c796fa3d9..7a8aed476850 100644
> >> --- a/drivers/iio/dac/stm32-dac.c
> >> +++ b/drivers/iio/dac/stm32-dac.c
> >> @@ -26,9 +26,11 @@
> >>  /**
> >>   * struct stm32_dac - private data of DAC driver
> >>   * @common:            reference to DAC common data
> >> + * @lock:              lock to protect the data buffer during regmap ops
> >>   */
> >>  struct stm32_dac {
> >>         struct stm32_dac_common *common;
> >> +       struct mutex            lock;
> >>  };

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-08-27 10:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26  6:38 [PATCH] iio: stm32-dac: Replace indio_dev->mlock with own device lock Alexandru Ardelean
2020-08-26  6:38 ` Alexandru Ardelean
2020-08-26  8:57 ` Fabrice Gasnier
2020-08-26  8:57   ` Fabrice Gasnier
2020-08-26 10:01   ` Alexandru Ardelean
2020-08-26 10:01     ` Alexandru Ardelean
2020-08-26 12:00 ` [PATCH v2] " Alexandru Ardelean
2020-08-26 12:00   ` Alexandru Ardelean
2020-08-27  8:55   ` Alexandru Ardelean
2020-08-27  8:55     ` Alexandru Ardelean
2020-08-27  9:03     ` Fabrice Gasnier
2020-08-27  9:03       ` Fabrice Gasnier
2020-08-27 10:00       ` Alexandru Ardelean [this message]
2020-08-27 10:00         ` Alexandru Ardelean
2020-08-29 15:46         ` Jonathan Cameron
2020-08-29 15:46           ` Jonathan Cameron
2020-09-02  6:12           ` Alexandru Ardelean
2020-09-02  6:12             ` Alexandru Ardelean
2020-09-16  9:23 ` Alexandru Ardelean
2020-09-16  9:23   ` Alexandru Ardelean
2020-09-16 10:18   ` Fabrice Gasnier
2020-09-16 10:18     ` Fabrice Gasnier
2020-09-16 17:52     ` Jonathan Cameron
2020-09-16 17:52       ` 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='CA+U=DspjGUhXCY7c8P6zOYZsx17ybcU4Kdr52yujmdYOaa1JSQ@mail.gmail.com' \
    --to=ardeleanalex@gmail.com \
    --cc=alexandre.torgue@st.com \
    --cc=alexandru.ardelean@analog.com \
    --cc=fabrice.gasnier@st.com \
    --cc=jic23@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=sergiu.cuciurean@analog.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.