Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1561351 > unrolled thread

[PATCH] clk: hisilicon: fix lock assignment

Started byLeo Yan <leo.yan@linaro.org>
First post2017-01-18 09:30 +0100
Last post2017-01-21 03:20 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] clk: hisilicon: fix lock assignment Leo Yan <leo.yan@linaro.org> - 2017-01-18 09:30 +0100
    Re: [PATCH] clk: hisilicon: fix lock assignment Stephen Boyd <sboyd@codeaurora.org> - 2017-01-21 00:00 +0100
      Re: [PATCH] clk: hisilicon: fix lock assignment Leo Yan <leo.yan@linaro.org> - 2017-01-21 03:20 +0100

#1561351 — [PATCH] clk: hisilicon: fix lock assignment

FromLeo Yan <leo.yan@linaro.org>
Date2017-01-18 09:30 +0100
Subject[PATCH] clk: hisilicon: fix lock assignment
Message-ID<t0TMZ-1Eh-11@gated-at.bofh.it>
In clock driver initialize phase the spinlock is missed to assignment
to struct clkgate_separated, finally there have no locking to protect
exclusive accessing for clock registers.

This bug introduces the console has no output after enable coresight
driver on 96borads Hikey; this is because console using UART3, which
has shared the same register with coresight clock enabling bit. After
applied this patch it can assign lock properly to protect exclusive
accessing, and console can work well after enabled coresight modules.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 drivers/clk/hisilicon/clkgate-separated.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/hisilicon/clkgate-separated.c b/drivers/clk/hisilicon/clkgate-separated.c
index a47812f..7908bc3 100644
--- a/drivers/clk/hisilicon/clkgate-separated.c
+++ b/drivers/clk/hisilicon/clkgate-separated.c
@@ -120,6 +120,7 @@ struct clk *hisi_register_clkgate_sep(struct device *dev, const char *name,
 	sclk->bit_idx = bit_idx;
 	sclk->flags = clk_gate_flags;
 	sclk->hw.init = &init;
+	sclk->lock = lock;
 
 	clk = clk_register(dev, &sclk->hw);
 	if (IS_ERR(clk))
-- 
2.7.4

[toc] | [next] | [standalone]


#1563979

FromStephen Boyd <sboyd@codeaurora.org>
Date2017-01-21 00:00 +0100
Message-ID<t1Qk1-4MH-1@gated-at.bofh.it>
In reply to#1561351
On 01/18, Leo Yan wrote:
> In clock driver initialize phase the spinlock is missed to assignment
> to struct clkgate_separated, finally there have no locking to protect
> exclusive accessing for clock registers.
> 
> This bug introduces the console has no output after enable coresight
> driver on 96borads Hikey; this is because console using UART3, which

s/borads/boards/

> has shared the same register with coresight clock enabling bit. After
> applied this patch it can assign lock properly to protect exclusive
> accessing, and console can work well after enabled coresight modules.
> 
> Signed-off-by: Leo Yan <leo.yan@linaro.org>

Is there a Fixes: tag needed?

Is coresight support merged into Linus' tree? I want to know if
this needs to be applied for v4.10 or can wait until v4.11.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [next] | [standalone]


#1564042

FromLeo Yan <leo.yan@linaro.org>
Date2017-01-21 03:20 +0100
Message-ID<t1Trz-6ME-7@gated-at.bofh.it>
In reply to#1563979
On Fri, Jan 20, 2017 at 02:58:27PM -0800, Stephen Boyd wrote:
> On 01/18, Leo Yan wrote:
> > In clock driver initialize phase the spinlock is missed to assignment
> > to struct clkgate_separated, finally there have no locking to protect
> > exclusive accessing for clock registers.
> > 
> > This bug introduces the console has no output after enable coresight
> > driver on 96borads Hikey; this is because console using UART3, which
> 
> s/borads/boards/
> 
> > has shared the same register with coresight clock enabling bit. After
> > applied this patch it can assign lock properly to protect exclusive
> > accessing, and console can work well after enabled coresight modules.
> > 
> > Signed-off-by: Leo Yan <leo.yan@linaro.org>
> 
> Is there a Fixes: tag needed?

Thanks for reviewing, will send new patch for upper comments.

> Is coresight support merged into Linus' tree? I want to know if
> this needs to be applied for v4.10 or can wait until v4.11.

No, Coresight patch has not been merged. Should meantion one thing is:
this issue impacts all gate clocks if they share same register, there
have many such kind clocks for Hi6220. So it's not only for coresight
and uart clocks.

Thanks,
Leo Yan

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web