Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2745979imj; Mon, 18 Feb 2019 11:23:19 -0800 (PST) X-Google-Smtp-Source: AHgI3IbkyTSe1CnrPBgF7uR9cJzIxYkQW04K/eyqnlhICriD2O6N3lt2ysidZAnCZHHOIo+Y1gc9 X-Received: by 2002:a62:8a51:: with SMTP id y78mr25373865pfd.225.1550517799683; Mon, 18 Feb 2019 11:23:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550517799; cv=none; d=google.com; s=arc-20160816; b=vYXrMpHhMc2EI9kjC/GK+3nSMeDupY6Pwmx3Tvd3yNFU4u6m6BiyYIGKbKITuiENY6 V12tRVMTW+FBQb2ZatzEQENaR0bbmrXBe763hrPJAOvEjqQD9+Jl2FI6TJU2SCjyjsnt imwegRvl/BVZXjnE33atJvr8p7z7ngjo+5f/913LSqLyrdQPmqFenoI9aGDfe21pZEIM 7a6kqnh9FmV6yqKXBEm7K8tQdrdBBGVbGplnG1o6hYj49UMmKkCOnIzs0VYKK9wM21DK 2G2m5+aMZPXwqer2I8p54uFfkUbOCUksyzr2kHRAWhU4e+om0DYPilPEUa471fW8MD8K ipJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GmDXdx1avJwt1OEiG6XY+QjIIG5CZ7dyXr4TZoV5NBI=; b=CTUm8TWANsCWDZKgJ00CIXmbRtJJz5RKJpRp+1kMjO3V+xj62OLU8eojVkIvDin0I2 2AmzzA94O/9ufLk3bzBI8rkWAO8yiFaC27fCApzr0UHOfwrTwIenQTKGvFN1CYyvTXhs BBvbgww9Axc5qqgzbormD5coFBJw7muf2dWhQg6q9ubnBrf6vYv0bcinURGfeN800AjO XcSX08IqK5u/NOGt7TtO0oZH+pG7vJNzPVueJz3j3E6MVBUwIdm4yafLSMc2AEORfCB9 CcjdhPbGO7URExf8iTTFWa/DT2+JKV/eIQ2HSRnOYIIMZGdn8U1N4XrriJscz42egg8m oDDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=KLoZOW1S; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si10841746pgh.98.2019.02.18.11.23.04; Mon, 18 Feb 2019 11:23:19 -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; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=KLoZOW1S; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726505AbfBRSjs (ORCPT + 99 others); Mon, 18 Feb 2019 13:39:48 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:53568 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726166AbfBRSjs (ORCPT ); Mon, 18 Feb 2019 13:39:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=GmDXdx1avJwt1OEiG6XY+QjIIG5CZ7dyXr4TZoV5NBI=; b=KLoZOW1SYNozc8kL2HyYdRvlm fgL278SxxmtfSa0pVmhy3ZPkWqTHllcOafeyceu77zrKOir2ZnmsHt75kPaKFVF7hCa+mp+oIEPZA /gSPzvdJxzSIEXACOwPQ1uMf7yJHw1YodrS/vJYFCfxWmVAAiY+9ygOaP0kpzVPnYCoMo=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1gvnpR-0001bH-BM; Mon, 18 Feb 2019 18:39:45 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 93F7C1128008; Mon, 18 Feb 2019 18:39:44 +0000 (GMT) Date: Mon, 18 Feb 2019 18:39:44 +0000 From: Mark Brown To: Niklas Cassel Cc: Liam Girdwood , linux-kernel@vger.kernel.org Subject: Re: [PATCH] regulator: core: Take lock before applying system load Message-ID: <20190218183944.GH10794@sirena.org.uk> References: <20190215105533.10264-1-niklas.cassel@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mYYhpFXgKVw71fwr" Content-Disposition: inline In-Reply-To: <20190215105533.10264-1-niklas.cassel@linaro.org> X-Cookie: Take an astronaut to launch. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --mYYhpFXgKVw71fwr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 15, 2019 at 11:55:33AM +0100, Niklas Cassel wrote: > Take the regulator lock before applying system load. >=20 > Fixes the following lockdep splat: >=20 > [ 5.583581] WARNING: CPU: 1 PID: 16 at drivers/regulator/core.c:925 dr= ms_uA_update+0x114/0x360 > [ 5.588467] Modules linked in: > [ 5.596833] CPU: 1 PID: 16 Comm: kworker/1:0 Not tainted 5.0.0-rc6-nex= t-20190213-00002-g0fce66ab480f #18 Please think hard before including complete backtraces in upstream reports, they are very large and contain almost no useful information relative to their size so often obscure the relevant content in your message. If part of the backtrace is usefully illustrative then it's usually better to pull out the relevant sections. > * We'll only apply the initial system load if an > * initial mode wasn't specified. > */ > + regulator_lock(rdev); > drms_uA_update(rdev); > + regulator_unlock(rdev); This is correct in that it will shut up the warning but we're not supposed to need locks at this point as the regulator is in the process of being registered so there should be no possibility of concurrent access. Since I can't see a sensible way to conditionally assert that the lock is held we're probably better off just removing the annotation since it's no longer valid. --mYYhpFXgKVw71fwr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlxq++8ACgkQJNaLcl1U h9CfQQf7BZp5BHXpjAQWoCMvuZsFJCDZYABNLNQbHiK3SWETGmDGMsB/bM7tAzaI CKFjvduHrN9tNxJlwU3NE19omVR1mW3B8OVFZK6cxCUpit8id8q1U2QR7F/CND+/ Ebiaac8rMcp3jb9f9LVCSNurDEXUcnaWxTCuWzAUCPRIqnVsTPe7gaYARspzpehC 387KzhjTcbMafYNgBDkI5AeTi99TUXVxLRfAIl12ZYT4TPDc6OIrHHroOp+ak4IT soY2z1yvqjTp7pnl+Iehs6JeaECEsl2u6TrIAYt5s5Fu9cN6PeNnY5WdkbUTQoek cc91+Y+SbIp1ZztP/mPQmEo7BVhotw== =fMxO -----END PGP SIGNATURE----- --mYYhpFXgKVw71fwr--