Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp412690ybc; Tue, 12 Nov 2019 03:29:46 -0800 (PST) X-Google-Smtp-Source: APXvYqyFVgrEZun726quIMRmAdUbodEtjtODfKZ9egevpkWbEGqiwALyIhzDabdTbDvUqbs4w8zM X-Received: by 2002:a17:906:11cd:: with SMTP id o13mr27558705eja.272.1573558186456; Tue, 12 Nov 2019 03:29:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573558186; cv=none; d=google.com; s=arc-20160816; b=O2BMjvqDY+9G/sZcIV90VK0yi/jH/WHC14M6Ps9FUdeLwtsF9qEpRdHV5YTZi6h8Fv ITggXJb1wPFjckfd3EmtkqzUeOV8pAk9fscg5gMpmcRUtotK0NgiB8St7NOJiTnwlEba nuco8cHAJi1PCKClTQQJJ221xWRlk9T6oWuJav/1byDeM5cE621fPPLgSDHDREOOtRF4 TXnVMLBxkNn00SMUyhYbSLQVFYHkWyzFoSll6YhXOXirprIUCOy205wKehWvONnV9hIp /fPi/FrNMX2iucM05LTXC4bSPn635fDHGRHtQTyCGJ4rr5eF5A+IdlAvNDuDNf3HgevS PQ5g== 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=oT7NRAnyWQZcqS8AZQGXhNMhZCid5Elpr5j+vrnZHcU=; b=C/Rv9+iJ3ARxS8Tn39iEA982mXKAQoZjtlfKs4KhsgDtDXp3wHKAIEQ5mlovmSRcvb EsPIY+fXV68dgIDJo6QSlVYwHW9fZj7M4IPLa5vnkAmm0naut0atR0EzbVu+a327n48a 8eOzFG6R5H8Lv6WGeE8L/iB1eZEKzVhWj1cLVu3MgN3iGs/iYYch//EOXxT5Ou/F0bq7 kkAM+eLndZ4/Ze7Moo5ltEkhEXLX9JrQ4fR2LPsVBr5IRG2BxO0hAsNamrU5fUNXZqRy JdzT2sGxZvPZBzqUrPLCfcpI1ew0luAO55lQxctc7HVUEYP072fFwoX3+A8UORyRx/+L 51WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=lYkJbcXP; 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 g15si13891065edl.95.2019.11.12.03.29.21; Tue, 12 Nov 2019 03:29:46 -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=lYkJbcXP; 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 S1726738AbfKLL2u (ORCPT + 99 others); Tue, 12 Nov 2019 06:28:50 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:37215 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725834AbfKLL2u (ORCPT ); Tue, 12 Nov 2019 06:28:50 -0500 Received: by mail-pf1-f195.google.com with SMTP id p24so13159778pfn.4; Tue, 12 Nov 2019 03:28:49 -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=oT7NRAnyWQZcqS8AZQGXhNMhZCid5Elpr5j+vrnZHcU=; b=lYkJbcXPDdsi7jkKZGkeVZiExzVguF/ZPSqgZSlTY+l9kqmuYUTbaQMEnFKbSfDQBt CbOPc4nWtfOUsf5HymN5KnawVbboJh+p0h35SMpaotcIZPhH3skBMDtB8Nhwle2j5xv3 TyGPQZ2MgTFuNbDIUWKPQj3a613j6aqIrGPGeGXEZM3I22zqXnaho9cP0we8IwJiXoul Myc9souDNDHVIN1I5XijI8OQuDjTodID4uq0Stnc3PLwV1r7lwN+wD+3t69aWJ+gawEp pgt/jisP73JZIGB7SOMBP5hd9/qJUNCd4+aq/qwWnJ9+bgeHUqw72745mCVahb+Zp0hI grnw== 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=oT7NRAnyWQZcqS8AZQGXhNMhZCid5Elpr5j+vrnZHcU=; b=GhhNkCHzrfBGU2WTppdUk5BxUK0V180fdOMDuJfHNnYlW0eiq9GshbmEJR/h66NGXi Hb5mzGYmes5JvvbRgpLQF5hu4sglQPH0JyzTzgfTdLLPUWX3m12GnEgsxlDfPy7Am0WH ePwmA32hMXROypK5kXekxzcqH03kjnEWOs+Y5OOuhOWfFDmdsitzx5raZQdW3Vp8HYMW NGlfS/nT4KYEa9OXul2cmH5UmCGuQJI5HouJCD0MAt96QbkthXfQSu7951j6rdkD+D+f DVArZI6BLHe8x4NK8QZnE4Ta+jbGJDqjR5luZOGkHDJi9i6sCyWRFbWGdTnFrGEL6qoQ fklQ== X-Gm-Message-State: APjAAAV8YwDl1oeZsNrJotuxFAj/DIx+ZH6zs1DNqM1kIRAy1kvLcxxL ixHrRGEVP/JL2bXvz1GDlOw= X-Received: by 2002:aa7:90d5:: with SMTP id k21mr24209947pfk.178.1573558129598; Tue, 12 Nov 2019 03:28:49 -0800 (PST) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([202.120.40.82]) by smtp.gmail.com with ESMTPSA id c9sm29569778pfb.114.2019.11.12.03.28.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 03:28:48 -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 v2] net: fec: add a check for CONFIG_PM to avoid clock count mis-match Date: Tue, 12 Nov 2019 19:28:30 +0800 Message-Id: <20191112112830.27561-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. Fixes: c43eab3eddb4 ("net: fec: add missed clk_disable_unprepare in remove") Signed-off-by: Chuhong Yuan --- Changes in v2: - Add fixes tag. 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