Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4812200ybl; Wed, 22 Jan 2020 05:14:45 -0800 (PST) X-Google-Smtp-Source: APXvYqxZfkM8mbJ2/lIgcBIsQpoC8S1mTu/xmCjF/Sk1FsnQvzwLkzzoXohBgs1pSoxm7uqvxhJo X-Received: by 2002:a05:6830:1482:: with SMTP id s2mr7557138otq.285.1579698884839; Wed, 22 Jan 2020 05:14:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579698884; cv=none; d=google.com; s=arc-20160816; b=AQRTbUpGCmFcK10205Thyqrjw2jhNie60lVFin9cYexhzTNggdB+tLBLQEcz3YYWg9 zpd8S69vNeWgLpxNqJmEY2MU8RVEnacCEFUhpctdITMGgQWD3+yDwNyBXkUaXM1LEh5e 7nxqMkGDkVTYJ85L5bXYBGqFejpxM/gshjBu52uaVPDxSaCYkTNtJhy5lv2HkpDwtmNm LUjSDrYSwjqz0+4mwNpkJKxj64JILisEnOQtPixabMev0eOEhnNbtGlG2xveIusf4Yed MI6mnxjYSVPtsD23FdaTvbdpZygTKHIFJ5i5hUovSW6tZ677ZTydzk8zIzGAmoOjE2Bt YY9A== 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; bh=obbbHkLOxznO0hidWvhpAPFRxYBQ6J+ZWf8/UqqCk8k=; b=egZRGjUsgdsNY7690BHwbz4ilph2lFcKBhBWO5Zn6K4Qjau7J4b8FsukWvTc8Cmt4j kDMeT5PO6oEszEqrHnTZ9nKthPTtFGlJKaVv8gJHkU4GKzIsgBa3UJTvLqT3Jj6+qdGU KUF9Fh1nYVNEUKOeaKcM6KncknnyS8ctVkJLsb2Dkpp1ag99Ea3qKyNXjFVAzurqVYEx U3upQVT7btO8Q/kRQnggqDEw32LT7cMFlyCsb8t1R/4hWycKRufbt999mUxrJiihomXF tcCSPG0WQLPZZ9qdGQi80Y1gZdoOzriKBcQ7NRIDSDNxSVWw7Q7jAdHTde3iD39EWL0o EdMA== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n63si21041724oib.210.2020.01.22.05.14.32; Wed, 22 Jan 2020 05:14:44 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729078AbgAVNLx (ORCPT + 99 others); Wed, 22 Jan 2020 08:11:53 -0500 Received: from foss.arm.com ([217.140.110.172]:56150 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726204AbgAVNLw (ORCPT ); Wed, 22 Jan 2020 08:11:52 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 02BF5328; Wed, 22 Jan 2020 05:11:52 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 753053F52E; Wed, 22 Jan 2020 05:11:51 -0800 (PST) Date: Wed, 22 Jan 2020 13:11:49 +0000 From: Mark Brown To: Charles Keepax Cc: lee.jones@linaro.org, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: Re: [PATCH RESEND 1/2] regulator: arizona-ldo1: Improve handling of regulator unbinding Message-ID: <20200122131149.GE3833@sirena.org.uk> References: <20200122110842.10702-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6Vw0j8UKbyX0bfpA" Content-Disposition: inline In-Reply-To: <20200122110842.10702-1-ckeepax@opensource.cirrus.com> X-Cookie: Sorry. Nice try. 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 --6Vw0j8UKbyX0bfpA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jan 22, 2020 at 11:08:41AM +0000, Charles Keepax wrote: > The current unbinding process for Madera has some issues. The trouble > is runtime PM is disabled as the first step of the process, but Why not just leave runtime PM active until all the subdevices are gone? This is a really bad hack and it's going to be fragile. > +static int madera_ldo1_remove(struct platform_device *pdev) > +{ > + struct madera *madera = dev_get_drvdata(pdev->dev.parent); > + > + if (madera->internal_dcvdd) { > + regulator_disable(madera->dcvdd); > + regulator_put(madera->dcvdd); > + } This is going to break bisection since it will result in double disables, it'd be fine to do the MFD change first since that'd just leak a reference to enable on a regulator which is about to be discarded entirely anyway but this reordering (and whatever other changes you've done since v1) means you add a double free. --6Vw0j8UKbyX0bfpA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl4oShUACgkQJNaLcl1U h9CRBQf+Ijrft01UkH7p9btVXS1AKfXkd5ggu68R37BbucUWTIqSN6lVCWzodHCJ g7SWU1KfNIypcFQKb6AN03jTYgeJJeT0JdTgalYcw9wFcIRqWkiiqJGPAIp0k+K3 aGTM+KVt69FqwZxsfMqEQllViB0pMu9OU8kPWmv9dzYnnVzbEzY1qawwjqclW4Fy X/GHdpG46obSpswt6y+AQYm1rYAY64OxWTV5SvFW6ocTQzNgj8QWo6dwE5YA8a/B DRk6PDVCp2bZTlvB0QsMLNs65xEW7U1o+hImyDVmFxyzbr3Yx2Et+WLZs3cAdwjb J6bEwkJK24RNMxXPBtfJW0P7fio/Sg== =K55M -----END PGP SIGNATURE----- --6Vw0j8UKbyX0bfpA--