From patchwork Sun Dec 8 14:40:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 3306911 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 62EF59F384 for ; Sun, 8 Dec 2013 14:43:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BE393202F8 for ; Sun, 8 Dec 2013 14:43:11 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CAC3A202F2 for ; Sun, 8 Dec 2013 14:43:10 +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 1VpfYL-0006ND-JQ; Sun, 08 Dec 2013 14:41:50 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VpfY6-0003Mn-42; Sun, 08 Dec 2013 14:41:34 +0000 Received: from mail-ee0-x235.google.com ([2a00:1450:4013:c00::235]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VpfXY-0003HL-5u for linux-arm-kernel@lists.infradead.org; Sun, 08 Dec 2013 14:41:03 +0000 Received: by mail-ee0-f53.google.com with SMTP id b57so1090184eek.40 for ; Sun, 08 Dec 2013 06:40:38 -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=kmBqwWiB5iAdSkLbug91333GRe5N+rIpCpWdxRmqxT4=; b=W+FATc7hQHzdd0pU8EyA/8TKsGnrYAyp6pDB1buFfJCxiO/ZQTc4rGAzrf5IVw3aOm R/lIWTS0gAdw9vbU5NoQb+a0+1cb7ur1ix8pBetytfSJJHV8cYx+5U6lFqgEt80x2VCT OqVpYAvr0tkUVpTFOXy4ip92+i4kTVs0yrVilQ1X7ecmuj9Bnxdc41GLiAQZEE+mPIf6 wqpIla1iSJofOheECac8XxUFjazjqkJuGGCr+8FcF1q7vl0X0E+c002pdznsGS/0cC7w nS9gljDBlwPg4X6WqYGxirMHByFB+sCnCBpRuQw3vqFPTnWAFxwXfRKxAJhL2la6CePd wF3A== X-Received: by 10.14.105.201 with SMTP id k49mr38803eeg.115.1386513638538; Sun, 08 Dec 2013 06:40:38 -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 j46sm17865911eew.18.2013.12.08.06.40.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Dec 2013 06:40:37 -0800 (PST) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH v1 4/6] net: phy: resume/suspend PHYs on attach/detach Date: Sun, 8 Dec 2013 15:40:29 +0100 Message-Id: <1386513631-11284-5-git-send-email-sebastian.hesselbarth@gmail.com> In-Reply-To: <1386513631-11284-1-git-send-email-sebastian.hesselbarth@gmail.com> References: <1386171888-28190-1-git-send-email-sebastian.hesselbarth@gmail.com> <1386513631-11284-1-git-send-email-sebastian.hesselbarth@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131208_094100_363888_2AD6C9F0 X-CRM114-Status: GOOD ( 11.87 ) X-Spam-Score: -2.0 (--) Cc: Mugunthan V N , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, David Miller , linux-arm-kernel@lists.infradead.org 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.2 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 This ensures PHYs are resumed on attach and suspended on detach. Signed-off-by: Sebastian Hesselbarth Acked-by: Mugunthan V N Reviewed-by: Florian Fainelli --- Cc: David Miller Cc: Florian Fainelli Cc: Mugunthan V N Cc: netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/net/phy/phy_device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 6f0e9e4..3903f44 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -570,6 +570,8 @@ static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, if (err) phy_detach(phydev); + phy_resume(phydev); + return err; } @@ -615,6 +617,7 @@ void phy_detach(struct phy_device *phydev) { phydev->attached_dev->phydev = NULL; phydev->attached_dev = NULL; + phy_suspend(phydev); /* If the device had no specific driver before (i.e. - it * was using the generic driver), we unbind the device