Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3230989imu; Sat, 24 Nov 2018 00:38:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/UL/gA27K7btqlpUBMkY3ZMqheZ/9rVvRiCdJQAzTVdxtbnWMa0YDvphtv/d/lt3MgzMR5l X-Received: by 2002:a63:a91a:: with SMTP id u26mr17009152pge.349.1543048738197; Sat, 24 Nov 2018 00:38:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543048738; cv=none; d=google.com; s=arc-20160816; b=zX7mtuPzm3NqS46opoWjyixNEZXlOp0qyvxcDaqZtBEhB6aQUc/ENCdbGf1AOfIxp9 phyb87QOK+k2BSSup1nbluliq9B6+P4WbDD2ITdijYkZe3UnQhVvV5BypVX5oYVxc9oX FGpRXjTZQJEA0O8wJq0si45UCook9EzKd5Qhrw0hAqqLtB7M6juvzIxhOTFZztm56hKm py+8qwpRf0fF0tmFz4eagdrDjOB02IgQlxDxck4IaDsiQJz++wHMj3rhL50p32SxhgBa IorOyZPN6WpnjFrTUeTiCQyjlOpdVTWrkXBpEpS6vBIs/t+2KswNReBC99n8dYe5RJM4 UpKg== 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=/JJwB45EoaxunINPe3KOwMlCsvvM4My6si5MoeNOYZg=; b=oPbl+MoWpK8i6nscsVsYSpHaP2RhzijbK1orrwAn4r9ZB7Pb+3pax9xEPP4ewf+0aH Yg8W504wO3Q30ACgBB47waofFrS+etFiZz4sY6YGuoCu0EtJvUItlgiE68w6yYJU/OKC RfiNAKMScOfLTEm33z/N3kRzRHfFrBy7M2/5v2Sl5iooLO9XMc9CE2ZEioDt54uEzvKo FFz1f68F2ptYwOBSc3luY6V8GQyfNhz7UJMQ8wp55Ainjeca0uKWc9qLFM3nHj7P1001 vOOzLjvZzkEAUlM9i23k4TMfIziN79Hy4QMyQPGRMWfP8ky3LR/w7cjnxk0H2bPDgNav 9iCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=RULTzOUc; 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 e5-v6si62231188pfa.232.2018.11.24.00.38.44; Sat, 24 Nov 2018 00:38:58 -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=RULTzOUc; 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 S2440007AbeKXBKS (ORCPT + 99 others); Fri, 23 Nov 2018 20:10:18 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:44494 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731438AbeKXBKS (ORCPT ); Fri, 23 Nov 2018 20:10:18 -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=/JJwB45EoaxunINPe3KOwMlCsvvM4My6si5MoeNOYZg=; b=RULTzOUcJ13LVj5MD0hKQnkq8 EeaZ4mtd1+I6RabB+lwcG6+gNgonV1MyjdfdgLlyst9ADm7CA9zzUyCIHrOLpu/5T0hEwLzkoMNIs pni42DEzVDgJKAWz9EuLvkuiFFTLuNLCu5w35FdQ6Vt5s23r2ESDMxmxPEPHjFo7qR6cw=; Received: from [176.12.107.140] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gQCOw-0001B9-VE; Fri, 23 Nov 2018 14:25:47 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 93D22440078; Fri, 23 Nov 2018 14:25:44 +0000 (GMT) Date: Fri, 23 Nov 2018 14:25:44 +0000 From: Mark Brown To: Charles Keepax Cc: linus.walleij@linaro.org, lgirdwood@gmail.com, m.szyprowski@samsung.com, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: Re: [PATCH 2/3] regulator: Only free GPIOs if the core requested them Message-ID: <20181123142544.GI2089@sirena.org.uk> References: <20181122173015.23905-1-ckeepax@opensource.cirrus.com> <20181122173015.23905-2-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="17Nf1kE0PuD3oAGS" Content-Disposition: inline In-Reply-To: <20181122173015.23905-2-ckeepax@opensource.cirrus.com> X-Cookie: No Canadian coins. 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 --17Nf1kE0PuD3oAGS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Nov 22, 2018 at 05:30:14PM +0000, Charles Keepax wrote: > Currently, the regulator core will take ownership of any GPIO passed > into it. Makes end driver code fairly error prone as the normal devm_ > patterns of allocation don't work. Update the regulator core to only > free the GPIO if it requested it, this allows the drivers to manage the > GPIO lifetime as they normally would. I think this is fine in conjunction with patch 3 in that adding that patch sorts out the double free problems with shared regulators but without that pushing the GPIO management into the individual regulator drivers is going to create trouble as something needs to coordinate to make sure that we only free when the last user is gone. However even with patch 3 I think it'd be better to base this off the rest of Linus' series for converting to descriptors (which is currently sitting waiting for some more testing) since that will convert everything to descriptors and so remove the code that's doing requests in the core entirely. --17Nf1kE0PuD3oAGS Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlv4DecACgkQJNaLcl1U h9Cmqgf/esCjGRhqFLJVPAdbeVYlbTV0n6/iiEzwFXn5UfVle7ljW3KJ24tOTDqA sYK6H++Qs3JyXOwexI8/mxkjIqUfCOOCIsqSJcp//3BBgTKp0PcyuXmKvQ8qmaRp twohfzOskKGaQmITcCJ3RtRsN1FlgVnd/5um1KrIC9f6EZDu9Jdj7JaBEdZjp40a 0gRDzhx70m9TA8h1zdsZJ9VJKKngTumogT/BAd5b3RQJCZ8B2JrCgSx+TGBcWbHw TKcxr1K6kBrAA/+/NvEcHTDA8sn1TsEbS2Dfbk2YQEX7/AQ7PWpk83TvhAxFTcTr RtNRQ6UkajgYQe6rQEUxg9/cSN35yQ== =pxdb -----END PGP SIGNATURE----- --17Nf1kE0PuD3oAGS--