Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2544512rwd; Fri, 9 Jun 2023 12:56:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4AlasKJqoGf0N4N783Fvaf9oYQMNq+z9xcUZdktRaI9nSB8YseLp0TMOAzqrnQivWg3csu X-Received: by 2002:a05:6a00:3a29:b0:662:f0d0:a77d with SMTP id fj41-20020a056a003a2900b00662f0d0a77dmr2056280pfb.30.1686340609488; Fri, 09 Jun 2023 12:56:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686340609; cv=none; d=google.com; s=arc-20160816; b=Pt365MMAwE0G/110Ztf4rUmE8Ub/HmxaJ9qGXiv9/FiGPlr8QHllpBvUxFuFMiiHof CXeQE/caAimk3hnE5tAGUZeqSyHxMNFxEv/Hvf8oNVJqJ6ZWr/FphllpFqMH4LGWyr44 Y6WcHmEKIjsWcg2VRVNj2KKhvPBKb5ofO7sSkmtxGUaiwx7xC/BR4cbOO1Wvig/OfAur 3iJ0XJr/EDG+IPxyF38jHTbfkg5mvNe+1skI5yXHxuEUaGjv+0iDIueD7nzp4oVr1zm7 J58nrVhVWA7zMIHcoGPO1Buvvu+aIGI3jd+e04afoEcngctfxYMz0xwQa5YZjvRKZu2x PTMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hVEx96iiSpMpFKatwEa67rNLWXTIypERZQyl83ftVJw=; b=Vv2Ic1Gjl1Rq7a+BS/7gJOtQc7wWDxhRtEdr9Kl9EX8CoN7l0MYbdkNzRqrKf0cz7y cUixGbEf24bOPXS5kCL54jZ+dsn6VCbpuw4/QSCUs04ATqc1XLcKLbEIc/IY4D2FI3uS fzg7Uv2SM1X17giHBniEsnpoSOxQaw6dNDgutwbx7ZyUr1LMr0s7KaQkRLvbHQXiiDlL pH6TjSqJErpCKIZHnqBSJUTHu8B0IurB06wrXhzdr0Y+MiRfzd7VEe+XPuq+SEJw538N QyxtmTee0IdYMnvvsjHoPn8il65T5S+VpeCMz80RtMpUjLVrB06+von08i5/vgpVs6y3 mr8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tQhS0eRy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f30-20020a63381e000000b0051b29733bc9si296955pga.715.2023.06.09.12.56.37; Fri, 09 Jun 2023 12:56:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tQhS0eRy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231695AbjFITeK (ORCPT + 99 others); Fri, 9 Jun 2023 15:34:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbjFITeJ (ORCPT ); Fri, 9 Jun 2023 15:34:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C66E330D0; Fri, 9 Jun 2023 12:34:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 63DE465B5A; Fri, 9 Jun 2023 19:34:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D79B9C433D2; Fri, 9 Jun 2023 19:34:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686339247; bh=UOspDcDfDFm6QPopNaAEG0ZWyNsc8e+X/dvLCTYWW0M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tQhS0eRyklovhz/AoC7U2GE5HgQOiLjzRFTt+o3ZaiC9tr6qYM1CkWJP4Qlm+9q3T RU7NiJBJajGB8cdlIO6VDE/oX6e9S0Psnue96fn9fVTt/qm9oYckEGCvjh7fupaWJb z5B6WvqusQ2SyRSWlfR/INpEVwIo9Ih/tAm7bAMMapz7rWhm4weStrlmQBdfYBR0b+ A6VdWdYb/CqXYW+7MhULJgXactJgbkDgDdeGCGzcJC15rZOgeFhyKlcCqSMS6Zz6OU DHBLH7R2RphkCQgxo65P81CvZPnd18r6ml2ajIJ50/vxrLThnaYzMLgIyTwYakVJ6k 3grAPwoG3v1wg== Date: Fri, 9 Jun 2023 20:34:01 +0100 From: Mark Brown To: Krzysztof Kozlowski Cc: Raymond Hackley , davem@davemloft.net, devicetree@vger.kernel.org, edumazet@google.com, jk@codeconstruct.com.au, kuba@kernel.org, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, michael@walle.cc, netdev@vger.kernel.org, pabeni@redhat.com, robh+dt@kernel.org, u.kleine-koenig@pengutronix.de Subject: Re: [PATCH v2 2/2] NFC: nxp-nci: Add pad supply voltage pvdd-supply Message-ID: References: <20230609154033.3511-1-raymondhackley@protonmail.com> <20230609154200.3620-1-raymondhackley@protonmail.com> <20230609173935.84424-1-raymondhackley@protonmail.com> <7ad5d027-9b15-f59e-aa76-17e498cb7aba@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fhm/1UM3KQHYSisd" Content-Disposition: inline In-Reply-To: <7ad5d027-9b15-f59e-aa76-17e498cb7aba@linaro.org> X-Cookie: Tom's hungry, time to eat lunch. X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --fhm/1UM3KQHYSisd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jun 09, 2023 at 09:29:51PM +0200, Krzysztof Kozlowski wrote: > On 09/06/2023 19:40, Raymond Hackley wrote: > > On Friday, June 9th, 2023 at 3:46 PM, Krzysztof Kozlowski wrote: > > Second condition regulator_is_enabled(pvdd) is to make sure that pvdd is > > disabled with balance. > So you have buggy code and to hide the bug you add checks? No, make the > code correct so the check is not needed. Specifically your driver should only ever call regulator_disable() to balance out regulator_enable() calls it made itself and it should know how many of those it has done. regulator_is_enabled() should only ever be used during probe if for some reason it is important to figure out if the device is already powered for startup, this should be very unusual. If something else enabled the regualtor then whatever did that needs to undo those enables, not another driver. --fhm/1UM3KQHYSisd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmSDfqgACgkQJNaLcl1U h9ABiwf9Hutr2zJvx9D17c4xS1JOiT2t+PozkRvq6t8oWu82/GhSKzCEl4qiJ48j KG9Dyy6j44XBO2sjM4X0ge6gjX7+3TPcFRd4WC5VtqmqNgyKQviRk8KBPT7g+9Le tA5btQ5ytvDJRNhvlAqi8FxkwAt3P+6DPVZGosDcJcaDwHa936TM1SAZnx6TP7y4 vc0etFHfMt/+xL9hMRqxlCyL+dPo45wdsNOibWJu9mF15yDfDdJLfWW+d8qbRu9r V2o7YSG0k0Ukxpj5fgBiBgWfAsYKmYVzg15gTazoop0PHUGtonXk14vZt5bQQGkV s3SCRrQAOCNB7v0yl5nhK87ypCx31Q== =365c -----END PGP SIGNATURE----- --fhm/1UM3KQHYSisd--