From patchwork Wed Nov 20 20:21:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 292854 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 722092C0126 for ; Thu, 21 Nov 2013 07:22:36 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755261Ab3KTUWS (ORCPT ); Wed, 20 Nov 2013 15:22:18 -0500 Received: from mail-ea0-f178.google.com ([209.85.215.178]:58942 "EHLO mail-ea0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755190Ab3KTUWE (ORCPT ); Wed, 20 Nov 2013 15:22:04 -0500 Received: by mail-ea0-f178.google.com with SMTP id d10so3904762eaj.37 for ; Wed, 20 Nov 2013 12:22:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=E+0OTmEcRNix7iyBIVe8YEpEJ34HTTXCLXQ8ACC9nGc=; b=ZUBZA+l3SQue5mFWbS4IAymPg+/vpgi+ASpCN3fp0D1vQ+8P39JvteYMhEveSH+6EN 3BserKcCtEzS51zQnYfiO6qo/+wxYSAaUdLWhJqlEUbGdM44Ja+wWHQsYexFfS4E6vZ4 22cnI4lNRrHjs2cqCv+hVVdDPEZ3w6poWdPl83vRNlmi9RSOwLg+J7O+6o0n2okcXnq9 VIH9Fn7SBCH7obnfhjUvCkUUkav2elQrUVWzlwOrU4qhySREka2sg9Q9tNsZ2e3xUOV1 ASMcmcrDSbGIQVu6tZeLBxD8uU7Wp2RPaWG5hWeSDMQ7YDeWb4xx83Y+673DMEZ21tH6 vy7w== X-Received: by 10.14.221.73 with SMTP id q49mr3305869eep.25.1384978923703; Wed, 20 Nov 2013 12:22:03 -0800 (PST) Received: from topkick.lan (dslc-082-083-251-183.pools.arcor-ip.net. [82.83.251.183]) by mx.google.com with ESMTPSA id g47sm63399791eeo.19.2013.11.20.12.22.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Nov 2013 12:22:02 -0800 (PST) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Cc: Sebastian Hesselbarth , "David S. Miller" , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH RFC v1 5/7] net: mv643xx_eth: resume/suspend PHY on port start/stop Date: Wed, 20 Nov 2013 21:21:51 +0100 Message-Id: <1384978913-8052-6-git-send-email-sebastian.hesselbarth@gmail.com> In-Reply-To: <1384978913-8052-1-git-send-email-sebastian.hesselbarth@gmail.com> References: <1384978913-8052-1-git-send-email-sebastian.hesselbarth@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Network PHYs consume a noticable amount of power. This adds phy_resume on port start and phy_suspend on port stop to save this power if the port is down anyway. While at it, also properly start/stop the phy. Signed-off-by: Sebastian Hesselbarth --- Cc: David S. Miller Cc: netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/net/ethernet/marvell/mv643xx_eth.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index 00cd36e..55805b2 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c @@ -2097,6 +2097,8 @@ static void port_start(struct mv643xx_eth_private *mp) mv643xx_eth_get_settings(mp->dev, &cmd); phy_reset(mp); + phy_resume(mp->phy); + phy_start(mp->phy); mv643xx_eth_set_settings(mp->dev, &cmd); } @@ -2306,6 +2308,11 @@ static int mv643xx_eth_stop(struct net_device *dev) for (i = 0; i < mp->txq_count; i++) txq_deinit(mp->txq + i); + if (mp->phy) { + phy_stop(mp->phy); + phy_suspend(mp->phy); + } + return 0; }