Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp303521ybx; Wed, 6 Nov 2019 00:31:22 -0800 (PST) X-Google-Smtp-Source: APXvYqzAFeSdQFz0ej82Yh/0IP8IaR0TxQ+/bONuwpWRMHwn5QrzrWe02E+yTKe8fyezUnaZ/sU8 X-Received: by 2002:a17:906:7691:: with SMTP id o17mr11540181ejm.323.1573029081914; Wed, 06 Nov 2019 00:31:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573029081; cv=none; d=google.com; s=arc-20160816; b=dpYDoX8oZ8fqReR344yGf+CFLsWyLRkzMbRwntSyS8IYsZl7lIsCEohDBSqPKRpXvX LP9BLphpcMszvnwCNkGLqaLumtIyfvwdiKqjCMBnXyWkVC0PiXKlRPX28Ri26QrMykrJ 5Fj7CtuDyg9x4zi4BJ1ShcO57LmhiFyrmA0MDZjT5MD3OF2MhSU1zJmE7XJ6dgbr1jZ9 UHA3GI7kMHNZlCOCsYE18/Ioz3YJLIxQzlFUAfp1CaCFpZFfaXpsk1sajF7rIb1Mq+tb UUwYlr0u5Cn5FgDtKw4mGhdB7QyosukAa8cfAPX1DQ/g21PLlIdzyahnub+7c6yqU9y4 kDgg== 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=qtpUEILOEaUCVfXdaJ71r8lA3F3BG6Ju5XNHryG150Q=; b=Rnnw7ak7nv71IDrAc/YMNuMWUTcpfjGrIwIbxw9LAWWWtjlb0eh+9Dvr6J+ANn0Ae4 8OK8KtJegfKAh+y0zsYbTBb0Yjzi+PeLOOg7GuQxU0TRrrSke3/h1cgaDD5M4Qmjtfsa jyM3JbC/9n2BRd8wHMpjjyga33+v236+VDYMuMV43uRtdDN3e2JrRi7RaO621t/RUAMi AsxcgHc77EdksacjJ9zSeQaEE/DZSCG/rMCmj2LqrMTDkgdHgb7UtMpFBuqJxt/BIpPY oeYjN4SvEtFxDRDRsJaHC5soBS3lSQJG8AU0LGyn9wiv0WbtOVMPYXwOEhjzsiaKmZal xRkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WLeOSuWD; 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 w8si13632235edi.304.2019.11.06.00.30.58; Wed, 06 Nov 2019 00:31:21 -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=WLeOSuWD; 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 S1731444AbfKFI3Y (ORCPT + 99 others); Wed, 6 Nov 2019 03:29:24 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:40743 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729881AbfKFI3X (ORCPT ); Wed, 6 Nov 2019 03:29:23 -0500 Received: by mail-ed1-f66.google.com with SMTP id p59so18578387edp.7; Wed, 06 Nov 2019 00:29:22 -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=qtpUEILOEaUCVfXdaJ71r8lA3F3BG6Ju5XNHryG150Q=; b=WLeOSuWD368qfl5KCFcaGk7RN1KvVMq3NkhXwU+yB/udBXKobup3ROz5chDKNj0vU2 AuX3P/vbgO925avVpyVWenjo7MjUZllDWgkj1OETAQjuPbp/MkMIFHfglEhG/ri59q+p Y23GdBk8Rkha6xT0fz0LJhtECu08JKxfb+HWzEYkxQbLw3t0W3kb+vfoKBuHMFlUkR9P hbjhdjDhaAGGqzJkJDXtcVkgRv3Pyc33GQGrQFvYk/3Ssst0tbmas7CEMUFtV81tdKFJ g2hZbeXvw6sUZADqJrPD8jEAyDnYd50+4W8AmpyX6vYio/qDoVb3AKv67sUbpepfIOOG PGZQ== 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=qtpUEILOEaUCVfXdaJ71r8lA3F3BG6Ju5XNHryG150Q=; b=mhtVZK18gz7p8LwXBG4icF5u3sLDYseaWSm3RI81GZ/DYlIVJx0hLygLA2dtP0QaBW viXbeFRHdyLBYueMu34p4oSr2Re284kz4nPm7yuFUcm7RgQdy87vHg+pv9gYvJf1OWw8 4/3Hm9gNfiJTpuN0LUMrRn98JVP8HMDmL0bCZEqJR5r5rX/1thH7amPMGq/6w/RtNZc3 QJUDaumxaTGqQqFepnlerP0rVqJonYlivM5jg5OGCnhniFQk1afbyHcT8I94Ds2+ExvO yz9dwIEaLPnclrESOeUJm8BDDO73+so6pE9ZbR5bDuqzdKOjGjmTYk4T81UVmQelfH3N iJuw== X-Gm-Message-State: APjAAAWK8IOrSFaqi3GhZfKVH5y8unz4Vn5aNzILrby5FYnxKPWvRK0H t8ub4AoIqf+uYqS9vQDX0htItsistoOYcYYxXA8= X-Received: by 2002:aa7:d4d8:: with SMTP id t24mr1330124edr.40.1573028961733; Wed, 06 Nov 2019 00:29:21 -0800 (PST) MIME-Version: 1.0 References: <20191106080128.23284-1-hslester96@gmail.com> In-Reply-To: From: Chuhong Yuan Date: Wed, 6 Nov 2019 16:29:10 +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 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. > 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 >