Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp19331ybp; Tue, 8 Oct 2019 13:18:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyWKzEFKKHfMelqQKaWVO7kK775G/MF18ZcBXFcsEopnRVFctUweKgl4NrV0hhuYqqUFo/b X-Received: by 2002:a50:ab83:: with SMTP id u3mr35455561edc.228.1570565902813; Tue, 08 Oct 2019 13:18:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570565902; cv=none; d=google.com; s=arc-20160816; b=mxDkrxwrqHdJy4xayr/iQWKftGDZYiOLjTCnMOka7rKNyMY21P19Q8OAUm7ZFpEk5j SCvDrp3vujN+BGtEtuC83/DTHJXtSiHREfY2dPiKNvDwK2bo0v177PdaN6abKsT2pwnC R3WKfjH9SEY6qDMPJqJlxqa8rZDc7sUUdRmunLicQixDms5PhEeKJgSQtsSiJCzeTFwW vdktNjlWt2rNENlePoHG8reHgkKZC4JL+LR2Q38ifTyn2Z7BM2E9vxwRAe+c0SA5ci2L 5qCIcFZU/bNRudnv7cvORf6NNK8qEb2CSBSRflVuh1Ql4eUFXjbNn0hKp0scPi0y3NV/ p5OQ== 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=QgYF+fuZS4u2/bbCZgEP98eW1QqjFnaOxuOYGsAbbgw=; b=u5NGemxlJeruLasBRrMa7JGNNTO8LiMSBlVIjGncCLNZUkzKj2gcMuCZmDr3giIhI/ QtMIfNc62BGAA7dGi9ieBfHn8T/EfngB/TkJseNw+kxHhvG9UgWMWDWm2bsnhWcopecz qCVR404qbwAj2ht8hTpIZenlKtDQm/YUXxoQkL/hbYyLGxsr/y6O2f3NS+PYJ20tgwcN 7HF2sMh+8tRQdHW0NgGoEbx8ygNtV8vi8HPZV4GLg1ZK1Fw5LUH2PztXJYL9AJ3cdtJc eKPI1eGhwTziBT4FeV4igguxoHpIm+R9lFmf0be7bKplRCx/qxi+N+OOQGbq2aaA4xSM wr1g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rh9si9356733ejb.102.2019.10.08.13.17.59; Tue, 08 Oct 2019 13:18:22 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730787AbfJHUQ2 (ORCPT + 99 others); Tue, 8 Oct 2019 16:16:28 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:52181 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727570AbfJHUQ2 (ORCPT ); Tue, 8 Oct 2019 16:16:28 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iHvuB-0000Y3-ML; Tue, 08 Oct 2019 22:16:23 +0200 Received: from mfe by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1iHvuA-00059u-9F; Tue, 08 Oct 2019 22:16:22 +0200 Date: Tue, 8 Oct 2019 22:16:22 +0200 From: Marco Felsch To: Mark Brown Cc: Doug Anderson , Chunyan Zhang , Liam Girdwood , ckeepax@opensource.cirrus.com, LKML , Sascha Hauer Subject: Re: [PATCH 1/3] regulator: core: fix boot-on regulators use_count usage Message-ID: <20191008201622.b7ev4nfyhqapspon@pengutronix.de> References: <20190927084710.mt42454vsrjm3yh3@pengutronix.de> <20191007093429.qekysnxufvkbirit@pengutronix.de> <20191007182907.GB5614@sirena.co.uk> <20191008060311.3ukim22vv7ywmlhs@pengutronix.de> <20191008125140.GK4382@sirena.co.uk> <20191008145605.5yf4hura7qu4fuyg@pengutronix.de> <20191008154213.GL4382@sirena.co.uk> <20191008161640.2fzqhrbc4ox6gjal@pengutronix.de> <20191008162333.GP4382@sirena.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191008162333.GP4382@sirena.co.uk> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 22:04:44 up 144 days, 2:22, 98 users, load average: 0.07, 0.11, 0.04 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19-10-08 17:23, Mark Brown wrote: > On Tue, Oct 08, 2019 at 06:16:40PM +0200, Marco Felsch wrote: > > On 19-10-08 16:42, Mark Brown wrote: > > > > If this is a GPIO regulator then the Linux APIs mean you can't read the > > > status back so it's one of the regulators for which this property was > > > invented. This is a real limitation of the Linux APIs, with most > > > hardware you can actually read the status back so we shouldn't need > > > this. > > > I know and I followed the discussion between you and Doug. But it > > is a valid use-case to have a external gpio-enabled regualtor connected > > to a panel. If I don't mark the regulator as 'regualtor-boot-on' and use > > the fixed.c driver (IMHO this is correct), the regulator gets disabled > > during probe. So I will have a panel off/ panel on sequence during boot. > > Right, this is why I am saying that this is one of the regulators for > which this property was defined and where you should be using it. > > > To avoid this I set the 'regualtor-boot-on' property but then I can't > > disable the panel during suspend.. > > As you'll have seen from the discussion that's a bug, nothing should be > taking a reference to the regulator outside of explicit enable calls. Okay now we are on the right way :) Is the solution proposed by Doug: ".. we need to match "regulator->enable_count" to "rdev->use_count" at the end of _regulator_get() in the exclusive case..." the correct fix? Another question. Please can you have a look on the "DA9062 PMIC fixes and features" series as well? Regards, Marco