All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Lee Jones <lee@kernel.org>, Eric Anholt <eric@anholt.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	bcm-kernel-feedback-list@broadcom.com,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Tomasz Figa <tomasz.figa@gmail.com>,
	Kukjin Kim <kgene@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Mark Brown <broonie@kernel.org>,
	linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	linux-i2c@vger.kernel.org, alsa-
Subject: Re: [RFC 00/17] clk: Add per-controller locks to fix deadlocks
Date: Fri, 19 Aug 2016 18:58:47 +0200	[thread overview]
Message-ID: <20160819165847.GA7100@kozik-lap> (raw)
In-Reply-To: <20160819144640.GM21682@localhost.localdomain>

On Fri, Aug 19, 2016 at 03:46:40PM +0100, Charles Keepax wrote:
> On Tue, Aug 16, 2016 at 03:51:10PM +0200, Krzysztof Kozlowski wrote:
> > On 08/16/2016 03:34 PM, Krzysztof Kozlowski wrote:
> > > Hi,
> > > 
> > > RFC, please, do not apply, maybe except patch #1 which is harmless.
> > > 
> > > 
> > > Introduction
> > > ============
> > > The patchset brings new entity: clock controller representing a hardware
> > > block.  The clock controller comes with its own prepare lock which
> > > is used then in many places.  The idea is to fix the deadlock mentioned
> > > in commit 10ff4c5239a1 ("i2c: exynos5: Fix possible ABBA deadlock by keeping
> > > I2C clock prepared") and commit 34e81ad5f0b6 ("i2c: s3c2410: fix ABBA deadlock
> > > by keeping clock prepared").
> > > 
> > 
> > Damn, I forgot to describe the overall idea. :) It is mentioned in patch
> > 15 but probably not many will have enough of patience to reach it.
> > 
> > The locking idea
> > ================
> > Clock controllers representing different hardware blocks, will contain
> > its own prepare lock which protects the clocks inside controller.  The
> > hierarchy itself is protected by global lock.
> > 
> > In prepare path, the global prepare lock is removed.  This is direct
> > solution for the deadlock.
> > 
> > Clock hierarchy imposes also hierarchy between controllers so when a
> > prepare happens, also parents have to be locked.
> > 
> > Following locking design was chosen:
> > 1. For prepare/unprepare paths: lock only clock controller and its
> >    parents.
> > 2. For recalc rates paths: lock global lock, the controller and its
> >    children.
> > 3. For reparent paths: lock entire tree up down (children and parents)
> >    and the global lock as well.
> > 
> > 
> > In each case of traversing the clock hierarchy, the locking of
> > controllers is always from children to parents.
> > 
> > 
> > Best regards,
> > Krzysztof
> 
> I have been playing with these patches on my Arndale board and
> they certainly do seem to resolve the interaction issues I have
> been SPI and the clocking framework, which is awesome and lets me
> sensibly add the clocking framework into our codec drivers. I will
> keep investigating and for what its worth have a little more
> detailed look through the code.

I am really happy to hear it!

Along with other Samsung guys from Poland we really spent a lot of time
figuring out all the locking cases, possible scenarios and new issues
which could come out of it.

I am glad that it solves also other people's cases, not only ours!

Certainly there is a lot of things to improve in the patchset. Probably
merging the new "clock controller" entity into clock provider makes
sense.

Best regards,
Krzysztof

WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Lee Jones <lee@kernel.org>, Eric Anholt <eric@anholt.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	bcm-kernel-feedback-list@broadcom.com,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Tomasz Figa <tomasz.figa@gmail.com>,
	Kukjin Kim <kgene@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Mark Brown <broonie@kernel.org>,
	linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	linux-i2c@vger.kernel.org, alsa-devel@alsa-project.org,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Javier Martinez Canillas <javier@osg.samsung.com>,
	a.hajda@samsung.com,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: Re: [RFC 00/17] clk: Add per-controller locks to fix deadlocks
