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 56574C433FE for ; Mon, 1 Nov 2021 01:46:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3265E610D2 for ; Mon, 1 Nov 2021 01:46:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230320AbhKABtS (ORCPT ); Sun, 31 Oct 2021 21:49:18 -0400 Received: from mail-vi1eur05on2046.outbound.protection.outlook.com ([40.107.21.46]:44001 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230133AbhKABtO (ORCPT ); Sun, 31 Oct 2021 21:49:14 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JyOd+hMDn6jVsy1K/Hdqvu77xnOFOXxFNXj7uTZRxxWAeS49RpIW7buUednLa3S+2Cr6yKm7r2f1e15/4NDqtK6mnRw6W24R1HsZgoDUFJzh1tOeASUQqpFfhP2nSDw5JPA0CkciTOG7LeFSuCqbmRjlBqbdgRsYMwVfIkCVm+UzMM+d/Bmv1guodHl8jQMyqrugw8fuTDoxtuTc/szXabi2e45UDQXWjWJSJlXdXad8uv5HpANtuwX2YcnRpiZ5nsYIovJAf54+j0Ae5VVI/tj6yp38pxTQQhIV6kTstwpOnghdJW0M2ci+WbbQikgkVGVmUjYVbdXA0mqb3U1X0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=b7f3TU1fd7TQEy+/gDO5PHybi5gH/wdJ0IyvuqPEU5Q=; b=KAyEEycljde8giyrlBW8PRM2y/A4TQWaoMqU8oqR4k1N9clvtA78cR6e5JvtXED0TaGRtN4372q7cOVXKSHEmzuRyEDGzOAHlpC50dmJFzEvTZd1yi/+HSEyT78EoOrcK0At6cajf7KTaAgLXYl4U2tGdGO3ilalg4/gXts4iM1Z+7wDqHuLyQx/0EQw77wS50hE/mzL2Yfx5H7y+9ogJYTskj+0HSr61Mm8o+mfuMoySs+e1Ag3baJnrJPG8/6CrgLPLC7zpg1mEDU91AT7FDB2LyMta/o9OBPZoH/zHNKMgvbcmSRC25y7r+ZSdzIRK/38Zjqy9jZFLD7Bd9haGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b7f3TU1fd7TQEy+/gDO5PHybi5gH/wdJ0IyvuqPEU5Q=; b=mhdnlvN1XBg0ukU0aqLHx7R6wADPlllGlOS24a2Nh+rY32SbkGSChz0/2J2Va6xfaF5zgEHLTenigs+YyQE+dRwBFN8kbpm5/cy7aeN377SmSUKVRfw+YthCvAVFZhCx1yrF0qur3XjtIBLWcobRsq6kwkel/tizf0DVuT9uJqg= Received: from AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) by AS8PR04MB9208.eurprd04.prod.outlook.com (2603:10a6:20b:44f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.13; Mon, 1 Nov 2021 01:46:35 +0000 Received: from AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::b059:46c6:685b:e0fc]) by AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::b059:46c6:685b:e0fc%5]) with mapi id 15.20.4649.019; Mon, 1 Nov 2021 01:46:35 +0000 From: Richard Zhu To: Mark Brown 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 Thread-Topic: [PATCH v3 3/7] PCI: imx6: Fix the regulator dump when link never came up Thread-Index: AQHXxxe5hpSrQkcPqkWGr8lEYEKQh6vjlGkAgAAC9gCAAPQyAIAAlv4AgAFuIxCAAcUHAIAA/dUAgACTWACABA5hcA== Date: Mon, 1 Nov 2021 01:46:35 +0000 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> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dc11d0b8-2162-4ada-be30-08d99cd9701b x-ms-traffictypediagnostic: AS8PR04MB9208: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fiq0ftANNWPIYzv1A4gsWT+BbFARMWNfs7nkYwiDRe/moXkHQiR+AzWUikBasVTw3PcmG6OQ6+oYR+a/xJ5VK1zi6ZI9TkpuFS1kjSb6TT85VcmKqqMjxAhVrp8/16KoGzu4RigUNG5GMERG/DUMTFmXfeIZ+YoSSCKTDbkjigjAhTyleQrlSERwNs9RsJKovw5ZCAQMy9k2o15RhXiYlx9oXd0gTxDasL76OgL6WZmrwZdZZvBHwrw758naUIwvvLwa/cZM5eqEEHL1i89ZrN5JJLYPkDEXf33SlS1wu91NKiZY3UdmvUy0aUFVxaxuU0ozLYNJRl1aGkhREqlDIlcEdtG2dEkkefrvSQdwdUdgnpDr4ZlX9MVknozeP/rB4oMMLIXTOX6uM76EJC3Iy2F1g3Dmj6bZ9Vcl6uQaEr9utjwUneXIVHYkLOXIOpckgfUcWM0mY+Ql1sK7FCJP4DDu/3u38H3b1zEpdBoSVtO+YZ27r6lT3eU3H/6DhxbLmpJQlqifz00RQG6twXAYVl30Ylt90tPyIosSCiEROijNbrA/aPMN/Yi+A2zQ0lMBWaoa7N/JwafdtR5952Ikj9jdo73tYKHCnDs9a0DvKfTy5QQxCnpTEWRHeiuLV3JxMNN7sW5HKlppu2DwlxGPhCIH+aqIGwdk+vzcG8nHI/Xq973M1EH/5lKsiwOXKmnRKShmdD71D7HiCU4nnrN5ZQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8676.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(86362001)(508600001)(8676002)(186003)(83380400001)(55016002)(6916009)(4326008)(52536014)(64756008)(5660300002)(66446008)(316002)(66946007)(9686003)(66476007)(26005)(33656002)(54906003)(7696005)(122000001)(76116006)(7416002)(6506007)(66556008)(71200400001)(2906002)(38100700002)(38070700005)(8936002)(53546011);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?NqV6nzBg9/2UQ/ZwzMgQcXEI92r0sY3v0E515GT0tgQDp7asgqlUPb9FtK9X?= =?us-ascii?Q?6KMZnrliWv9UxRQiytDXHTNIJ4R9nopk2U7Zitq8nVOdJBLwWht42RqCe++i?= =?us-ascii?Q?ybeuxOpn9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P01ileIW?= =?us-ascii?Q?QeOhtTEwprl5SOmgx0T3//zW/SF8SELbKkpORPuvmG7NKxkU8oyqZ3PQApk6?= =?us-ascii?Q?hCMHcSLhb29vJl//HGqvolMPT8l+08KSGKTbUZ8qto8PnPq8wwDxAce6nkOl?= =?us-ascii?Q?OUYky9BdLGrpaknJWU4n9FbpmN3hx3yAsTzBZiLzzqNjIPtAWTlXroXeUyKC?= =?us-ascii?Q?B6hFEKw55qMP5tUCn4Gcmau360oXLVKUALdUSufIt47DX412RMXj8MS352c3?= =?us-ascii?Q?cJ49gO5BAgowYNhZBjoumIxD2AmGMVCYRmdrpBzmmHwni7NBLbbTTMDNZGEl?= =?us-ascii?Q?WKtRMtSEVMMFhOBooOWPVY1k3IcoGmnTxkPXoAQbEn+q89vnWMXma9jf2iMq?= =?us-ascii?Q?5CuMJMXJ9zTq2Jxy/nVgYtW2pq/xypUeImxEIiD6OfGgtoiqKsgFqWy0sdbK?= =?us-ascii?Q?tb59Kely9vfEKzqDyfPT+/YpZuuIRk6M+lhQ1gixsL+PawjRCulCrE4LcXyv?= =?us-ascii?Q?M7L3/KoIhxbZB3B+fs3dPn01eS/7ZM8VAe8xlvnjFUg9+vrWLXen5OjpCQXr?= =?us-ascii?Q?q2YgCvfCdg4s/3CViPByAT0IwqU4+H6OmReATitaG0jFbC5l0Pv0EogyBjXb?= =?us-ascii?Q?bQ=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8676.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc11d0b8-2162-4ada-be30-08d99cd9701b X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2021 01:46:35.1322 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: DCVUyfZc7qKtOOm4IqilSZrCopH8ugS/LeArIL5aV2qvggAonBekGLo2hbpfW8aUVmQFKxhUTsoOF4ohtEZKig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9208 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Mark Brown > Sent: Friday, October 29, 2021 7:46 PM > 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 >=20 > On Fri, Oct 29, 2021 at 03:58:41AM +0000, Richard Zhu wrote: >=20 > > > 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 other systems. >=20 > > [Richard Zhu] Understood. Thanks. > > Can I disabled this regulator in PCIe probe failure handler without > > the > > regulator_is_enabled() check? >=20 > 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. > 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. [Richard Zhu] Got that, thanks a lot. BR Richard 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 DE9DCC433EF for ; Mon, 1 Nov 2021 01:48:30 +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 96CA960FE8 for ; Mon, 1 Nov 2021 01:48:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 96CA960FE8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com 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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fgEFRjzyEejYaWKdAuTLRJIqX1y36HgR6bLuBv6qgFQ=; b=R1vQOppLkA7G2A yKY5rROghU5T3UgcnFqiH8MyngdCor2qxuEJHscOTn+qzg9+SWdF7+cTWykkfI2c71vFYzAeYqB5f 0F/UQU3ZpDzFIWQ76jJlR82ACJh3ngzv8hXLEwmyzrTKjdAGKiCqQy50Mv9dmCAZue0r+7bUW06Ak uIBByyTyulo/buEg3Yiaw79iUCTbAAFYWOci1hY+fwGSgSyvODncYOShBiERNeZi3Q/Q6uEwaPAaF Bg20PTYRRkpVw+UrJCffSlgQBP+H1LoClU92FTiBmrSaFqGPqMUbwAsBklV0UIsWO8i2IyWTCtu2D BcNj6C32AyNYLnhPEoPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhMPS-00F3FE-0a; Mon, 01 Nov 2021 01:46:50 +0000 Received: from mail-vi1eur05on2084.outbound.protection.outlook.com ([40.107.21.84] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhMPO-00F3Et-KK for linux-arm-kernel@lists.infradead.org; Mon, 01 Nov 2021 01:46:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JyOd+hMDn6jVsy1K/Hdqvu77xnOFOXxFNXj7uTZRxxWAeS49RpIW7buUednLa3S+2Cr6yKm7r2f1e15/4NDqtK6mnRw6W24R1HsZgoDUFJzh1tOeASUQqpFfhP2nSDw5JPA0CkciTOG7LeFSuCqbmRjlBqbdgRsYMwVfIkCVm+UzMM+d/Bmv1guodHl8jQMyqrugw8fuTDoxtuTc/szXabi2e45UDQXWjWJSJlXdXad8uv5HpANtuwX2YcnRpiZ5nsYIovJAf54+j0Ae5VVI/tj6yp38pxTQQhIV6kTstwpOnghdJW0M2ci+WbbQikgkVGVmUjYVbdXA0mqb3U1X0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=b7f3TU1fd7TQEy+/gDO5PHybi5gH/wdJ0IyvuqPEU5Q=; b=KAyEEycljde8giyrlBW8PRM2y/A4TQWaoMqU8oqR4k1N9clvtA78cR6e5JvtXED0TaGRtN4372q7cOVXKSHEmzuRyEDGzOAHlpC50dmJFzEvTZd1yi/+HSEyT78EoOrcK0At6cajf7KTaAgLXYl4U2tGdGO3ilalg4/gXts4iM1Z+7wDqHuLyQx/0EQw77wS50hE/mzL2Yfx5H7y+9ogJYTskj+0HSr61Mm8o+mfuMoySs+e1Ag3baJnrJPG8/6CrgLPLC7zpg1mEDU91AT7FDB2LyMta/o9OBPZoH/zHNKMgvbcmSRC25y7r+ZSdzIRK/38Zjqy9jZFLD7Bd9haGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b7f3TU1fd7TQEy+/gDO5PHybi5gH/wdJ0IyvuqPEU5Q=; b=mhdnlvN1XBg0ukU0aqLHx7R6wADPlllGlOS24a2Nh+rY32SbkGSChz0/2J2Va6xfaF5zgEHLTenigs+YyQE+dRwBFN8kbpm5/cy7aeN377SmSUKVRfw+YthCvAVFZhCx1yrF0qur3XjtIBLWcobRsq6kwkel/tizf0DVuT9uJqg= Received: from AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) by AS8PR04MB9208.eurprd04.prod.outlook.com (2603:10a6:20b:44f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.13; Mon, 1 Nov 2021 01:46:35 +0000 Received: from AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::b059:46c6:685b:e0fc]) by AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::b059:46c6:685b:e0fc%5]) with mapi id 15.20.4649.019; Mon, 1 Nov 2021 01:46:35 +0000 From: Richard Zhu To: Mark Brown 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 Thread-Topic: [PATCH v3 3/7] PCI: imx6: Fix the regulator dump when link never came up Thread-Index: AQHXxxe5hpSrQkcPqkWGr8lEYEKQh6vjlGkAgAAC9gCAAPQyAIAAlv4AgAFuIxCAAcUHAIAA/dUAgACTWACABA5hcA== Date: Mon, 1 Nov 2021 01:46:35 +0000 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> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dc11d0b8-2162-4ada-be30-08d99cd9701b x-ms-traffictypediagnostic: AS8PR04MB9208: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fiq0ftANNWPIYzv1A4gsWT+BbFARMWNfs7nkYwiDRe/moXkHQiR+AzWUikBasVTw3PcmG6OQ6+oYR+a/xJ5VK1zi6ZI9TkpuFS1kjSb6TT85VcmKqqMjxAhVrp8/16KoGzu4RigUNG5GMERG/DUMTFmXfeIZ+YoSSCKTDbkjigjAhTyleQrlSERwNs9RsJKovw5ZCAQMy9k2o15RhXiYlx9oXd0gTxDasL76OgL6WZmrwZdZZvBHwrw758naUIwvvLwa/cZM5eqEEHL1i89ZrN5JJLYPkDEXf33SlS1wu91NKiZY3UdmvUy0aUFVxaxuU0ozLYNJRl1aGkhREqlDIlcEdtG2dEkkefrvSQdwdUdgnpDr4ZlX9MVknozeP/rB4oMMLIXTOX6uM76EJC3Iy2F1g3Dmj6bZ9Vcl6uQaEr9utjwUneXIVHYkLOXIOpckgfUcWM0mY+Ql1sK7FCJP4DDu/3u38H3b1zEpdBoSVtO+YZ27r6lT3eU3H/6DhxbLmpJQlqifz00RQG6twXAYVl30Ylt90tPyIosSCiEROijNbrA/aPMN/Yi+A2zQ0lMBWaoa7N/JwafdtR5952Ikj9jdo73tYKHCnDs9a0DvKfTy5QQxCnpTEWRHeiuLV3JxMNN7sW5HKlppu2DwlxGPhCIH+aqIGwdk+vzcG8nHI/Xq973M1EH/5lKsiwOXKmnRKShmdD71D7HiCU4nnrN5ZQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8676.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(86362001)(508600001)(8676002)(186003)(83380400001)(55016002)(6916009)(4326008)(52536014)(64756008)(5660300002)(66446008)(316002)(66946007)(9686003)(66476007)(26005)(33656002)(54906003)(7696005)(122000001)(76116006)(7416002)(6506007)(66556008)(71200400001)(2906002)(38100700002)(38070700005)(8936002)(53546011); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?NqV6nzBg9/2UQ/ZwzMgQcXEI92r0sY3v0E515GT0tgQDp7asgqlUPb9FtK9X?= =?us-ascii?Q?6KMZnrliWv9UxRQiytDXHTNIJ4R9nopk2U7Zitq8nVOdJBLwWht42RqCe++i?= =?us-ascii?Q?ybeuxOpn9jYVdJTpZ6YrXHFXnHzUpCrERoymnLCUBD6IYuGkM0kkjmMBQl2p?= =?us-ascii?Q?POS64ySsiEhLNR0qOgeRuC3XkLNsYeZTX7AMvPRKRb3gH8JihnlTBcteVcDY?= =?us-ascii?Q?gcN4Ze2oO2jdRADlfXz3AwDD3vTB3LdhDGvGDOIAkYXNPrQIhmBD0TmRaCQf?= =?us-ascii?Q?xez73y8IM3QAyDVLBD5e9yuRtmkcqBoo8EbYVPpNbl1T0iONhBzmNeYagZI7?= =?us-ascii?Q?mf1B9q85MhqgdazDX5rr53goU9l4f21ysGYi3WovX5Wnfz9+taHmV+110osz?= =?us-asc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BLbbTTMDNZGEl?= =?us-ascii?Q?WKtRMtSEVMMFhOBooOWPVY1k3IcoGmnTxkPXoAQbEn+q89vnWMXma9jf2iMq?= =?us-ascii?Q?5CuMJMXJ9zTq2Jxy/nVgYtW2pq/xypUeImxEIiD6OfGgtoiqKsgFqWy0sdbK?= =?us-ascii?Q?tb59Kely9vfEKzqDyfPT+/YpZuuIRk6M+lhQ1gixsL+PawjRCulCrE4LcXyv?= =?us-ascii?Q?M7L3/KoIhxbZB3B+fs3dPn01eS/7ZM8VAe8xlvnjFUg9+vrWLXen5OjpCQXr?= =?us-ascii?Q?q2YgCvfCdg4s/3CViPByAT0IwqU4+H6OmReATitaG0jFbC5l0Pv0EogyBjXb?= =?us-ascii?Q?bQ=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8676.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc11d0b8-2162-4ada-be30-08d99cd9701b X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2021 01:46:35.1322 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: DCVUyfZc7qKtOOm4IqilSZrCopH8ugS/LeArIL5aV2qvggAonBekGLo2hbpfW8aUVmQFKxhUTsoOF4ohtEZKig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9208 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211031_184646_779557_5B788584 X-CRM114-Status: GOOD ( 21.49 ) 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > -----Original Message----- > From: Mark Brown > Sent: Friday, October 29, 2021 7:46 PM > 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 > > 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 other 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. > 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. [Richard Zhu] Got that, thanks a lot. BR Richard _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel