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: 5611271 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0FDAF9F357 for ; Mon, 12 Jan 2015 16:04:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3C2442064D for ; Mon, 12 Jan 2015 16:04:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7450C2017E for ; Mon, 12 Jan 2015 16:03:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YAhQJ-0004UA-06; Mon, 12 Jan 2015 16:00:59 +0000 Received: from mail-pd0-f180.google.com ([209.85.192.180]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YAhL2-0007zv-SE for linux-arm-kernel@lists.infradead.org; Mon, 12 Jan 2015 15:55:33 +0000 Received: by mail-pd0-f180.google.com with SMTP id fl12so31015344pdb.11 for ; Mon, 12 Jan 2015 07:55:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=dhAmac51/GLKPPX3Fv9C94co/txjOr4TPjuLg7hY8XM=; b=fF+2+QylupQlg8FBN8Vt+ms3T5kcDUr4lQApV63cei5A8pj3Sti3ihSPYzMjdO7v46 AOiTvPVUp2Rh9y4H/SsCzZm3IfObXWNpw3jCFixM1y4GkXrG9KU3PlSY7lj5xUAHkzi8 WNyNEtmwuQ6b3tWMvwW+5B9UTVVp9qxCIxwL3Xyo/kVmDo+dXPp3Z8QD1t/jMNIvc9ps VSt9WrKCx9+7i7JCcni+JXJW8yK4qrl6bG9+G21NH79D9D4N3Oql4SaC1GOfrf8bIXh2 SpjesEPzeLWP5UfeeyaW8eWVyE3kNJhiZViw5eN9cuFh2SEJuxTpj+bz1dlsH+XD3stH SzuA== X-Gm-Message-State: ALoCoQm8vnDkBFMRH9yUS5rTNxkIUJ40a0Rh25fF4zN+W6/xifXfjdECdtdutxx2vRelFh1awQGo 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150112_075533_032050_1D894004 X-CRM114-Status: UNSURE ( 9.25 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: Maxime Ripard , Tyler Baker , stable@vger.kernel.org, Philipp Zabel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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: Acked-by: Maxime Ripard Acked-by: Philipp Zabel --- 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;