Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1829573pxb; Tue, 26 Oct 2021 17:14:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycCsOLOmUuGYL/7nqqrLhqfx/BsXZI2MKjfGcgI1OIRYb6Rx/O2ng5j31iu5bJYgSrUW4P X-Received: by 2002:a17:902:ab8c:b0:13a:22d1:88d with SMTP id f12-20020a170902ab8c00b0013a22d1088dmr24964190plr.33.1635293690266; Tue, 26 Oct 2021 17:14:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635293690; cv=none; d=google.com; s=arc-20160816; b=Rqa2iMQZ/h8uwQyN84LDgw8jqZc9XvzF/EX2E9r2GmpxPT9d1pe2TIF6GFT+TjFeDc HaWQnbyvRaqOrSN4m64CPGMYSI2sEiPwhIj7+R5BSgdRWYThh4WfSrgQXTQ1Sd438vs9 gxi4+UDmj/7gNdwnvnbaGEprAgVJApMien0oJYwXOJjTEM4dVWIPBZt8NCy9JzXe57Yx 6SJ6gHlyjxwu0951o0jy55cS7M8y7XUvRQm7nGyU3w5hIs43mw8OrDmqVo/Favf/56Fd 8R67Rl6QGPoPees2EDFdsXFivJ7nUGE8GCaiYxEzaia+nzbVQe92lVRwCHe5KHH9yJR3 zCDA== 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 :message-id:subject:cc:to:from:date:dkim-signature; bh=ZfM0O9a/dve+eyJK9SxxFDxcAy+hpZwNZHQZ9tq8QmM=; b=TFowv14r5icHTvT+jGYzbEoSbG6iwlya4jRLzg6ttpkNpbTro6I1n7joMfjSR0pS3/ jtj0MGTzAVYBkoMc0PiNFoRPk7AHfS/yejokOsLRNWZjsckxSJyb86zoc3U19XnFjVkj TpNkp5v8gudiMWHPAR6J2cqD4AUx+a4wsdhkBpk99dPMHkdm7ytvK9dAWI/sj69IKyQ6 Lcb8Wji9bZuOT3PIzLL1FBrHj+bhtZlLK5Szqsn2inSVQByRyLzqNCHOzLlMQzOliapL MHZ9VDMfc6gOZAxuL5JJn7bwFq3aw32GafuHSXnS/sOXkO4U1nBCKN6bQ+DJmJPmQN4v 6Mfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RhaGFe3b; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s14si2352118pfg.71.2021.10.26.17.14.35; Tue, 26 Oct 2021 17:14:50 -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=@kernel.org header.s=k20201202 header.b=RhaGFe3b; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235973AbhJZQlK (ORCPT + 99 others); Tue, 26 Oct 2021 12:41:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:47292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232718AbhJZQlJ (ORCPT ); Tue, 26 Oct 2021 12:41:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8E62260EC0; Tue, 26 Oct 2021 16:38:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635266325; bh=M6fXJMrTGa8IExJqf4YZcO+T/hr2BeuE2gyvDrquv6o=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=RhaGFe3b63waVWBP7Snd1z3sMrdALWRgbSBt4CJx3rE1HEJCiIj6hrLg7aMELFpD7 by7f39A+r6MRVe2/u4DCyGcGdCVuREUmDAHY1/EhAeMGjHB9Rm6gsGRkVj4xlHQbrR ljPZB6HAHz+/jbOiL575lf4rfU1agjLs/G7B6sDTuFVLD8rdiyA+YejeTLlBOCRUc2 mQwBj3hTmvhsROvciKqMAe7rLbtGQZK+VghPee0UiFzcXTN+BZGXSnCmDr3BfvzTO4 dfxysYQXnZyitewKkZ4luBi49tq3NKrb3cO5RTpoMY3PcLToa85S9V/T3ww+t77zcL OcXyjJtzqu4Ig== Date: Tue, 26 Oct 2021 11:38:44 -0500 From: Bjorn Helgaas 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 Message-ID: <20211026163844.GA145569@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. That makes no sense. The code is: +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; + } +} 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. BTW, I feel like a broken record, but your v3 posting still has inconsistent subject line capitalization: PCI: imx6: move the clock disable function to a proper place PCI: dwc: add a new callback host exit function into host ops It would be nice if they were consistent and contained more specific information, e.g., PCI: imx6: Move imx6_pcie_clk_disable() earlier PCI: dwc: Add dw_pcie_host_ops.host_exit() callback Bjorn