From patchwork Mon Jan 12 15:54:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Baker X-Patchwork-Id: 42967 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2D1682055F for ; Mon, 12 Jan 2015 15:55:15 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id ex7sf7055557wid.3 for ; Mon, 12 Jan 2015 07:55:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=9kUCrf62ekcxoO4vrID3XDP4Xg3Ba2RqZu5Mi24e4jg=; b=E9ZpwjFMVkOa+MdaVBAXUUBnDSHtNFo6/qIktbBBqEl9o/e7VThzLFRl/wUtCcQdd3 KeGu/c0tbPVfo1xV7t8fdzbDy03Nwy4WMZV+7Sxq0Kv91UfIsPJZ061On0FJHi0S+tF1 BDtfvImEI9VrFlLx+hRCvJYUfgb+52eLlXi3N3W3OQ1YYjxVkjIsUupHdNu9SaRtBOb0 2L8tojtbrytMnLG7fNHXrMlSYauJ1pMDm7bIsvzfkB5nZhxvlHGdiP38cJg016UGvEpg s88CSxUodaPMy2Ctl8k2QejtdWf/gzJ6bw4j5ZezrhpPRyo9kuBJNGTz3lWYQ1h0HhBx 7cgw== X-Gm-Message-State: ALoCoQm3ONumjWdenxgtuq45JJ3ffoa9cG6tkCUwVBs5YJqAbY8vaFph3JlHVu4Y62EXpJYlHFKn X-Received: by 10.112.72.228 with SMTP id g4mr3863994lbv.4.1421078114473; Mon, 12 Jan 2015 07:55:14 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.49 with SMTP id bd17ls633918lab.14.gmail; Mon, 12 Jan 2015 07:55:14 -0800 (PST) X-Received: by 10.152.204.9 with SMTP id ku9mr37461252lac.55.1421078114317; Mon, 12 Jan 2015 07:55:14 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id n2si21655006lbs.48.2015.01.12.07.55.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Jan 2015 07:55:14 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id hs14so24798254lab.8 for ; Mon, 12 Jan 2015 07:55:14 -0800 (PST) X-Received: by 10.112.14.6 with SMTP id l6mr37802941lbc.91.1421078114171; Mon, 12 Jan 2015 07:55:14 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp1117726lbb; Mon, 12 Jan 2015 07:55:13 -0800 (PST) X-Received: by 10.68.138.194 with SMTP id qs2mr45107527pbb.8.1421078112048; Mon, 12 Jan 2015 07:55:12 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jv6si23863906pbc.29.2015.01.12.07.55.11; Mon, 12 Jan 2015 07:55:12 -0800 (PST) Received-SPF: none (google.com: stable-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751952AbbALPzK (ORCPT + 1 other); Mon, 12 Jan 2015 10:55:10 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:50404 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751614AbbALPzJ (ORCPT ); Mon, 12 Jan 2015 10:55:09 -0500 Received: by mail-pa0-f41.google.com with SMTP id rd3so32734964pab.0 for ; Mon, 12 Jan 2015 07:55:09 -0800 (PST) X-Received: by 10.68.223.196 with SMTP id qw4mr45410838pbc.26.1421078108897; Mon, 12 Jan 2015 07:55:08 -0800 (PST) Received: from localhost.localdomain ([173.14.250.228]) by mx.google.com with ESMTPSA id mb9sm14755609pdb.40.2015.01.12.07.55.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Jan 2015 07:55:07 -0800 (PST) From: Tyler Baker To: linux-arm-kernel@lists.infradead.org, arm@kernel.org Cc: Maxime Ripard , Philipp Zabel , Tyler Baker , Subject: [PATCH RESEND] reset: sunxi: fix spinlock initialization Date: Mon, 12 Jan 2015 07:54:46 -0800 Message-Id: <1421078086-27946-1-git-send-email-tyler.baker@linaro.org> X-Mailer: git-send-email 2.1.3 Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: tyler.baker@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Call spin_lock_init() before the spinlocks are used, both in early init and probe functions preventing a lockdep splat. I have been observing lockdep complaining [1] during boot on my a80 optimus [2] when CONFIG_PROVE_LOCKING has been enabled. This patch resolves the splat, and has been tested on a few other sunxi platforms without issue. [1] http://storage.kernelci.org/next/next-20150107/arm-multi_v7_defconfig+CONFIG_PROVE_LOCKING=y/lab-tbaker/boot-sun9i-a80-optimus.html [2] http://kernelci.org/boot/?a80-optimus Signed-off-by: Tyler Baker Cc: --- drivers/reset/reset-sunxi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/reset/reset-sunxi.c b/drivers/reset/reset-sunxi.c index eebc52c..3d95c87 100644 --- a/drivers/reset/reset-sunxi.c +++ b/drivers/reset/reset-sunxi.c @@ -102,6 +102,8 @@ static int sunxi_reset_init(struct device_node *np) goto err_alloc; } + spin_lock_init(&data->lock); + data->rcdev.owner = THIS_MODULE; data->rcdev.nr_resets = size * 32; data->rcdev.ops = &sunxi_reset_ops; @@ -157,6 +159,8 @@ static int sunxi_reset_probe(struct platform_device *pdev) if (IS_ERR(data->membase)) return PTR_ERR(data->membase); + spin_lock_init(&data->lock); + data->rcdev.owner = THIS_MODULE; data->rcdev.nr_resets = resource_size(res) * 32; data->rcdev.ops = &sunxi_reset_ops;