linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Neil Armstrong <narmstrong@baylibre.com>,
	jbrunet@baylibre.com, khilman@baylibre.com
Cc: martin.blumenstingl@googlemail.com,
	linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org
Subject: Re: [RFC/RFT 05/14] soc: amlogic: meson-clk-measure: protect measure with a mutex
Date: Wed, 26 Jun 2019 11:06:45 -0700	[thread overview]
Message-ID: <20190626180646.9CC94208E3@mail.kernel.org> (raw)
In-Reply-To: <2ceca0ca-8f8e-78a8-df39-67a763f28f30@baylibre.com>

Quoting Neil Armstrong (2019-06-26 01:24:47)
> On 25/06/2019 22:27, Stephen Boyd wrote:
> > Quoting Neil Armstrong (2019-06-20 08:00:04)
> >> In order to protect clock measuring when multiple process asks for
> >> a mesure, protect the main measure function with mutexes.

s/mesure/measure/

> >>
> >> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> >> ---
> >>  drivers/soc/amlogic/meson-clk-measure.c | 12 +++++++++++-
> >>  1 file changed, 11 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/soc/amlogic/meson-clk-measure.c b/drivers/soc/amlogic/meson-clk-measure.c
> >> index 19d4cbc93a17..c470e24f1dfa 100644
> >> --- a/drivers/soc/amlogic/meson-clk-measure.c
> >> +++ b/drivers/soc/amlogic/meson-clk-measure.c
> >> @@ -11,6 +11,8 @@
> >>  #include <linux/debugfs.h>
> >>  #include <linux/regmap.h>
> >>  
> >> +static DEFINE_MUTEX(measure_lock);
> >> +
> >>  #define MSR_CLK_DUTY           0x0
> >>  #define MSR_CLK_REG0           0x4
> >>  #define MSR_CLK_REG1           0x8
> >> @@ -360,6 +362,10 @@ static int meson_measure_id(struct meson_msr_id *clk_msr_id,
> >>         unsigned int val;
> >>         int ret;
> >>  
> >> +       ret = mutex_lock_interruptible(&measure_lock);
> > 
> > Why interruptible?
> 
> 
> I supposed _interruptible was needed since it's called from userspace via
> debugfs, locking indefinitely isn't wanted, no ? or maybe I missed something...
> 

Sounds plausible to me.


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

  reply	other threads:[~2019-06-26 18:06 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20 14:59 [RFC/RFT 00/14] arm64: g12a: add support for DVFS Neil Armstrong
2019-06-20 15:00 ` [RFC/RFT 01/14] pinctrl: meson-g12a: add pwm_a on GPIOE_2 pinmux Neil Armstrong
2019-06-20 15:00 ` [RFC/RFT 02/14] clk: core: introduce clk_hw_set_parent() Neil Armstrong
2019-06-25 20:32   ` Stephen Boyd
2019-06-26  8:22     ` Neil Armstrong
2019-06-20 15:00 ` [RFC/RFT 03/14] clk: meson: regmap: export regmap_div ops functions Neil Armstrong
2019-06-20 15:00 ` [RFC/RFT 04/14] clk: meson: eeclk: add setup callback Neil Armstrong
2019-06-20 15:00 ` [RFC/RFT 05/14] soc: amlogic: meson-clk-measure: protect measure with a mutex Neil Armstrong
2019-06-25 20:27   ` Stephen Boyd
2019-06-26  8:24     ` Neil Armstrong
2019-06-26 18:06       ` Stephen Boyd [this message]
2019-06-20 15:00 ` [RFC/RFT 06/14] soc: amlogic: meson-clk-measure: add G12B second cluster cpu clk Neil Armstrong
2019-06-20 15:00 ` [RFC/RFT 07/14] clk: meson: g12a: add notifiers to handle cpu clock change Neil Armstrong
2019-06-25 20:31   ` Stephen Boyd
2019-06-26  8:27     ` Neil Armstrong
2019-06-20 15:00 ` [RFC/RFT 08/14] clk: meson: g12a: expose CPUB clock ID for G12B Neil Armstrong
2019-06-20 15:00 ` [RFC/RFT 10/14] arm64: dts: meson-g12-common: add pwm_a on GPIOE_2 pinmux Neil Armstrong
2019-06-20 15:00 ` [RFC/RFT 11/14] arm64: dts: meson-g12a: add cpus OPP table Neil Armstrong
2019-06-20 15:00 ` [RFC/RFT 12/14] arm64: dts: meson-g12a: enable DVFS on G12A boards Neil Armstrong
2019-06-20 15:00 ` [RFC/RFT 13/14] arm64: dts: meson-g12b: add cpus OPP tables Neil Armstrong
2019-06-20 15:00 ` [RFC/RFT 14/14] arm64: dts: meson-g12b-odroid-n2: enable DVFS Neil Armstrong
2019-06-24  8:22   ` Neil Armstrong

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=20190626180646.9CC94208E3@mail.kernel.org \
    --to=sboyd@kernel.org \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=narmstrong@baylibre.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;
as well as URLs for NNTP newsgroup(s).