Date: Fri, 19 Aug 2016 18:58:47 +0200	[thread overview]
Message-ID: <20160819165847.GA7100@kozik-lap> (raw)
In-Reply-To: <20160819144640.GM21682@localhost.localdomain>

On Fri, Aug 19, 2016 at 03:46:40PM +0100, Charles Keepax wrote:
> On Tue, Aug 16, 2016 at 03:51:10PM +0200, Krzysztof Kozlowski wrote:
> > On 08/16/2016 03:34 PM, Krzysztof Kozlowski wrote:
> > > Hi,
> > > 
> > > RFC, please, do not apply, maybe except patch #1 which is harmless.
> > > 
> > > 
> > > Introduction
> > > ============
> > > The patchset brings new entity: clock controller representing a hardware
> > > block.  The clock controller comes with its own prepare lock which
> > > is used then in many places.  The idea is to fix the deadlock mentioned
> > > in commit 10ff4c5239a1 ("i2c: exynos5: Fix possible ABBA deadlock by keeping
> > > I2C clock prepared") and commit 34e81ad5f0b6 ("i2c: s3c2410: fix ABBA deadlock
> > > by keeping clock prepared").
> > > 
> > 
> > Damn, I forgot to describe the overall idea. :) It is mentioned in patch
> > 15 but probably not many will have enough of patience to reach it.
> > 
> > The locking idea
> > ================
> > Clock controllers representing different hardware blocks, will contain
> > its own prepare lock which protects the clocks inside controller.  The
> > hierarchy itself is protected by global lock.
> > 
> > In prepare path, the global prepare lock is removed.  This is direct
> > solution for the deadlock.
> > 
> > Clock hierarchy imposes also hierarchy between controllers so when a
> > prepare happens, also parents have to be locked.
> > 
> > Following locking design was chosen:
> > 1. For prepare/unprepare paths: lock only clock controller and its
> >    parents.
> > 2. For recalc rates paths: lock global lock, the controller and its
> >    children.
> > 3. For reparent paths: lock entire tree up down (children and parents)
> >    and the global lock as well.
> > 
> > 
> > In each case of traversing the clock hierarchy, the locking of
> > controllers is always from children to parents.
> > 
> > 
> > Best regards,
> > Krzysztof
> 
> I have been playing with these patches on my Arndale board and
> they certainly do seem to resolve the interaction issues I have
> been SPI and the clocking framework, which is awesome and lets me
> sensibly add the clocking framework into our codec drivers. I will
> keep investigating and for what its worth have a little more
> detailed look through the code.

I am really happy to hear it!

Along with other Samsung guys from Poland we really spent a lot of time
figuring out all the locking cases, possible scenarios and new issues
which could come out of it.

I am glad that it solves also other people's cases, not only ours!

Certainly there is a lot of things to improve in the patchset. Probably
merging the new "clock controller" entity into clock provider makes
sense.

Best regards,
Krzysztof

WARNING: multiple messages have this Message-ID (diff)
From: krzk@kernel.org (Krzysztof Kozlowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 00/17] clk: Add per-controller locks to fix deadlocks
Date: Fri, 19 Aug 2016 18:58:47 +0200	[thread overview]
Message-ID: <20160819165847.GA7100@kozik-lap> (raw)
In-Reply-To: <20160819144640.GM21682@localhost.localdomain>

