Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp286572ybc; Tue, 12 Nov 2019 01:16:53 -0800 (PST) X-Google-Smtp-Source: APXvYqz1tPjN69eoPU2WzU6CpHml1HBqSl6mKivu/ii9FwdOOMBVzoLOHrZY/5CTYBWIiQGPQteG X-Received: by 2002:aa7:c756:: with SMTP id c22mr31085925eds.25.1573550213568; Tue, 12 Nov 2019 01:16:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573550213; cv=none; d=google.com; s=arc-20160816; b=xKnCprJFxqRPqU6geyFPJ0K0PrynoE9fdQxdLlYMJMOdHKNPYv4TEGeZdDSWUZgCV4 EB2Guk9KlvDEO4Qaw4YbeXnfPJDGMMrE+Ae6ndCsBbOBZArv3UUIZIhnGjefVMgihc4Q 1N9ANFe6Amj0HPXr6t42DUg6BFLfpJMUe/9XgmzZnNuOk1Y+ZqyEgfaYgthCnm8FvB3N 8NSU6kwKjc8B7ECXm9gO+SCzXuzHxZXz4W6WrPGb46pJI4ucrkgJHUKnxb41Tv9k35Dr 5u0eXMuUg3DtJL9K/2oPA29pXxzmcwDFF0J32MgZ3UiSwoLxP7+uM00okk8+pKQiIMRt R15w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5zriEFojyVbt7ELQVanoYbgxzAFKHxi+UtmPwx0zmeQ=; b=jVY/s0Fr12xaqgTikLdzytQeBtq1MrX+sGwXW4HYjos8UvMVYrgdoL2oIHDGyRPNDn uJghuqv1ZDmCJbvgP+/8ujehtwaZiSp2Zn4aaPWxm2EAmB5X+LA/RNfur4fhESifV0B8 IvNmMgrTgGUeSqxz+fSajy3v2gmaXU1AP4JyGR6KHwFWwh6fKmUMKESTDqmt0kETjfMS 9p5A+YIwhbDYsuCEwtH/67wS42jLdvlYzy6mUwXK+MyriVmpX48h9ngfmFCJf2G0B+nF JHtaCmdRro+Yx9XElOTOeIA8f+lh4HOVKRwJyAu67ERRj2aV8k8eQXp/HzxctzyaJimD u/uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=0gkGcUth; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z58si12637790edz.141.2019.11.12.01.16.29; Tue, 12 Nov 2019 01:16:53 -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=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=0gkGcUth; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727176AbfKLJPW (ORCPT + 99 others); Tue, 12 Nov 2019 04:15:22 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36348 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725835AbfKLJPV (ORCPT ); Tue, 12 Nov 2019 04:15:21 -0500 Received: by mail-wr1-f66.google.com with SMTP id r10so17637759wrx.3 for ; Tue, 12 Nov 2019 01:15:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5zriEFojyVbt7ELQVanoYbgxzAFKHxi+UtmPwx0zmeQ=; b=0gkGcUth8FLOYxIwdZiDgR1Ug9t1VBkV/3FwqbV7Q0OlC+Vnjq19TT2qyCHUVKF/vP xdyiQ1QMLC15zHuNxZa0g4PJoKcO0gxfNPTSTdKFqWIDgBQucl+tKWv/Wgu96XF+l4EC GePrmS8gHuU5b34yWy4N1ZDP0a6Dm87jhF8JmDu8AL2s6dcQEiXZIW2FjIwPVEScBxcn 6ul3OgpUkJcW9ZPpYN4sggNPfJ156PbxG9iFTX8eybTpwN1zHmR3LDOnCTShPahCKN60 TNKZDin0L9emwY/sf5PJwSW1f4dE9rV1pSJ2wZuEBC63PHpBBtA2eWcyjUea0wS/FxP9 Qr9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5zriEFojyVbt7ELQVanoYbgxzAFKHxi+UtmPwx0zmeQ=; b=efBYC8v0KRxkB2Kq0lxm06LPnNh2Svd0/97/ShNjBJu+a6079vgiU+ACDG365m3nMw nuaIDa9z1IOv29owDi1LcCG7cXOR3qZAL9HhtIhFQ8vq4uHqHok3kKFusoPG+XZlQULD thxEZxtyHOtX8oaSQ15hEoq8cHK1VvloGhbFW6eBLOxytFc61BWb+lxI6EKBITAJZB0O 9tI7QU+q7XSF6WL2TgToW19ujzJZTCLI9r2GLYNDhCPcO+Q89FHQ9gC80ZGF9sfaqCve JYZEoliYF2Vcdmcpgu/l7RenYF328kElbRRJ20XKFp4PbpNVSehINVMeXdaJWxQPz7an l+qA== X-Gm-Message-State: APjAAAWY0u2Nw92vCHvkwehHdr/VjH1IcSwEPN17617pAQumPpBx4cUO w4WBDJKSisj0srslFklmuOrRSA== X-Received: by 2002:adf:f388:: with SMTP id m8mr8138227wro.18.1573550117445; Tue, 12 Nov 2019 01:15:17 -0800 (PST) Received: from netronome.com ([2001:982:756:703:d63d:7eff:fe99:ac9d]) by smtp.gmail.com with ESMTPSA id h15sm16794949wrb.44.2019.11.12.01.15.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Nov 2019 01:15:16 -0800 (PST) Date: Tue, 12 Nov 2019 10:15:16 +0100 From: Simon Horman To: Andy Duan Cc: Chuhong Yuan , "David S . Miller" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [EXT] [PATCH] net: fec: add a check for CONFIG_PM to avoid clock count mis-match Message-ID: <20191112091515.glw4jzlqluecg4m2@netronome.com> References: <20191106080128.23284-1-hslester96@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 07, 2019 at 01:44:11AM +0000, Andy Duan wrote: > From: Chuhong Yuan Sent: Thursday, November 7, 2019 9:19 AM > > 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. Commit ids are stable, so if there is an id in Linus's tree it will be same in net-next (when the patch appears there). So you want: Fixes: c43eab3eddb4 ("net: fec: add missed clk_disable_unprepare in remove") Also, it is unclear from the patch subject if this patch is targeted at 'net' or 'net-next'. But as c43eab3eddb4 is in Linus's tree I think it should be for 'net'. So the correct patch subject would be: [PATCH net] net: fec: add a check for CONFIG_PM to avoid clock > David, please give the comment. Thanks. > > Regards, > Andy > > > > > 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 FWIIW, I am surprised this is the cleanest way to resolve this problem, though I confess that I have no specific alternative in mind. > > > > > > if (of_phy_is_fixed_link(np)) > > > > > > of_phy_deregister_fixed_link(np); > > > > > > of_node_put(fep->phy_node); > > > > > > -- > > > > > > 2.23.0 > > > > >