From patchwork Wed Jan 18 08:13:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 9522855 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 86CB56020A for ; Wed, 18 Jan 2017 08:20:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 791C728524 for ; Wed, 18 Jan 2017 08:20:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C96928539; Wed, 18 Jan 2017 08:20:29 +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 D027F28524 for ; Wed, 18 Jan 2017 08:20:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751204AbdARIU2 (ORCPT ); Wed, 18 Jan 2017 03:20:28 -0500 Received: from mail-pg0-f54.google.com ([74.125.83.54]:33469 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751157AbdARIU1 (ORCPT ); Wed, 18 Jan 2017 03:20:27 -0500 Received: by mail-pg0-f54.google.com with SMTP id 204so2816452pge.0 for ; Wed, 18 Jan 2017 00:20:27 -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=GrLa4RWlr1XqrnPK+GybcskjI5rIGE1WdZ+ZL0eOLxo=; b=assTPpEPqFrQGFdAbX2ZnJXReitXrj6tZs+TdBewziQSxDexBBTrbZiVV2dJHoa+ky hUhlPfZuJ6n7by0gmk/7Q0bQnDz1McnuPZsa2AhSHElbJEoY3SEohp5rnt+5sx9O8oYa hOL2X3dz5FWqGlOGoorOoYfr8Iv4Jf6U5qZsQ= 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=GrLa4RWlr1XqrnPK+GybcskjI5rIGE1WdZ+ZL0eOLxo=; b=Uy1tPPAuvumo05ZGuaLv2W9cufAT3Td6HPz6zaReiZhIeUltf2owbyI6YUBV9e6k7U NB9xZ1kNkLhNfJcfzetYJiHKZ+ZSZ4Yi1Or3LOWWasbmblEq6V4g8mDrZ5qDMs5j/uVO Mm9EfCpWeQGEWblQzqSrUSDvI+Bh0ailBf35e+sEmDdSTk7o5lAZxS1r6kQ8gYLmsjiy yFujNfZnQd9dp2LiWx2Q9L+wV0vVeNRf0KjMnxJ9StGcC6pSOWDoVzZ8rvRtp/rNLUJw NVKI2ZVQZyeRis+PU/oxI+0jRaQH55a3jwxeHnw9TWjvlNSG2OrbDM536Q/SBaoL4PDj jG9A== X-Gm-Message-State: AIkVDXJt3eW23ozsVHycfdRrta3GNIgaBMNHDcadv+ibj22kWTYvPFRYr4amDbvueDU3c1dT X-Received: by 10.98.192.72 with SMTP id x69mr2333419pff.129.1484727245984; Wed, 18 Jan 2017 00:14:05 -0800 (PST) Received: from localhost.localdomain ([103.192.224.50]) by smtp.gmail.com with ESMTPSA id u78sm61324910pfa.53.2017.01.18.00.13.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Jan 2017 00:14:04 -0800 (PST) From: Leo Yan To: Michael Turquette , Stephen Boyd , Leo Yan , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Haojian Zhuang , Guodong Xu , John Stultz Subject: [PATCH] clk: hisilicon: fix lock assignment Date: Wed, 18 Jan 2017 16:13:38 +0800 Message-Id: <1484727218-3499-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 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 --- 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))