Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3499895imb; Tue, 5 Mar 2019 10:55:34 -0800 (PST) X-Google-Smtp-Source: APXvYqywVfaCDtaKMu0OjAznOZHHI/zccis2H246yDnFRyxNjgzQBpnmeIc6daRwDQCy95FxOCus X-Received: by 2002:a62:e086:: with SMTP id d6mr3277128pfm.247.1551812134053; Tue, 05 Mar 2019 10:55:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551812134; cv=none; d=google.com; s=arc-20160816; b=oAY6XEq52zOJWlLAht1EMtbpeLJAmwXTFYN9cJXSH3BW8wmHixYkIk2xq6eMXmH1r6 0l/tRC+6K+n4UOU4mgndqiiPWMpLP1pmIPzLCiq30QN2xW+9VK6CLU12+lyDUmxIvrho pn3xY3CGYGiRpLosSLxZ8rBvx2PlIaOJn9EcRD3X9/Tucc9E9IXz+6A3xq0PFQH5pajg mrDy9z0arfzKN01fVwpBq7sLQXcVQOdKpP/81uAbgOHwJrkp0o5qGI63QdizTQx88zEr WUIPmqjH5o5DzAtwBWxk7MUSyMnYeHdOjDxROQwTkyrXdnWlSQumOoFml0cdfXTirDx1 sdJA== 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=sJfXV63mb/qXxzqeGoX7B5xoN8n33/hVUapeThQonzg=; b=wDrB4PGQvwtrNfUaG9Ln5ttqWcpYdH3qtKW3o01yihVXJL2ieSc9wcmJkgGBXskqHc E7U01C0lFBAVhpewA7Q7ZZrccSwp79ofGJ2KkGbBugm90cLCc1ixDWcTkmpEn+6h244i Wc49U/TyrxYG25mjJ3/tsPpOSOoPqBNRXG1QaJfs7tUpRlDH9V4TkS/OlO2g6pqesylv fIem/GwkqIXc/a4BiJmfSftFFcVCJS1OmBFsdFTusHphvYlsaUKYfEgf0Txwt+WGpdg8 MYB+T1SaJfBPme60lFSqWEszZiPWlC0mhS/5171L969Mx6Tm4VRR9CD/zaCId4TLbQRG Samg== 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 v9si8248039pgr.462.2019.03.05.10.55.19; Tue, 05 Mar 2019 10:55:34 -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 S1730941AbfCESIl (ORCPT + 99 others); Tue, 5 Mar 2019 13:08:41 -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 S1730887AbfCESIe (ORCPT ); Tue, 5 Mar 2019 13:08:34 -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 CC/2D-18573-D1BBE7C5; Tue, 05 Mar 2019 18:08:29 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHIsWRWlGSWpSXmKPExsVy8IPnUV2Z3XU xBnMeGVlMffiEzeLblQ4mi8u75rBZfH6/n9WBxWPnrLvsHptWdbJ5TJ/zn9Hj8ya5AJYo1sy8 pPyKBNaMS//fMBcc5qyY+XoGSwPjXI4uRi4OIYF1jBJXzu1g72LkBHIqJPat+8IIYvMKJEtMO bGLGcTmFHCUONi7jhWixkGi8fZfNhCbTcBQYt6b92D1LAKqEnvPTQerERYIkFh05yqYLSLgId G6fQMzyDJmgT5Gic3nL7BBLBCUODnzCQuIzSwgIXHwxQugIg6gBVoSy49FgoQlBOwlpr+/Cha WENCXaDwWCxE2lPg+6xsLhG0ucXv1A9YJjIKzkAydhWToAkamVYwWSUWZ6RkluYmZObqGBga6 hoZGuoaWxkBsppdYpZuol1qqW55aXKJrqJdYXqxXXJmbnJOil5dasokRGPYpBQeP7GDcsCL9E KMkB5OSKG9fV12MEF9SfkplRmJxRnxRaU5q8SFGGQ4OJQleh11AOcGi1PTUirTMHGAEwqQlOH iURHjFdwKleYsLEnOLM9MhUqcYdTlOL3w4l1mIJS8/L1VKnPcUSJEASFFGaR7cCFgyuMQoKyX My8jAwCDEU5BalJtZgir/ilGcg1FJmJcFZApPZl4J3KZXQEcwAR3x+XI1yBEliQgpqQbGgBqR PMXVy/TvMsWrfkw1vhGY9ujgo18rFF/3dUo81mo9q/W7gv+O2dT7RqcTD9wNZQpeIOBd9pnhV zI72/Gogi3HtMKbPr+8KyYW+y/6RY5fBO+VHdlLbLTPmj8xqwxrqkw9/1t59orTarPeST4TVP tb9If1WeUTF7Unb52jX3/xmHsq7cduJZbijERDLeai4kQAY453DQEDAAA= X-Env-Sender: stwiss.opensource@diasemi.com X-Msg-Ref: server-20.tower-262.messagelabs.com!1551809306!2441267!12 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 30312 invoked from network); 5 Mar 2019 18:08:28 -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:28 -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:27 +0000 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22547) id 44F443FC16; Tue, 5 Mar 2019 18:08:25 +0000 (GMT) Message-ID: In-Reply-To: References: From: Steve Twiss Date: Tue, 26 Feb 2019 15:51:28 +0000 Subject: [PATCH 12/13] regulator: wm831x isink: Fix notifier mutex lock warning To: Liam Girdwood , Mark Brown CC: Support Opensource , LKML , Cirrus Patches 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: d4d6b722e780 ("regulator: Add WM831x ISINK support") Suggested-by: Adam Thomson Signed-off-by: Steve Twiss --- drivers/regulator/wm831x-isink.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/regulator/wm831x-isink.c b/drivers/regulator/wm831x-isink.c index 6dd891d..11f3511 100644 --- a/drivers/regulator/wm831x-isink.c +++ b/drivers/regulator/wm831x-isink.c @@ -140,9 +140,11 @@ static irqreturn_t wm831x_isink_irq(int irq, void *data) { struct wm831x_isink *isink = data; + regulator_lock(isink->regulator); regulator_notifier_call_chain(isink->regulator, REGULATOR_EVENT_OVER_CURRENT, NULL); + regulator_unlock(isink->regulator); return IRQ_HANDLED; } -- 1.9.3