Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2327987pxb; Sun, 17 Oct 2021 11:41:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyWDIudlNOMdzqas85TbCDUWdyKzatFuhAPxkvfukLDpyBEtbAPh53adpMFblqqDjLz33C X-Received: by 2002:a62:7656:0:b0:44c:591b:5a42 with SMTP id r83-20020a627656000000b0044c591b5a42mr24581449pfc.57.1634496103610; Sun, 17 Oct 2021 11:41:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634496103; cv=none; d=google.com; s=arc-20160816; b=QnsfmdVWdUgJfd0x4WQxxWXHEDDiroxBUit6t6HmWts+DE8MAfEhROeUzm7Ifik3Ys G4cW3YrGnqRlozIYdDLRwvj3aHm/YkMD+Amoc1vWjSDbHEQg2DxWMPG1lPjZMHVWXlHl AGfxETydFWGMIPZYbnmSs9i1XroSpuz+pUB0lgvoI6YJbZPEhsodL2pVpIBWjyhgnweQ n5sm45dnuAeHqGmSMm7uh4iAxmrRAhhQhZgIQ65Q2MeHY56en7CHoVFVeixKvDTgNw65 EuQ0MkwE7CsnvKOSc+n4SMldn/3RYNGYUDN38Es99eOsq2YbXsqg/nWdYcR6XcFnCI3k 1bAQ== 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=9AxwD49EKJY2OwrJM93CiUIUeyb20X35yq5ZYFtGfmk=; b=HxXpt/Rc2GFInkU6itKmM96xv94Fjw6rnVwohIzi0ZGbhk7vd2fVAJ9uiyecJC+9Fu ZWEtsUSqptsregD/zdcRdqmjKjx7+IWvB5jRfSsa050mS5wpWWchz4fy2k4HouPPvpE4 CqMHOQr3vVZ45zzoDNgzailQg9FYld+BcSSHukt5zeZzNlel2XyYYHDYojqgeTYQBaJ9 8zBNVaaZuW1FwerzxP9EaoI32gaYzFC5vIg8a1RTkEJ8p+kwPheMxJgDusf4LbYlBG3Z YJTG6h3fYRlfpLPKAUdt7CxSRK0MFLKRzOoV9bfFowmVyZmbAbvFwWvXRfcf4WoWUitD FO3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=We7LgKd2; 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 j62si2346228pgd.75.2021.10.17.11.41.31; Sun, 17 Oct 2021 11:41:43 -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=We7LgKd2; 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 S241877AbhJOSxu (ORCPT + 99 others); Fri, 15 Oct 2021 14:53:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:55882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241681AbhJOSxt (ORCPT ); Fri, 15 Oct 2021 14:53:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 857D160F56; Fri, 15 Oct 2021 18:51:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634323902; bh=TQmj55y7eunqvNATXkqXYrIJmoAAD05XhzrJljA7J5g=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=We7LgKd2Hk9dPOpOXVmJG9arRaMlkYVsvIYXVH0l1WFgiwlNXweMoN2eK3GL+LkpU YnVHEjZLHZaIyxxI/ApMDJVs/i4AwGX/WSeQXy2wLkmcBODqMV4lPDV4RMpWabfX69 dQeHEONicd3cvjFExiccCMnGDZOB2TebHHJ3uWrq0hjuHs8EpuTNOoAQps6IeGnkgz 44aCKt4Sa/9i+TmyB7eKeCrrxLJZcK76+zk64Vmm4ziJIE+Pcvo6dqeIc4hD2cYrQC on1YYbIpYynQihZLb2YnnFYIcNvRbNOcgEknDI2Y5ayYX7Ji73Dq5rv7OYXlHPDEaV V+xWrAK0nTDmQ== Date: Fri, 15 Oct 2021 13:51:41 -0500 From: Bjorn Helgaas To: Richard Zhu Cc: l.stach@pengutronix.de, bhelgaas@google.com, lorenzo.pieralisi@arm.com, linux-pci@vger.kernel.org, linux-imx@nxp.com, 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: <20211015185141.GA2139462@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211015184943.GA2139079@bhelgaas> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 15, 2021 at 01:49:45PM -0500, Bjorn Helgaas wrote: > On Fri, Oct 15, 2021 at 02:05:40PM +0800, Richard Zhu wrote: > > When link never came up, driver probe would be failed with error -110. > > To keep usage counter balance of the clocks, disable the previous > > enabled clocks when link is down. > > Move definitions of the imx6_pcie_clk_disable() function to the proper > > place. Because it wouldn't be used in imx6_pcie_suspend_noirq() only. > > -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. > > - } > > -}