From patchwork Mon Apr 18 11:49:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 66022 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1236262qge; Mon, 18 Apr 2016 04:49:56 -0700 (PDT) X-Received: by 10.98.66.89 with SMTP id p86mr48483030pfa.42.1460980196580; Mon, 18 Apr 2016 04:49:56 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w79si1279207pfi.231.2016.04.18.04.49.56; Mon, 18 Apr 2016 04:49:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753262AbcDRLty (ORCPT + 29 others); Mon, 18 Apr 2016 07:49:54 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:51838 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752509AbcDRLtx (ORCPT ); Mon, 18 Apr 2016 07:49:53 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id u3IBno7r031292; Mon, 18 Apr 2016 06:49:50 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u3IBno1u031674; Mon, 18 Apr 2016 06:49:50 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Mon, 18 Apr 2016 06:49:49 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u3IBnl2q024627; Mon, 18 Apr 2016 06:49:48 -0500 From: Tero Kristo To: , , Subject: [PATCH] regulator: core: remove lockdep assert from suspend_prepare Date: Mon, 18 Apr 2016 14:49:53 +0300 Message-ID: <1460980193-10085-1-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org suspend_prepare can be called during regulator init time also, where the mutex is not locked yet. This causes a false lockdep warning. To avoid the problem, remove the lockdep assertion from the function causing the issue. An alternative would be to lock the mutex during init, but this would cause other problems (some APIs used during init will attempt to lock the mutex also, causing deadlock.) Signed-off-by: Tero Kristo Reported-by: Tomi Valkeinen --- drivers/regulator/core.c | 2 -- 1 file changed, 2 deletions(-) -- 1.7.9.5 diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 73b7683..b63302e 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -808,8 +808,6 @@ static int suspend_set_state(struct regulator_dev *rdev, /* locks held by caller */ static int suspend_prepare(struct regulator_dev *rdev, suspend_state_t state) { - lockdep_assert_held_once(&rdev->mutex); - if (!rdev->constraints) return -EINVAL;