From patchwork Wed Nov 20 20:21:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 3215341 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 15CC0C045B for ; Wed, 20 Nov 2013 20:25:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8305920225 for ; Wed, 20 Nov 2013 20:25:34 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 96DEA2020E for ; Wed, 20 Nov 2013 20:25:33 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VjEJh-0002YB-Ur; Wed, 20 Nov 2013 20:24:07 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VjEJ6-0005Wj-I5; Wed, 20 Nov 2013 20:23:28 +0000 Received: from mail-ea0-x22c.google.com ([2a00:1450:4013:c01::22c]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VjEI5-0005Jz-2P for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2013 20:22:27 +0000 Received: by mail-ea0-f172.google.com with SMTP id q10so1949883ead.3 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=oYo8srPQrf3nUrLOg4VYvm3fgeXe+ZDMfK5RHS4IIV0=; b=XLvLacq5ZSR6SLC8jZ5zgdCEaqBaGrNfcg2BPlxTYso5RLuZ1gEag2VxeKjRxtgXb5 ZIOVE7nfFfBYIN56b9x6Ct4EX8UNlNIP7T09E2bsZYzfw2NrKgWBJ8DPsklvUazbHi8M VZ67YHt0TBAuiTW3BegNCqfWUaOm9pYVBoiKMnox4/x6OLpIWBAHQCMjx4eHg/W2Dyik DdQ6Ki68Wr9Ii7XLQbvdUTQo/47Nk508k/Qx8Jjvy59eqTSrK1/pUWikNtLDGC7tEKM4 wzgyXHrhCtorrgQdIkGfZHsgpHTBm3OS134Gmc4AFmw1o+ESSfPZFVHf9FPdh54axY0Y Dphg== X-Received: by 10.15.26.131 with SMTP id n3mr3331121eeu.21.1384978923084; 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 b42sm63364466eem.9.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 Subject: [PATCH RFC v1 6/7] net: mvneta: resume/suspend PHY on port start/stop Date: Wed, 20 Nov 2013 21:21:52 +0100 Message-Id: <1384978913-8052-7-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131120_152225_240297_45DB2F52 X-CRM114-Status: GOOD ( 11.99 ) X-Spam-Score: -2.0 (--) Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Network PHYs consume a noticable amount of power. This adds phy_resume on start_dev and phy_suspend on stop_dev to save this power if the port is down anyway. 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/mvneta.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index b8e232b..8688e91 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -2194,6 +2194,7 @@ static void mvneta_start_dev(struct mvneta_port *pp) mvreg_write(pp, MVNETA_INTR_NEW_MASK, MVNETA_RX_INTR_MASK(rxq_number)); + phy_resume(pp->phy_dev); phy_start(pp->phy_dev); netif_tx_start_all_queues(pp->dev); } @@ -2201,6 +2202,7 @@ static void mvneta_start_dev(struct mvneta_port *pp) static void mvneta_stop_dev(struct mvneta_port *pp) { phy_stop(pp->phy_dev); + phy_suspend(pp->phy_dev); napi_disable(&pp->napi);