On Fri, Aug 19, 2016 at 03:46:40PM +0100, Charles Keepax wrote:
> On Tue, Aug 16, 2016 at 03:51:10PM +0200, Krzysztof Kozlowski wrote:
> > On 08/16/2016 03:34 PM, Krzysztof Kozlowski wrote:
> > > Hi,
> > > 
> > > RFC, please, do not apply, maybe except patch #1 which is harmless.
> > > 
> > > 
> > > Introduction
> > > ============
> > > The patchset brings new entity: clock controller representing a hardware
> > > block.  The clock controller comes with its own prepare lock which
> > > is used then in many places.  The idea is to fix the deadlock mentioned
> > > in commit 10ff4c5239a1 ("i2c: exynos5: Fix possible ABBA deadlock by keeping
> > > I2C clock prepared") and commit 34e81ad5f0b6 ("i2c: s3c2410: fix ABBA deadlock
> > > by keeping clock prepared").
> > > 
> > 
> > Damn, I forgot to describe the overall idea. :) It is mentioned in patch
> > 15 but probably not many will have enough of patience to reach it.
> > 
> > The locking idea
> > ================
> > Clock controllers representing different hardware blocks, will contain
> > its own prepare lock which protects the clocks inside controller.  The
> > hierarchy itself is protected by global lock.
> > 
> > In prepare path, the global prepare lock is removed.  This is direct
> > solution for the deadlock.
> > 
> > Clock hierarchy imposes also hierarchy between controllers so when a
> > prepare happens, also parents have to be locked.
> > 
> > Following locking design was chosen:
> > 1. For prepare/unprepare paths: lock only clock controller and its
> >    parents.
> > 2. For recalc rates paths: lock global lock, the controller and its
> >    children.
> > 3. For reparent paths: lock entire tree up down (children and parents)
> >    and the global lock as well.
> > 
> > 
> > In each case of traversing the clock hierarchy, the locking of
> > controllers is always from children to parents.
> > 
> > 
> > Best regards,
> > Krzysztof
> 
> I have been playing with these patches on my Arndale board and
> they certainly do seem to resolve the interaction issues I have
> been SPI and the clocking framework, which is awesome and lets me
> sensibly add the clocking framework into our codec drivers. I will
> keep investigating and for what its worth have a little more
> detailed look through the code.

I am really happy to hear it!

Along with other Samsung guys from Poland we really spent a lot of time
figuring out all the locking cases, possible scenarios and new issues
which could come out of it.

I am glad that it solves also other people's cases, not only ours!

Certainly there is a lot of things to improve in the patchset. Probably
merging the new "clock controller" entity into clock provider makes
sense.

