From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25385C433FE for ; Fri, 29 Oct 2021 11:46:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13A45610E5 for ; Fri, 29 Oct 2021 11:46:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231473AbhJ2Lsf (ORCPT ); Fri, 29 Oct 2021 07:48:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:52664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230492AbhJ2Lse (ORCPT ); Fri, 29 Oct 2021 07:48:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 657E960FC4; Fri, 29 Oct 2021 11:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635507965; bh=ADRsTG4KktqVoeo8au9Xp0rvCANd8RBoqqfeQJgiGEA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sO28/ddoZql7s0Bfn4pYerXoM34G8N1Zse6CK9yYoLJA+HIYf4DOcawUn8MaMUgQy FhkBqwXGqeN9wGXKKG8d5DYtJacckppyEgGn4vLtRThZ41zw3ksAcSiHfKPtRVA0JS bXBr3mDgER35cE+0RgnFjZwfzn2Nm2kClusbqGyrpdnZAuMhxwbBSUANfNa9MG8axk q9DcgNWpRqR+R4IuG1eFGdnlhLPTDIYgiXIPrIW2z5GNMxq6pxND5Y2Usl50abEXwf 6v/Zi3yzxxBth0Bq9SIZQSAY10Hb6iPrOPxP/4mGQf6+nMrsQ/TXkEqy1MhOPrI/be 7GCLROftAItsA== Date: Fri, 29 Oct 2021 12:46:00 +0100 From: Mark Brown To: Richard Zhu Cc: Francesco Dolcini , "l.stach@pengutronix.de" , "bhelgaas@google.com" , "lorenzo.pieralisi@arm.com" , "jingoohan1@gmail.com" , "linux-pci@vger.kernel.org" , dl-linux-imx , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "kernel@pengutronix.de" Subject: Re: [PATCH v3 3/7] PCI: imx6: Fix the regulator dump when link never came up Message-ID: References: <1634886750-13861-1-git-send-email-hongxing.zhu@nxp.com> <1634886750-13861-4-git-send-email-hongxing.zhu@nxp.com> <20211025111312.GA31419@francesco-nb.int.toradex.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ypW26rZg14WCTdak" Content-Disposition: inline In-Reply-To: X-Cookie: "Just the facts, Ma'am" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --ypW26rZg14WCTdak Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 29, 2021 at 03:58:41AM +0000, Richard Zhu wrote: > > The driver should undo any enables it did itself, it should not undo any > > enables that anything else did which means it should never be basing > > decisions on regulator_is_enabled(). While the regulator may not be > > shared in the particular board you're looking at it may be shared in ot= her > > systems. > [Richard Zhu] Understood. Thanks. > Can I disabled this regulator in PCIe probe failure handler without the > regulator_is_enabled() check? If the driver called regulator_enable() (and that didn't return an error) it can always call regulator_disable() as many times as it called regulator_enable(), no need to check if the regulator is still enabled. =20 When the driver hasn't successfully called regulator_enable() it shouldn't call regulator_disable() even if the regualtor is enabled. This means that after your driver has enabled the regulator it can just disable it but between the regulator_get() and regulator_enable() it shouldn't do that. --ypW26rZg14WCTdak Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmF73vcACgkQJNaLcl1U h9AhbwgAgIcDmfHvv15AGtB8E/+5w/Jb0ChT7nLC0JRtsFgKrTA91hhmwjwOuQzb WmH5Ef8qFggm/GpfB58c48KB7SA4vks6kGjzAzro/fJQ4+9Bh6S0o62Ghnf78lKu dWdIvSnbeX1rXE/FoMF7sUMOi3dyKYAhOgYOQJFV0o6vEkgQJVqkkvCjupeGg8YO 7PeZfXvfzyTySuXVAmeSoinqb7EOR0U40WhbTqo9JzA2n8xp42GhJtdwIuX9b3Ml J1t0QLqdFvfcr+cdW28R+fJNF7JDdSyTmuAtjfIryp9LylxqcK9hV2ySAs6Gourw wvbdT+rMkhIjbi744gQnAdDXOQ49kg== =Upjl -----END PGP SIGNATURE----- --ypW26rZg14WCTdak-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 248B7C433F5 for ; Fri, 29 Oct 2021 11:47:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E4EE060FC4 for ; Fri, 29 Oct 2021 11:47:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E4EE060FC4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ML6VMiq7MncznocO8cO80tezSnSUsl17KBpeLuCFqW8=; b=AEhQALnW5uXptw41wgX3V0ZlEq olQCnk5TBzEms/UhQJD3rgEI0mUouQueY0EFTsxLh61urNlqYbqI96/qD9bCYAV7OI/Mw5Q9mARt2 7DJj2WS1rCMx9T2f0dcKj/wYwi7lQj7/enbbrPVwvwS95wf2lbIbHNRB9UbBCYFJ0rZXdIHSGd40H 5ynYFxMWq39An+e3OZ5O0i8UdkzmfBqqGobSvDlp+wHFlR3zve1NZzuRBbRYkDachSZSNObNKXs4e VXypPH4E1yvIyb/ck3BdY68ceUQ8xZuLRIG+kgrnLvXpMfqyHY+/UyVp9NvcL7ekY6T7zuUeYZBf6 se3ENpyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgQKp-00Anvs-L1; Fri, 29 Oct 2021 11:46:11 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgQKk-00Anua-C9 for linux-arm-kernel@lists.infradead.org; Fri, 29 Oct 2021 11:46:09 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 657E960FC4; Fri, 29 Oct 2021 11:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635507965; bh=ADRsTG4KktqVoeo8au9Xp0rvCANd8RBoqqfeQJgiGEA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sO28/ddoZql7s0Bfn4pYerXoM34G8N1Zse6CK9yYoLJA+HIYf4DOcawUn8MaMUgQy FhkBqwXGqeN9wGXKKG8d5DYtJacckppyEgGn4vLtRThZ41zw3ksAcSiHfKPtRVA0JS bXBr3mDgER35cE+0RgnFjZwfzn2Nm2kClusbqGyrpdnZAuMhxwbBSUANfNa9MG8axk q9DcgNWpRqR+R4IuG1eFGdnlhLPTDIYgiXIPrIW2z5GNMxq6pxND5Y2Usl50abEXwf 6v/Zi3yzxxBth0Bq9SIZQSAY10Hb6iPrOPxP/4mGQf6+nMrsQ/TXkEqy1MhOPrI/be 7GCLROftAItsA== Date: Fri, 29 Oct 2021 12:46:00 +0100 From: Mark Brown To: Richard Zhu Cc: Francesco Dolcini , "l.stach@pengutronix.de" , "bhelgaas@google.com" , "lorenzo.pieralisi@arm.com" , "jingoohan1@gmail.com" , "linux-pci@vger.kernel.org" , dl-linux-imx , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "kernel@pengutronix.de" Subject: Re: [PATCH v3 3/7] PCI: imx6: Fix the regulator dump when link never came up Message-ID: References: <1634886750-13861-1-git-send-email-hongxing.zhu@nxp.com> <1634886750-13861-4-git-send-email-hongxing.zhu@nxp.com> <20211025111312.GA31419@francesco-nb.int.toradex.com> MIME-Version: 1.0 In-Reply-To: X-Cookie: "Just the facts, Ma'am" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211029_044606_494995_3B2C44BB X-CRM114-Status: GOOD ( 14.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============5875013827012900877==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============5875013827012900877== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ypW26rZg14WCTdak" Content-Disposition: inline --ypW26rZg14WCTdak Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 29, 2021 at 03:58:41AM +0000, Richard Zhu wrote: > > The driver should undo any enables it did itself, it should not undo any > > enables that anything else did which means it should never be basing > > decisions on regulator_is_enabled(). While the regulator may not be > > shared in the particular board you're looking at it may be shared in ot= her > > systems. > [Richard Zhu] Understood. Thanks. > Can I disabled this regulator in PCIe probe failure handler without the > regulator_is_enabled() check? If the driver called regulator_enable() (and that didn't return an error) it can always call regulator_disable() as many times as it called regulator_enable(), no need to check if the regulator is still enabled. =20 When the driver hasn't successfully called regulator_enable() it shouldn't call regulator_disable() even if the regualtor is enabled. This means that after your driver has enabled the regulator it can just disable it but between the regulator_get() and regulator_enable() it shouldn't do that. --ypW26rZg14WCTdak Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmF73vcACgkQJNaLcl1U h9AhbwgAgIcDmfHvv15AGtB8E/+5w/Jb0ChT7nLC0JRtsFgKrTA91hhmwjwOuQzb WmH5Ef8qFggm/GpfB58c48KB7SA4vks6kGjzAzro/fJQ4+9Bh6S0o62Ghnf78lKu dWdIvSnbeX1rXE/FoMF7sUMOi3dyKYAhOgYOQJFV0o6vEkgQJVqkkvCjupeGg8YO 7PeZfXvfzyTySuXVAmeSoinqb7EOR0U40WhbTqo9JzA2n8xp42GhJtdwIuX9b3Ml J1t0QLqdFvfcr+cdW28R+fJNF7JDdSyTmuAtjfIryp9LylxqcK9hV2ySAs6Gourw wvbdT+rMkhIjbi744gQnAdDXOQ49kg== =Upjl -----END PGP SIGNATURE----- --ypW26rZg14WCTdak-- --===============5875013827012900877== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============5875013827012900877==--