Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp299339ybx; Wed, 6 Nov 2019 17:20:36 -0800 (PST) X-Google-Smtp-Source: APXvYqyWQ1HpEpCxYBRh8BscVGlQY5EHZHV+RUfv2pl2lG55OEYzKpoqr6xdNY4jLg1xLA4URd40 X-Received: by 2002:a50:8a88:: with SMTP id j8mr872612edj.35.1573089636318; Wed, 06 Nov 2019 17:20:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573089636; cv=none; d=google.com; s=arc-20160816; b=rOk41nivlhUgDRvOR+TuKuzussJMsdzPGet2rFux28nY/ez+w+MFbQxp9j2Ba0ffG3 dCUcHdSTcotBE38iQYkGOnw1zRpEYlVXoIFNSjMPvMB4bDIXEWd3ZTlubuHFSgAHwYNq TvTQ/7Vt2IUiBUYkZIOJAQVYgJiamyYeNvkgk1CzmmvOXwLjazDFKLqx85wl+/Sek6cL vICj6dUkmVyg8QJIeR9KOgg5s+lItn7Aa+LxwG7TKD7oN6YceyT9GdjS0RlQwvg3Aw3D thA7+DzeP4deD9lCIuhQVPYgy/dDNO9Jqqx0AIymtyO8pwduHuno5NIr2zlrkrE4O/qm a5NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=01gH6mza7gRt0mSaASLNbF4mMLN3fqC1wtVcO2OI7XE=; b=H9nkmGxUdo9tZ8pp0upYnVACgsJN3cSJFqvaE3KfLcYzSTVhCTJnNltUMsfhXi4qRl OrmsYWfPRcOejtG+QSsfRxL0vyLAAjg0Dg8FeXXjPKg6gBASCgj7Oc0syP2blBHeQ73E 9EIJ3ITaw9Bbe4RydBHholSizSwNGxZUEKIk/1jPB8OZX0yHT12KuqsISmOUWZwFC6Vk RNiyoyPeccl634SoL9/mAIFRl5Oy3u5BCHk7PWot7HHVuz+6R0pf6cGpIqqhAX7tHZ/P H1bsKTXho9Z0+3UXhkTZRe1tBu4SYFSiikZIzc0iia+i7H1SdXLt/Ey84r+e8wpXUwF6 Mn3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WybOMlcE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s46si298705edd.336.2019.11.06.17.20.11; Wed, 06 Nov 2019 17:20:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WybOMlcE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732769AbfKGBTj (ORCPT + 99 others); Wed, 6 Nov 2019 20:19:39 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:43221 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728041AbfKGBTi (ORCPT ); Wed, 6 Nov 2019 20:19:38 -0500 Received: by mail-ed1-f66.google.com with SMTP id w6so448887edx.10; Wed, 06 Nov 2019 17:19:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=01gH6mza7gRt0mSaASLNbF4mMLN3fqC1wtVcO2OI7XE=; b=WybOMlcEDhjLxs8fS5g1kAQ/8E6LxAjtuHZEHlCiws/lueLEoT76M918YPp+mdY7vI 7JhttppNJECSlZtaxuie0Z7pBH1zve8TqkucbUrpGwo8afa7FoO8p62je4JBUF2hvFjs nNMU8EJ+owWTbUJuiG8YoYWMxbyJbd6j9IlyyBni5LPrxScV91s4HNEyRMTECxdJLjFn drPeOpyhY/XbBCD60gCl2EYUbWz2R5m7LBreYs90OD8sTcjpNelpnB3pzWDqJ1UdxAL2 DG/4kMkuix+/uE2QUtI7DCGKDPgqSt+pPQIMFCuJeZ7uK5FmeAKTFRC+dMZx9uX0hOxI e89A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=01gH6mza7gRt0mSaASLNbF4mMLN3fqC1wtVcO2OI7XE=; b=Z7koPdq/Oxxfo506PVgudbQi24fd1i0njTWhmh27OCRgSGpGdp/8lzdfmfx+3Rk9PW ocCqWxe10gnYA5mh4B/GJ2+OD+uhmF6a7um5woLMZWhAZLxZ1o+Q9pUCs9NSr/drgpRT dX/wbgRZKfJoIELjV9PwHc1znF+7KMETsvsB3C3UVjGMHCptz0S39UmgojcH81mZDnIm eLVxwBbhzvEwxxjtV/tghBC6JAerYjcVud3xlf+HHzC75BzIoKDPrdDWyz+AuxNC7gIr rDnKQbzvcXUMIuyXXrxa+M4DXsYtRs3KqzEY7X+ZEodaifeLiAmiEh92FvEEjyzSyXwH XI7Q== X-Gm-Message-State: APjAAAV8ZNVSRaPppA9bYJ4eNMtDK/rQ0dipC6wJ+CfQXMJGjqszs6al PwDhVQ9+i4SSlx9qEGGts6JJxComYn8xiRw71jfuij6O9eY= X-Received: by 2002:aa7:d4d8:: with SMTP id t24mr883728edr.40.1573089577113; Wed, 06 Nov 2019 17:19:37 -0800 (PST) MIME-Version: 1.0 References: <20191106080128.23284-1-hslester96@gmail.com> In-Reply-To: From: Chuhong Yuan Date: Thu, 7 Nov 2019 09:19:25 +0800 Message-ID: Subject: Re: [EXT] [PATCH] net: fec: add a check for CONFIG_PM to avoid clock count mis-match To: Andy Duan Cc: "David S . Miller" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 6, 2019 at 6:17 PM Andy Duan wrote: > > From: Chuhong Yuan Sent: Wednesday, November 6, 2019 4:29 PM > > On Wed, Nov 6, 2019 at 4:13 PM Andy Duan wrote: > > > > > > From: Chuhong Yuan Sent: Wednesday, November > > 6, > > > 2019 4:01 PM > > > > If CONFIG_PM is enabled, runtime pm will work and call > > > > runtime_suspend automatically to disable clks. > > > > Therefore, remove only needs to disable clks when CONFIG_PM is > > disabled. > > > > Add this check to avoid clock count mis-match caused by double-disable. > > > > > > > > This patch depends on patch > > > > ("net: fec: add missed clk_disable_unprepare in remove"). > > > > > > > Please add Fixes tag here. > > > > > > > The previous patch has not been merged to linux, so I do not know which > > commit ID should be used. > > It should be merged into net-next tree. > I have searched in net-next but did not find it. > Andy > > > > > Andy > > > > Signed-off-by: Chuhong Yuan > > > > --- > > > > drivers/net/ethernet/freescale/fec_main.c | 2 ++ > > > > 1 file changed, 2 insertions(+) > > > > > > > > diff --git a/drivers/net/ethernet/freescale/fec_main.c > > > > b/drivers/net/ethernet/freescale/fec_main.c > > > > index a9c386b63581..696550f4972f 100644 > > > > --- a/drivers/net/ethernet/freescale/fec_main.c > > > > +++ b/drivers/net/ethernet/freescale/fec_main.c > > > > @@ -3645,8 +3645,10 @@ fec_drv_remove(struct platform_device > > *pdev) > > > > regulator_disable(fep->reg_phy); > > > > pm_runtime_put(&pdev->dev); > > > > pm_runtime_disable(&pdev->dev); > > > > +#ifndef CONFIG_PM > > > > clk_disable_unprepare(fep->clk_ahb); > > > > clk_disable_unprepare(fep->clk_ipg); > > > > +#endif > > > > if (of_phy_is_fixed_link(np)) > > > > of_phy_deregister_fixed_link(np); > > > > of_node_put(fep->phy_node); > > > > -- > > > > 2.23.0 > > >