Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp281195ybx; Wed, 6 Nov 2019 00:03:40 -0800 (PST) X-Google-Smtp-Source: APXvYqw9oDwxuga/QX2OQ653dQqdsRQFTDNvrkcgw4+U9MYRpM4i1MipG/piS3sU7G32G8eQ2pjM X-Received: by 2002:a50:ef17:: with SMTP id m23mr1183387eds.81.1573027420025; Wed, 06 Nov 2019 00:03:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573027420; cv=none; d=google.com; s=arc-20160816; b=IaCE5pfsmukE5TAZa2OpcD3um4hCPX2Qc77jFkD1w1UrO+HhXYgLpMeOu3a1tCJmXy e7PgrB22se9bvUHVqepXZTKCC2ydNrDOFN8Ck1DxJ4ZleoajTieEMKVrAKthEKZkjjBQ M6hlX9zkNBdmIDT1W+2p1iarmOGvqmv+pL62OBGAQ0S3ax2y4ODFXsx6z/uA/6qT9Egp KKDuv2HCaxIinqAZD34yB29SozwZ/GAz81/dopgdkm85k2g+6+lxaFf+RQ+Oubsa/I2k jBvBOSmV37keeszZcoA8/OlhCbqhldwauMHNe5XR35n3X/uqRYvS9wbJn2QNGowNvcVT Wgsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=OmFJplJ1m4VwQ427zpEUzGG+xB7JCkAtrYHj59vzKyE=; b=AwZzl0xqMHIKkxn3d1CRXlWcp29HW2uqqJlFVTRbgUOSTSEnBVTEjvcvLS5QSC1rb7 eHR1JNiBwT3JdcnHFbr1W/vdchcCJlw2ucZa89TIVDZwI+AANPlTwQJi3sdOGGVh2Cbe NolefDmqmxeVABzKS8nJXAjhuL/TItHbkTL4JlEy30rs5SXM5dAQ6K5oFrYalzhxkvWJ +sTD1/FRcLpqUhC2JGUxIKjNpSMRuWjaFRPX4b6Dc4dKzFZZ+X2DzV3RRDolU1SD5hDX G1YeUQEWhl72Q/ATe35yn11xETmuDPFxvfZqZQQ6BodblW0doCnCgAAukkxDvTIXP09F z9YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=MrbKKbkE; 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=fail (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 i47si12022253eda.91.2019.11.06.00.03.14; Wed, 06 Nov 2019 00:03:40 -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=fail header.i=@gmail.com header.s=20161025 header.b=MrbKKbkE; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731371AbfKFIBq (ORCPT + 99 others); Wed, 6 Nov 2019 03:01:46 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:53458 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729878AbfKFIBq (ORCPT ); Wed, 6 Nov 2019 03:01:46 -0500 Received: by mail-wm1-f65.google.com with SMTP id x4so2200694wmi.3; Wed, 06 Nov 2019 00:01:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OmFJplJ1m4VwQ427zpEUzGG+xB7JCkAtrYHj59vzKyE=; b=MrbKKbkEEpLaaU1VA3LNiZShxLjleQKizjxFb7o/RogoTWhFIPRUc8oQXlcid/bVNM 4vs+KOYK7Xf5q6D0wkM5qVbvZknjzUgZottXfmR5MFEA8mY2XmBlY4ZTY/GEXT4tQgGD xZMblYOfLeUwcmgAh0AYFTdcMatBIMY9scFaNjjkUM2hSIGADavlKn+ob8wlhdBpTWFE b6u2fPUxGn+S7Y+T9FluJIptb5NoU0PCt/U5tbNkP8kJORoGJCa5gfOx1u6OtF32xgIi kcJUVmQsTwlYtYMdKaLGN1KJKArN03Zdlu1TVBOLR+b2T91a2uyIj49Iyzv0HjsN4W4a XJ9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OmFJplJ1m4VwQ427zpEUzGG+xB7JCkAtrYHj59vzKyE=; b=nNQW7zFxps+qoCaaIc0dYMZchZdo19VtBkJNQWKNHjFK27xNr5Dx2Gkt7BXJ84lOX3 jA1Q1041VuoNLShWJqsVpzXo0ojx1q/GXkGu/cWcQOXYW9O9qCIaEkuYcfwFHa+Gl6VI 56TJeAP9dXQMJWSXLBLn6KWUgiLWRtEMyBOQ8uRhSPZGeP22f+n/04w1wpD+NNljP/fH rVobrQBa53zmat08GNuRT/neCHaktCW8u8qlpUocXuHDr18xh6fjXGf1YVBp+6HsCaOU sAXnqOCWLg3pSMnp17jFRam5dqpbuKExW1Tl12YCbGiXKdJVllYh1CqM5YkFZ+e8Jcyv 0Sxg== X-Gm-Message-State: APjAAAUV56qm7uV/YygmjQZ5cY3RUm0iqqKtrvDYxfEpCP11Y4GfgvN0 E2XdCNnsH4jmNlqFpob4G6I= X-Received: by 2002:a1c:b607:: with SMTP id g7mr1032801wmf.94.1573027304320; Wed, 06 Nov 2019 00:01:44 -0800 (PST) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([202.120.40.82]) by smtp.gmail.com with ESMTPSA id q124sm1196668wme.13.2019.11.06.00.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 00:01:43 -0800 (PST) From: Chuhong Yuan Cc: Fugang Duan , "David S . Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] net: fec: add a check for CONFIG_PM to avoid clock count mis-match Date: Wed, 6 Nov 2019 16:01:28 +0800 Message-Id: <20191106080128.23284-1-hslester96@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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"). 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