[PATCH v3 3/6] clk: imx: imx8mp: Add audiomix block control

Abel Vesa abel.vesa at linaro.org
Thu Aug 11 09:51:54 PDT 2022


On 22-08-11 18:38:49, Marek Vasut wrote:
> On 8/11/22 17:03, Abel Vesa wrote:
> > On 22-08-11 16:30:20, Marek Vasut wrote:
> > > On 8/11/22 16:20, Abel Vesa wrote:
> > > > On 22-08-04 11:31:33, Marek Vasut wrote:
> > > > > On 8/4/22 11:13, Peng Fan wrote:
> > > > > > > Subject: Re: [PATCH v3 3/6] clk: imx: imx8mp: Add audiomix block control
> > > > > > > 
> > > > > > > On 6/28/22 09:44, Abel Vesa wrote:
> > > > > > > > On 22-06-27 18:23:33, Marek Vasut wrote:
> > > > > > > > > On 6/27/22 17:35, Abel Vesa wrote:
> > > > > > > > > > On 22-06-25 03:32:32, Marek Vasut wrote:
> > > > > > > > > > > Unlike the other block control IPs in i.MX8M, the audiomix is
> > > > > > > > > > > mostly a series of clock gates and muxes. Model it as a large
> > > > > > > > > > > static table of gates and muxes with one exception, which is the
> > > > > > > > > > > PLL14xx . The PLL14xx SAI PLL has to be registered separately.
> > > > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > Again, there is a chance that the blk-ctrl driver might disable the
> > > > > > > > > > PD from under this.
> > > > > > > > > 
> > > > > > > > > Can you elaborate a bit more on this ? How/why do you think so ?
> > > > > > > > 
> > > > > > > > At some point, the PDs from the Audiomix IP block will be added to the
> > > > > > > > drivers/soc/imx/imx8mp-blk-ctrl.c. Then, you'll have 2 drivers with
> > > > > > > > the same address range and the imx8mp-blk-ctrl also has runtime PM
> > > > > > > enabled.
> > > > > > > 
> > > > > > > Why would the PDs be added into the block control driver?
> > > > > > > 
> > > > > > > The audiomix is purely a clock mux driver, not really a block control driver
> > > > > > > providing PDs of its own.
> > > > > > 
> > > > > > I recalled that with with blk-ctrl working as clock provider, there is dead lock
> > > > > > issue, if the blk-ctrl node has a power-domain entry. Not very sure.
> > > > > 
> > > > > How can I verify that ? Lockdep ?
> > > > > 
> > > > > I run this series for months and haven't seen a lock up or splat.
> > > > 
> > > > Audiomix (and every mix actually) has a PD. Once you add the PD, you'll
> > > > end up with an ABBA deadlock between genpd lock and clock prepare lock.
> > > 
> > > Unlike the other mix drivers, this is a pure clock driver, not a power
> > > domain driver. The PD is already available to this clock driver, see:
> > > [PATCH v3 5/6] arm64: dts: imx8mp: Add SAI, SDMA, AudioMIX
> > 
> > When you will enable the runtime PM for this driver, the deadlock is
> > going to happen and it will be in some scenario like:
> >      clk_disable_unused_subtree
> >        -> clk_prepare (takes prepare lock) (for a clock from your driver)
> > 	-> runtime pm (takes genpd lock)
> > 	  -> clk_prepare (tries to take prepare lock again) (for the clock of the PD)
> 
> Since you seem to have a test case, can you share the test case, verbatim,
> so I can reproduce it locally ?

I do not have a test case, but we do have a prior experience with this
happening.

> 
> I seem to be asking for that repeatedly and I am not getting any clear
> answer.

I do not have a board to test on anymore.

But anyway, lets apply it and if there is a problem, we can figure it
out later.

> 
> > > Can you please elaborate on the deadlock problem ?
> > > Because really, I just don't see it.
> > > 
> > > Were you able to reproduce the deadlock with this driver ?
> 
> [...]



More information about the linux-arm-kernel mailing list