Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3499195imb; Tue, 5 Mar 2019 10:54:07 -0800 (PST) X-Google-Smtp-Source: APXvYqzj3BoZQXrC6malYqXTcTSmkUollYw92uiYqlcb9RRdYDuVGVqOQh0k1X0SRWZRi4qdejuo X-Received: by 2002:a17:902:930b:: with SMTP id bc11mr2763239plb.101.1551812047048; Tue, 05 Mar 2019 10:54:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551812047; cv=none; d=google.com; s=arc-20160816; b=y7E2yXlTphgMlnZmVYXsRFM9D1tvWQM1x+dY1G5VyHKvUqWuhrnMG4PWuOf/OPg3Ha HAcbTQoI63jX5R1Pv1LrB3E8nbIdN1ZGPrG/3x9XfUDZlrzMa3Sx9nKiRGrzggqONSB6 XCXwlLDnIYRF6pxCeQH1u2kf/MePhxzM7LMVoWoFSDXn3Ss+AEc/dQDjHl7jxFbq0z7R pi1Hevay0oGYWCnkc+9csKBD7Ix779rt1KKptlKWg142HydQGPEjHfjzQgVjkKkMsWls /pxikywEpKJsC8IAu6FTkR7FfoFUmNnuUfznppJE4ul6oBFKQRy5UI7ctsWJlSwNt3/k xjNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:cc:to:subject:date:from :references:in-reply-to:message-id; bh=XkVS0jAJ8UtUl0y7EQvavbLFi8dT6GLsfmDHSKSPVj4=; b=Nn+ZQGIlCCN+dEVhtKPKUH4Pl5jr6mo/3ad+ycO6+OM3SSeEr6uN6D4Th+xW2eJBvz 5zixORglsWQv78s9S0VvleUnwvb3AMXSmyKCWTxHso2N8NMoCHCQ9FCL1WBGZbXHrLTE /QLia+Bn68zyqZ4TYVh3ad8aTkTuQ2OMK47tkVfbXAj49tKL+SAn7lloDNKIB4k8ageT F/Okc3l7kBtwoXTPtaNe2jSL83KasLpRQ+o2A2U3QQPl3pyZrCVJsCAgUJ1JbcWUjXc7 AqGhHq204oWWWwbvcPIr+VnqzpxHZ05K7ndGniqUmZ/gasUllbgFALTnQli0NRqF2RHF u2sw== ARC-Authentication-Results: i=1; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=diasemi.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x18si1346166pgx.302.2019.03.05.10.53.52; Tue, 05 Mar 2019 10:54:07 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=diasemi.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730877AbfCESIb (ORCPT + 99 others); Tue, 5 Mar 2019 13:08:31 -0500 Received: from mail1.bemta25.messagelabs.com ([195.245.230.2]:11250 "EHLO mail1.bemta25.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726296AbfCESIa (ORCPT ); Tue, 5 Mar 2019 13:08:30 -0500 Received: from [46.226.52.98] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-2.bemta.az-a.eu-west-1.aws.symcld.net id F8/1D-18573-B1BBE7C5; Tue, 05 Mar 2019 18:08:27 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIIsWRWlGSWpSXmKPExsVy8IPnUV2p3XU xBt8vG1tMffiEzeLblQ4mi8u75rA5MHvsnHWX3WPTqk42j8+b5AKYo1gz85LyKxJYM37MXcZW cJWzYt/XD4wNjLs5uhi5OIQE1jFKfH/3jrmLkRPIqZBYtvQdE4jNK5AssfDIE0YQm1PAUeJg7 zpWiBoHicbbf9lAbDYBQ4l5b94D1XBwsAioSjy4GwYSFhbwlNh5finYSBEBD4nW7RvAbGaBWI nz85ayQIwXlDg58wkLRFxC4uCLF8wgY4QEtCSWH4sECUsI2EtMf38VLCwhoC/ReCwWImwo8X3 WNxYI21zi9uoHrBMYBWchGToLydAFjEyrGM2TijLTM0pyEzNzdA0NDHQNDY10DS2NdU3N9RKr dBP1Ukt1y1OLS3QN9RLLi/WKK3OTc1L08lJLNjECgzul4KDlDsZTy9MPMUpyMCmJ8vZ11cUI8 SXlp1RmJBZnxBeV5qQWH2KU4eBQkuB12AWUEyxKTU+tSMvMAcYZTFqCg0dJhFd8J1Cat7ggMb c4Mx0idYpRl+P0wodzmYVY8vLzUqXEeU+BFAmAFGWU5sGNgMX8JUZZKWFeRgYGBiGegtSi3Mw SVPlXjOIcjErCvCwgU3gy80rgNr0COoIJ6IjPl6tBjihJREhJNTB6+Mspcs9eptcUXuT96JCt grh70aUNU3scBbdr1BqcvrYnevJFlboJNy7dfLtx9rctu+9wNRsHGwR32NyN6Gbdf0lTpqH+r Gje0ksbz5jaNcdfn293udp5QuCtJQeeT7zQvUGzcvZ26VfmSmeNnh57anbE947f28VyfD3u9/ NO5pWudi/O3tClxFKckWioxVxUnAgAU699t/QCAAA= X-Env-Sender: stwiss.opensource@diasemi.com X-Msg-Ref: server-20.tower-262.messagelabs.com!1551809306!2441267!2 X-Originating-IP: [193.240.73.197] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.31.5; banners=-,-,- X-VirusChecked: Checked Received: (qmail 30120 invoked from network); 5 Mar 2019 18:08:26 -0000 Received: from unknown (HELO sw-ex-cashub01.diasemi.com) (193.240.73.197) by server-20.tower-262.messagelabs.com with AES128-SHA256 encrypted SMTP; 5 Mar 2019 18:08:26 -0000 Received: from swsrvapps-01.diasemi.com (10.20.28.141) by SW-EX-CASHUB01.diasemi.com (10.20.16.140) with Microsoft SMTP Server id 14.3.408.0; Tue, 5 Mar 2019 18:08:25 +0000 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22547) id 2942C3FAF4; Tue, 5 Mar 2019 18:08:25 +0000 (GMT) Message-ID: <8c6986eee295d5859c8267f0228f7508a22bd4fd.1551808797.git.stwiss.opensource@diasemi.com> In-Reply-To: References: From: Steve Twiss Date: Tue, 26 Feb 2019 14:59:59 +0000 Subject: [PATCH 01/13] regulator: da9055: Fix notifier mutex lock warning To: Liam Girdwood , Mark Brown CC: Support Opensource , LKML MIME-Version: 1.0 Content-Type: text/plain X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-ServerInfo: sw-ex-cashub01.diasemi.com, 9 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 05/03/2019 17:23:00 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The mutex for the regulator_dev must be controlled by the caller of the regulator_notifier_call_chain(), as described in the comment for that function. Failure to mutex lock and unlock surrounding the notifier call results in a kernel WARN_ON_ONCE() which will dump a backtrace for the regulator_notifier_call_chain() when that function call is first made. The mutex can be controlled using the regulator_lock/unlock() API. Fixes: f6130be652d0 ("regulator: DA9055 regulator driver") Suggested-by: Adam Thomson Signed-off-by: Steve Twiss --- drivers/regulator/da9055-regulator.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/regulator/da9055-regulator.c b/drivers/regulator/da9055-regulator.c index 588c3d24..acba42d 100644 --- a/drivers/regulator/da9055-regulator.c +++ b/drivers/regulator/da9055-regulator.c @@ -515,8 +515,10 @@ static irqreturn_t da9055_ldo5_6_oc_irq(int irq, void *data) { struct da9055_regulator *regulator = data; + regulator_lock(regulator->rdev); regulator_notifier_call_chain(regulator->rdev, REGULATOR_EVENT_OVER_CURRENT, NULL); + regulator_unlock(regulator->rdev); return IRQ_HANDLED; } -- 1.9.3