Best regards,
Krzysztof

  reply	other threads:[~2016-08-19 16:58 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-16 13:34 [RFC 00/17] clk: Add per-controller locks to fix deadlocks Krzysztof Kozlowski
2016-08-16 13:34 ` Krzysztof Kozlowski
2016-08-16 13:34 ` [RFC 01/17] clk: bcm2835: Rename clk_register to avoid name conflict Krzysztof Kozlowski
2016-08-16 13:34   ` Krzysztof Kozlowski
2016-08-16 13:34   ` Krzysztof Kozlowski
2016-08-16 13:34 ` [RFC 02/17] clk: Add clock controller to fine-grain the prepare lock Krzysztof Kozlowski
2016-08-16 13:34   ` Krzysztof Kozlowski
2016-08-16 13:34   ` Krzysztof Kozlowski
2016-08-16 13:35 ` [RFC 03/17] clk: s2mps11: Switch to new clock controller API Krzysztof Kozlowski
2016-08-16 13:35   ` Krzysztof Kozlowski
2016-08-16 13:35   ` Krzysztof Kozlowski
2016-08-16 13:35 ` [RFC 04/17] clk: samsung: Allocate a clock controller in context Krzysztof Kozlowski
2016-08-16 13:35   ` Krzysztof Kozlowski
2016-08-16 13:35 ` [RFC 05/17] clk: fixed-rate: Switch to new clock controller API Krzysztof Kozlowski
2016-08-16 13:35   ` Krzysztof Kozlowski
2016-08-16 13:35 ` [RFC 06/17] clk: gate: " Krzysztof Kozlowski
2016-08-16 13:35   ` Krzysztof Kozlowski
2016-08-16 13:35 ` [RFC 07/17] clk: mux: " Krzysztof Kozlowski
2016-08-16 13:35   ` Krzysztof Kozlowski
2016-08-16 13:35   ` Krzysztof Kozlowski
2016-08-16 13:35 ` [RFC 08/17] clk: fixed-factor: " Krzysztof Kozlowski
2016-08-16 13:35   ` Krzysztof Kozlowski
2016-08-16 13:35 ` [RFC 09/17] clk: divider: " Krzysztof Kozlowski
2016-08-16 13:35   ` Krzysztof Kozlowski
2016-08-16 13:35 ` [RFC 10/17] clk: composite: " Krzysztof Kozlowski
2016-08-16 13:35   ` Krzysztof Kozlowski
2016-08-16 13:35 ` [RFC 11/17] clk: gpio: " Krzysztof Kozlowski
2016-08-16 13:35   ` Krzysztof Kozlowski
2016-08-16 13:35 ` [RFC 12/17] ASoC: samsung: " Krzysztof Kozlowski
2016-08-16 13:35   ` Krzysztof Kozlowski
2016-08-16 14:13   ` Mark Brown
2016-08-16 14:13     ` Mark Brown
2016-08-16 14:13     ` Mark Brown
2016-08-16 16:41     ` Krzysztof Kozlowski
2016-08-16 16:41       ` Krzysztof Kozlowski
2016-08-16 16:41       ` Krzysztof Kozlowski
2016-08-16 13:35 ` [RFC 13/17] clk: samsung: audss: " Krzysztof Kozlowski
2016-08-16 13:35   ` Krzysztof Kozlowski
2016-08-16 13:35 ` [RFC 14/17] clk: samsung: clkout: " Krzysztof Kozlowski
2016-08-16 13:35   ` Krzysztof Kozlowski
2016-08-16 13:35 ` [RFC 15/17] clk: Use per-controller locking Krzysztof Kozlowski
2016-08-16 13:35   ` Krzysztof Kozlowski
2016-08-16 13:35 ` [RFC 16/17] Revert "i2c: exynos5: Fix possible ABBA deadlock by keeping I2C clock prepared" Krzysztof Kozlowski
2016-08-16 13:35   ` Krzysztof Kozlowski
2016-08-16 13:35 ` [RFC 17/17] Revert "i2c: s3c2410: fix ABBA deadlock by keeping " Krzysztof Kozlowski
2016-08-16 13:35   ` Krzysztof Kozlowski
2016-08-16 13:51 ` [RFC 00/17] clk: Add per-controller locks to fix deadlocks Krzysztof Kozlowski
2016-08-16 13:51   ` Krzysztof Kozlowski
2016-08-19 14:46   ` Charles Keepax
2016-08-19 14:46     ` Charles Keepax
2016-08-19 14:46     ` Charles Keepax
2016-08-19 16:58     ` Krzysztof Kozlowski [this message]
2016-08-19 16:58       ` Krzysztof Kozlowski
2016-08-19 16:58       ` Krzysztof Kozlowski
2016-08-19 19:31 ` Javier Martinez Canillas
2016-08-19 19:31   ` Javier Martinez Canillas
2016-08-19 19:31   ` Javier Martinez Canillas
2016-08-20 16:03   ` Krzysztof Kozlowski
2016-08-20 16:03     ` Krzysztof Kozlowski
2016-08-20 16:03     ` Krzysztof Kozlowski
2016-09-09  0:24 ` Stephen Boyd
2016-09-09  0:24   ` Stephen Boyd
2016-09-09  0:24   ` Stephen Boyd
2016-11-04 10:53   ` Marek Szyprowski
2016-11-04 10:53     ` Marek Szyprowski
2016-11-04 10:53     ` Marek Szyprowski
2016-11-12  2:38     ` Stephen Boyd
2016-11-12  2:38       ` Stephen Boyd
2016-11-12  2:38       ` Stephen Boyd

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=20160819165847.GA7100@kozik-lap \
    --to=krzk@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.wolfsonmicro.com \
    --cc=eric@anholt.net \
    --cc=f.fainelli@gmail.com \
    --cc=k.kozlowski@samsung.com \
    --cc=kgene@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mturquette@baylibre.com \
    --cc=rjui@broadcom.com \
    --cc=s.nawrocki@samsung.com \
    --cc=sboyd@codeaurora.org \
    --cc=sbranden@broadcom.com \
    --cc=swarren@wwwdotorg.org \
    --cc=tomasz.figa@gmail.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.