Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp549596pxb; Wed, 27 Oct 2021 07:57:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGZqpF8XMdQRZDYoO2/8KwHRAU3cQsj8ue/0g1y7RVjeoJRUm5JRlEmr2K0D207o6xRRFp X-Received: by 2002:a63:7542:: with SMTP id f2mr24164938pgn.64.1635346665281; Wed, 27 Oct 2021 07:57:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1635346665; cv=pass; d=google.com; s=arc-20160816; b=hwJnwF1v35VpTBJIhyiPyQZQalRH6fiozQl4H0o4p3buMvgolegu3IfGbRi1ad2HhS nikDQl2F/RuJpzsEF475FDJpDK6MUP8ZqjyOxe/nI1oEoqhgNWp57UsRvA96Govbph6i gu+1l0Jn1WWu2ZUBbrK9pEif4/JMoVL1XdjnpB8pT68Q8iPFFvvUnbT+j/KnDm+8KrHR jFs6M/Xk1opHITO90lbjofgfVov/sPWnGlvvuUQQrcR7oEGeYHK3IcYUkhJX9aBYzr1a 6BBuwjQwgt7zDo+GquxcBk5op0jBIPNlDdrD5eIsP4OZW0lC6v//W7wbXtpcu4ZrlhvM vp6w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=xVODrxwJkq82DHQWrow/UaQFWja/29B/c+BG8GNAwhw=; b=0hu632HH35uuNsUNr2/H3O/hWO33nOolYsq0Db4Obwm309/5JgMN1ERL9GFIs3GA9D 1I9tjL/+VxUQi+WUXg1E3dSeB4HfVhkcrItFmUREnSjPjBVm5kA+idfhbA4vkQkGOUwp G3mTnsgcr46jV3bNOXC7w3nf/l4o8EFywpFnOSqRN+y15do6makE1w4JgcSbkjbHfFCC 2TafFEdkdYjYIG9RNVjRTN1/cjXQy7gzF/e113oC0VN5iyI2NxLoreY8Lc7Su1Tziakl IR5Fy+Te2H0Eeg40n9AvTfdgmYnWJoSw6jGxVcAIB2gPChuXQR0pdkiTdajRX3YjDRQP XL9g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=gvkvlDGX; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d7si321375pfv.197.2021.10.27.07.57.31; Wed, 27 Oct 2021 07:57:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=gvkvlDGX; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237394AbhJ0Bbv (ORCPT + 99 others); Tue, 26 Oct 2021 21:31:51 -0400 Received: from mail-eopbgr60082.outbound.protection.outlook.com ([40.107.6.82]:39815 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231458AbhJ0Bbu (ORCPT ); Tue, 26 Oct 2021 21:31:50 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RJa4fuMcWQdSKuGnNQEix1yydsfJpwq7Vaj2EbjBx3hiQJkA3dLOmP6qUXAt7TZqBNBJxGBuYfdIbvBJ68+MO0Fqk9DVeXrg3n+moACheFGsLZy9nDfKvrnDl3KOGuKMAISIiVjRofxaNpc+B8qZDCZ/tUySfLrKv2WCVrtStNPWknXdyOWOvlXFZHV8zYzKzdfjbIJrF/WwYcYkmExoMArlt0oBhoEnQ1AY+/Ky9pzetXsoeHnCWw9N7a4vXALPSn23oIQEFijwQVRPMwuaf8921rBjmNgZnUAeyyizHmGCP8Iv8cj+J/z0tGnOPg4btDH5EidQ7g2EdcrX0AvKDA== 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=xVODrxwJkq82DHQWrow/UaQFWja/29B/c+BG8GNAwhw=; b=Ru4MbOTSGj1sjDdVs8263LbBKSLrdb5M/gUMmeb9+7U+yUuXtV30JbkKIZHot3T/HdCFGoI8Q7NkQqDezhcxLqswK/tMR1VKzRkifX9zcoPpP9cvYFB+SHnGKO5+2LHHtEfYOTW5OFA/xYvSnsykv2wl86QTzGzOm75NobrvzIlRPoYc3vGwbMfNBdSdcR0L0Dqqu0bX5XN0A1yDyL/DMnH3qGn2V5HMmQXwclHCls0vwokTQduoS5AwBiLIdRd0hkQAZi4lD3nCzH1iE30vUhTMZYxIhx9oSSaPMEnvelumVoZ7zE4z1hgokYUfk5tAhhXrLZbkCjDYuUKebD7kmQ== 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=xVODrxwJkq82DHQWrow/UaQFWja/29B/c+BG8GNAwhw=; b=gvkvlDGXG9LilwPj3LxaITgmngq0rUL5hu6O8AtBAhKsizKV7NedckF9c1R2ML6PceAJGZhECcRAMeNlgMGpM2QW9m/2FVKiBCNAmJeEp7plscoMZ2vBvE6TPukhwX0awVrxeuHDoAYTZh0jHJDWwQWeORCxUdUivJmou1A1UO4= Received: from AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) by AS8PR04MB8962.eurprd04.prod.outlook.com (2603:10a6:20b:42d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.18; Wed, 27 Oct 2021 01:29:23 +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.014; Wed, 27 Oct 2021 01:29:23 +0000 From: Richard Zhu To: Bjorn Helgaas CC: "l.stach@pengutronix.de" , "bhelgaas@google.com" , "lorenzo.pieralisi@arm.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: [RESEND v2 4/5] PCI: imx6: Fix the clock reference handling unbalance when link never came up Thread-Topic: [RESEND v2 4/5] PCI: imx6: Fix the clock reference handling unbalance when link never came up Thread-Index: AQHXwY4ue+QOjCGA8ESB+dHo+5+VOqvUZ7iAgAAAjYCABY9dgIAEuu9QgAbaNACAAJLXMA== Date: Wed, 27 Oct 2021 01:29:23 +0000 Message-ID: References: <20211026163844.GA145569@bhelgaas> In-Reply-To: <20211026163844.GA145569@bhelgaas> 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: 7a1df0a0-66e5-48a1-7d86-08d998e93542 x-ms-traffictypediagnostic: AS8PR04MB8962: 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: uQmdEJuSfGTwK6h+1CLPc7oHURAcsRJ+NuQGqgB6KluEK1vyUuujgySqcAClK32CqSsq/GEdR2MuS12vMq3MwdO6lV6/xgsHDFRZyQHpTujsrNCp/BXVgbBa9vBp7z42bQgEVWShiY2J4EqXLMABVB/KtXvBO3AxMF83OdW1e+y108C8e5DjZ6vhg77Xp+ECJ1s/M13tIEjZ2YWe4RVGLCLT6wR5SDT+gF3G/CgBTu0f9Hko+bs86eCwrX8n33FRvzt5B0fz4Xcgs1pnZ0m4bL2RsvxNHJucix1lURhvhgZt6cFQBrFU8Z/ER9BNUU9Uy0ZJZcxkuuOALmi8ibxOIj0S4MohAXTmpjkOFk/PUVh2vf8KfcAjZWjlccMIiYQ2eZcBjNYL9Ep9ngAKWU4DSx/R6I+D2Vfyw9G4r6M0bPAC10h0iA/G+JlyrjxcbWWFoh8e1Rph6GcwZfmc9BcMJu5Uf+dToEYtN9QSWzQPj0jpx8799icT8nDmuGmDRo9qQJpYyqk9QndKgyqpzZmO7jTNsT9Wpq6lbornedIRtWV7WxlJmY0K2aGR5z3Hmtxu3OW+AezQTlILWSO8GtpVNFdxir5O3rq64vfPangEq50RazJcnoDkbrlKQB6VcP4FUUmqV9YSzn+gqQgZkHrnU+xMsZV9tbhnfUfagOG6CdbG7FRv+k/TFB+Jc0+jOECXjmL5uwKwMULmx0MjprayrA== 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)(2906002)(316002)(54906003)(83380400001)(71200400001)(86362001)(53546011)(26005)(66446008)(8676002)(5660300002)(52536014)(66476007)(55016002)(66556008)(6916009)(122000001)(64756008)(76116006)(38070700005)(33656002)(66946007)(9686003)(6506007)(38100700002)(186003)(8936002)(7696005)(508600001)(4326008);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?V2lMRW8BliXv/5dYLJNxxk/Z5enhrHolVUdgTDEQzYoAALiGdkubARHvSdJr?= =?us-ascii?Q?k3UDQlBxzhuyhz3ryXgBnjys5js30kTpzTC/aNflDtiQ8E3RmxlJgnPSeEiW?= =?us-ascii?Q?/WEPWV87jWy4DHz8a5dRCpEr4jtndE6ZYSvRo3oEhgNf3YA+qWFtJKh5srzh?= =?us-ascii?Q?aFiHUCOhEwhbgI/vifivXp3eif/MjS/yYas3/mGn6kH0BmjQ7WZnia24bZfy?= =?us-ascii?Q?cq+4rLNKElTkKVoOvyV/K9gfooA1vx3lCy+1dl+K7gFPHXc5GJwCKScrSh/t?= =?us-ascii?Q?XOBANIvfbjXlfkH96VxifuN11270UkOMAjVlM2qzHPIXi8Bjfpz2bZSAi0vM?= =?us-ascii?Q?BFsmxxa6vO3NzzbD+v/j2eUK/1CxIyzK2hGz7w7j0yEp+wILcqMnu/NTkSlj?= =?us-ascii?Q?bLOnqZc0kyJhTkrcpPr/K973bNifE7kevxxbAvrRmYh+NFCdl3Ash20H6zmD?= =?us-ascii?Q?EIEdfUITLwxcGoByp+D078RKbtsZrmBVhzxjQQx8aAi5exyN3//tWCTfbH3Z?= =?us-ascii?Q?/E/lC3tqejZ/uLwBJ6XRd2LKsFFYgsjJPrwBBsm6h/Z8jU7GKLDhXnILRd06?= =?us-ascii?Q?ssplN1MyhWmr1vU8eilMFd7hxJXXcQk1XtVDdqk2pk1JJNfFeM/daxar7V3r?= =?us-ascii?Q?5bixP1mrszzP/eInvFTl4hPfK3CuyEnD3XLNI24dLCmVD6A+cGkg1PGSfJG1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yy26Pigyb4uoti0gs4?= =?us-ascii?Q?+w=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: 7a1df0a0-66e5-48a1-7d86-08d998e93542 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Oct 2021 01:29:23.7031 (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: U+JpOV6huCuaebOUiVP38QSPXDVgqRdAz3ibmskUNbfPvgDNjXmhsCbXI+9fPH3jedVjdNRp/8Pwh2+JFobmiw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8962 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Bjorn Helgaas > Sent: Wednesday, October 27, 2021 12:39 AM > To: Richard Zhu > Cc: l.stach@pengutronix.de; bhelgaas@google.com; > lorenzo.pieralisi@arm.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: [RESEND v2 4/5] PCI: imx6: Fix the clock reference handling > unbalance when link never came up >=20 > On Fri, Oct 22, 2021 at 08:02:17AM +0000, Richard Zhu wrote: > > > > > > > > > > > > -static void imx6_pcie_clk_disable(struct imx6_pcie *imx6_pcie)= -{ > > > > > > - clk_disable_unprepare(imx6_pcie->pcie); > > > > > > - clk_disable_unprepare(imx6_pcie->pcie_phy); > > > > > > - clk_disable_unprepare(imx6_pcie->pcie_bus); > > > > > > - > > > > > > - switch (imx6_pcie->drvdata->variant) { > > > > > > - case IMX6SX: > > > > > > - clk_disable_unprepare(imx6_pcie->pcie_inbound_axi); > > > > > > - break; > > > > > > - case IMX7D: > > > > > > - regmap_update_bits(imx6_pcie->iomuxc_gpr, > > > IOMUXC_GPR12, > > > > > > - IMX7D_GPR12_PCIE_PHY_REFCLK_SEL, > > > > > > - IMX7D_GPR12_PCIE_PHY_REFCLK_SEL); > > > > > > - break; > > > > > > - case IMX8MQ: > > > > > > - clk_disable_unprepare(imx6_pcie->pcie_aux); > > > > > > - break; > > > > > > - default: > > > > > > - break; > > > > > > > > While you're at it, this "default: break;" thing is pointless. > > > > Normally it's better to just *move* something without changing it > > > > at all, but this is such a simple thing I think you could drop > > > > this at the same time as the move. > > > > > > > [Richard Zhu] Okay, got that. Would remove the "default:break" later. > Thanks. > > [Richard Zhu] I figure out that the default:break is required by > > IMX6Q/IMX6QP. So I just don't drop them in v3 patch-set. >=20 > That makes no sense. The code is: >=20 > +static void imx6_pcie_clk_disable(struct imx6_pcie *imx6_pcie) > +{ > + clk_disable_unprepare(imx6_pcie->pcie); > + clk_disable_unprepare(imx6_pcie->pcie_phy); > + clk_disable_unprepare(imx6_pcie->pcie_bus); > + > + switch (imx6_pcie->drvdata->variant) { > + case IMX6SX: > + clk_disable_unprepare(imx6_pcie->pcie_inbound_axi); > + break; > + case IMX7D: > + regmap_update_bits(imx6_pcie->iomuxc_gpr, > IOMUXC_GPR12, > + > IMX7D_GPR12_PCIE_PHY_REFCLK_SEL, > + > IMX7D_GPR12_PCIE_PHY_REFCLK_SEL); > + break; > + case IMX8MQ: > + clk_disable_unprepare(imx6_pcie->pcie_aux); > + break; > + default: > + break; > + } > +} >=20 > Why do you think it makes a difference to remove the > "default: break;"? There is no executable code after it. > I don't see how IMX6Q/IMX6QP could depend on the default case. >=20 > BTW, I feel like a broken record, but your v3 posting still has inconsist= ent > subject line capitalization: >=20 > PCI: imx6: move the clock disable function to a proper place > PCI: dwc: add a new callback host exit function into host ops >=20 > It would be nice if they were consistent and contained more specific > information, e.g., >=20 > PCI: imx6: Move imx6_pcie_clk_disable() earlier > PCI: dwc: Add dw_pcie_host_ops.host_exit() callback [Richard Zhu] Got that, would change to be consistent and more specific inf= ormation. Thanks a lot. BR Richard >=20 > Bjorn