Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3228547imu; Sat, 24 Nov 2018 00:35:24 -0800 (PST) X-Google-Smtp-Source: AJdET5eqI0765pQ1rzgtXi3YfT1fI5LNQ15fdFZYftRPPhPQaOzvQ9uefizRoSS1h0moTqOgpTAU X-Received: by 2002:a62:399b:: with SMTP id u27mr20002134pfj.181.1543048524774; Sat, 24 Nov 2018 00:35:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543048524; cv=none; d=google.com; s=arc-20160816; b=CePRRxmicEvJT0sYG4f2F3XuG/LCmnpXLGsMqebz4mb1umLHp6ARVuI/haPaukRdNO XrquTwKP2JwTNJLowcrgVJLwkKqx1D1NO8Qt+HSvwfBaMjqnMNm82GWaSqB7JZzU4qAH 85p0B91TttZ83i4Lj7WQmdoqCk38kcMAOmw/n8xjRjT0jyD8BGQV49jnvJsbrwgEMqpX nL/C5Alb2oVWSL7ScUcHTq0ceIpvP97b6Rxag4tV0b4qnkvEdoUCgGnCOI2StrsnS85o sDzn+FU0Trnkn5F3Dnl+L2Hlvn0QH7cBGbxLsUMwlUzWCmxpZTVAaodKYj1gfPfMh1PI UbWg== 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=bpnDR76b2ZWMdalr8msjn9gA+Yzx3m0B9/yJrM442Bs=; b=QfNaew1/pWNZvZC3MVP2Wc2Zbv0JtUXlcOgi6NvTGPo1PNksIM5KF+pohtZw1PMAOC 4xks0YAPNVM/mZn5nHd+fFnQ0SbcOuG1L6hhYkhQShJ7wkPqp6GSXQ8BikxTzyR/7oBi O4Rqd6A5uHwONiQWh2tFsYgKaqV6D6qyYG1CgMsULWVhlCxOnUU75x0eL+JmFSqWn+BT u2tvz0ZApN8krYYEwb8TyKvRJ/jGh+o1N5wlhdk3hlNVvsswK9WfaqMqetNUxdGefnar 0J57JvWcPrdGZHi3l8eku/MUyAvouzOq2Kv9MdJr2Du88IiJkNLK1x1B/NHBtByl5mYK 6vmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Y1thfCxl; 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 r25si16166193pfk.28.2018.11.24.00.35.10; Sat, 24 Nov 2018 00:35:24 -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=Y1thfCxl; 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 S2504566AbeKXAJj (ORCPT + 99 others); Fri, 23 Nov 2018 19:09:39 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:55682 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390938AbeKXAJj (ORCPT ); Fri, 23 Nov 2018 19:09:39 -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=bpnDR76b2ZWMdalr8msjn9gA+Yzx3m0B9/yJrM442Bs=; b=Y1thfCxldSN4HGDr/bMRotnot +oy0ZjqYbl0tbdc8T3K3YcWOLGxiW6tH9N/vuylUMFbJzLe9UUW/pt84VuMG09iQlWHV0WCyLCf6F Xjb4H37akdCS0+JgY5Hf6mtPqJz+Pzuq5Gjwwpidd8gX9w871/n5l590KCRjVFbp72lc0=; 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 1gQBSV-000134-7O; Fri, 23 Nov 2018 13:25:23 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 4247A440078; Fri, 23 Nov 2018 13:25:22 +0000 (GMT) Date: Fri, 23 Nov 2018 13:25:22 +0000 From: Mark Brown To: Charles Keepax Cc: Linus Walleij , Liam Girdwood , Marek Szyprowski , "linux-kernel@vger.kernel.org" , patches@opensource.cirrus.com Subject: Re: [PATCH 3/3] gpio: Add reference counting for non-exclusive GPIOs Message-ID: <20181123132522.GE2089@sirena.org.uk> References: <20181122173015.23905-1-ckeepax@opensource.cirrus.com> <20181122173015.23905-3-ckeepax@opensource.cirrus.com> <20181123105729.GM16508@imbe.wolfsonmicro.main> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Z79+P6LHXcBZ81w+" Content-Disposition: inline In-Reply-To: <20181123105729.GM16508@imbe.wolfsonmicro.main> 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 --Z79+P6LHXcBZ81w+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Nov 23, 2018 at 10:57:29AM +0000, Charles Keepax wrote: > It's fixing something in the case of two regulators using the > same GPIO. The direction this patch chain takes is that the end > drivers own the GPIOs not the regulator core (except for the > legacy case). So both of the end drivers will devm_ request their The situation with descriptor based GPIOs is a bug - the reason why the core does the request in the legacy case is precisely the problem Linus identified. Once a GPIO is shared all the users of the GPIO need to coordinate with each other in order to set the value so the refcount by itself in the GPIO core isn't super useful unless it can also serve to help the multiple users find each other somehow. I think what we want to do here is either push the gpiod requests into the regulator core or change things so that once the regulator is registered with the regulator core the regulator core owns and is responsible for freeing the regulator. --Z79+P6LHXcBZ81w+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlv3/8EACgkQJNaLcl1U h9CngAf/VsSmqhxP8B88PyMCu9jvoNGZV92/zflmxH90MoJCULb/hYaovGGWRr8i ywXaT2Z2v60U9nb2gIAsXV0OcuzCSPKz+546I47AKdP9L6Ib168Y90qKLEe+GN0r HR18HPVfzd30RDPykJfFpLh7CZVPuPQcZOxTOQup2TRzYTFU6iEAwjMBHwd0IckW bk+DFxAmeF9a+uDeb3BfIWlBN/qRDarUW/H8ihBgj33RSxmtg24WuMO6v1TvH3Do qom5VoHbPuPtk75wdvbetJQ1/RZAmJ/mNf6HVPGkDPbH9Qel50wk1XYuYCtbDLZN j7/UA2NddoyPWsVgGxnKEXklYVswMA== =SGoR -----END PGP SIGNATURE----- --Z79+P6LHXcBZ81w+--