From patchwork Sat Jan 21 02:26:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 9529739 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D91616020B for ; Sat, 21 Jan 2017 02:26:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B119828703 for ; Sat, 21 Jan 2017 02:26:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 940722870D; Sat, 21 Jan 2017 02:26:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19F3328703 for ; Sat, 21 Jan 2017 02:26:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752590AbdAUC0l (ORCPT ); Fri, 20 Jan 2017 21:26:41 -0500 Received: from mail-pg0-f54.google.com ([74.125.83.54]:35752 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751028AbdAUC0k (ORCPT ); Fri, 20 Jan 2017 21:26:40 -0500 Received: by mail-pg0-f54.google.com with SMTP id 194so28052400pgd.2 for ; Fri, 20 Jan 2017 18:26:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=XDMdugko7pCQEb7c+LquoopDAMOElQ+sWK77oKPClGc=; b=QNkkprVZfatLwCe9cF4bgldmiaVgY8aZCRnnePX0zgc+o7M50fdLMGp0QObN/obmCM cQzGy2DY7Zt602UUjzIKtunYYMN3KGW8MlGGCfJdnaJ/lV5H/mnw4lnj4fVWPzhnwHyM Z7ExQI9wzzM2k0+z8HV28rdmXGDIxg7Eo/yiw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=XDMdugko7pCQEb7c+LquoopDAMOElQ+sWK77oKPClGc=; b=exROpX8nvnzPWabdjopxUGmyr1dVsvD1QMcYoNlHMex/BvT8btgZ4J0wwzCdNvvFT2 4mj4kjUlzhAkBOM9w+J3Pc3mFWTmq0VsoSskw/M7lYTmVuIjtp+AnJ0aRWLKj3/Xm8At kpBX57LVQWfsHTiEUEsm8Xb6iYfP+WswWKWC3GCYYIgtKftqvUAbgtkUAMAFNCX9gVTo bkWoe7GZPKpGH7Y6cv2bKNzY54PWS3OediqM7jbE0q5WLzMbEojb9EwSuUsLTCAiEMaT Jhst50rWvw0uAf92hju7CCnd4JgHt8eRafbwO93d6CnU8229xR1j5Vklp5ZTZaQc/yH4 VHQw== X-Gm-Message-State: AIkVDXLJyN9zI1078ukRiokaNmsuHoMFR6cxBnbAQ8i+bLmDoo/lGHBdcudcB0b4ZI+nYVYc X-Received: by 10.99.3.5 with SMTP id 5mr20591176pgd.150.1484965600230; Fri, 20 Jan 2017 18:26:40 -0800 (PST) Received: from localhost.localdomain (61-216-91-114.HINET-IP.hinet.net. [61.216.91.114]) by smtp.gmail.com with ESMTPSA id w125sm19854006pgb.11.2017.01.20.18.26.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Jan 2017 18:26:39 -0800 (PST) From: Leo Yan To: Michael Turquette , Stephen Boyd , Leo Yan , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Guodong Xu , Haojian Zhuang , John Stultz Subject: [PATCH v2] clk: hisilicon: fix lock assignment Date: Sat, 21 Jan 2017 10:26:31 +0800 Message-Id: <1484965591-743-1-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 96boards 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. Fixes: 0aa0c95f743a ("clk: hisilicon: add common clock support") Signed-off-by: Leo Yan --- 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))