Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755332AbbB0UIs (ORCPT ); Fri, 27 Feb 2015 15:08:48 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:45633 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754697AbbB0UIr (ORCPT ); Fri, 27 Feb 2015 15:08:47 -0500 Date: Fri, 27 Feb 2015 12:08:46 -0800 From: Greg KH To: Doug Anderson Cc: Mark Brown , milo.kim@ti.com, axel.lin@ingics.com, Dmitry Torokhov , olof@lixom.net, javier.martinez@collabora.co.uk, Paul Stewart , stable@vger.kernel.org, lgirdwood@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] regulator: core: Fix enable GPIO reference counting Message-ID: <20150227200846.GA17514@kroah.com> References: <1425066064-18920-1-git-send-email-dianders@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1425066064-18920-1-git-send-email-dianders@chromium.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1429 Lines: 33 On Fri, Feb 27, 2015 at 11:41:03AM -0800, Doug Anderson wrote: > It is possible for _regulator_do_enable() to be called for an > already-enabled rdev, like in regulator_suspend_finish(). If we were > using an enable pin (rdev->ena_pin is set) then we'd end up > incrementing the reference count in regulator_ena_gpio_ctrl() over and > over again without a decrement. That prevented the GPIO from going to > the "off" state even after all users were disabled. > > Fix this by avoiding the call to regulator_ena_gpio_ctrl() when it's > not needed. > > Signed-off-by: Doug Anderson > Fixes: 967cfb18c0e3 ("regulator: core: manage enable GPIO list") > --- > FYI: this was developed and tested against a 3.14 kernel with > backports; I've done basic boot testing against upstream and sanity > checked the code but haven't done as extensive testing there. > > drivers/regulator/core.c | 20 ++++++++++++-------- > 1 file changed, 12 insertions(+), 8 deletions(-) This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/