From patchwork Tue May 13 09:23:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 30008 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 198CF20369 for ; Tue, 13 May 2014 09:23:37 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id ij19sf197137vcb.1 for ; Tue, 13 May 2014 02:23:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=grYyYusygvnj/x5aRZ0HPh2smpaIwJzz2xmCN63hg7g=; b=g7ejl9EiM/6qc3+OUEpQAjeGevkEls43fwlfhk7CVi0yCXFuxILovCOJUAFX5gqbmF seY1kPJLzrBogICC5g4BdrSXwcKtfchiNxIQV05/jTbyC6neTSKF4NsIjMLys4yHPmwt FNExxhJ1MbOKAW9Hum7sQIVhjAFLmvr+MkIJnNwM/a3JsDX9rCIaG+fjMVSEKF1uAdsp a6Nd9wnayZfxDU6Y7/qvkG3MCRyaBc18HFW2j7ZOl1v3dyPkSH31bqtIXAHJQVZClJmH RakQOrl4RlXxGSVJEdWyTKRAlFJ9HHWjeORc+i2dWGHy2fskwidozZXEhDx+Hr8PvCgc p7Dg== X-Gm-Message-State: ALoCoQnFElaQc+XEP4w/YDsgRWD6KjuSu29Jy+X8Mk2Sc/PhI1cp2kZd2r/w77Tj7H+dVWhXEVly X-Received: by 10.224.13.12 with SMTP id z12mr16337438qaz.7.1399973016898; Tue, 13 May 2014 02:23:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.21.85 with SMTP id 79ls264937qgk.41.gmail; Tue, 13 May 2014 02:23:36 -0700 (PDT) X-Received: by 10.220.167.2 with SMTP id o2mr28233001vcy.8.1399973016815; Tue, 13 May 2014 02:23:36 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id sg6si2537605vdc.99.2014.05.13.02.23.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 May 2014 02:23:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.180 as permitted sender) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id db12so75498veb.25 for ; Tue, 13 May 2014 02:23:36 -0700 (PDT) X-Received: by 10.220.105.4 with SMTP id r4mr7750340vco.27.1399973016732; Tue, 13 May 2014 02:23:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp135776vcb; Tue, 13 May 2014 02:23:36 -0700 (PDT) X-Received: by 10.66.172.167 with SMTP id bd7mr56577872pac.72.1399973015996; Tue, 13 May 2014 02:23:35 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gp6si12679019pac.215.2014.05.13.02.23.35; Tue, 13 May 2014 02:23:35 -0700 (PDT) Received-SPF: none (google.com: netdev-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759264AbaEMJXd (ORCPT + 3 others); Tue, 13 May 2014 05:23:33 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:56374 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753559AbaEMJXb (ORCPT ); Tue, 13 May 2014 05:23:31 -0400 Received: by mail-pa0-f43.google.com with SMTP id hz1so62110pad.16 for ; Tue, 13 May 2014 02:23:31 -0700 (PDT) X-Received: by 10.68.191.39 with SMTP id gv7mr3867875pbc.90.1399973011250; Tue, 13 May 2014 02:23:31 -0700 (PDT) Received: from localhost.localdomain ([180.150.157.4]) by mx.google.com with ESMTPSA id ko10sm27159891pbd.52.2014.05.13.02.23.27 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 May 2014 02:23:30 -0700 (PDT) From: Zhangfei Gao To: sebastian.hesselbarth@gmail.com, f.fainelli@gmail.com, davem@davemloft.net Cc: netdev@vger.kernel.org, Zhangfei Gao , Jiancheng Xue Subject: [PATCH] net: phy: resume phydev when PHY_RESUMING Date: Tue, 13 May 2014 17:23:18 +0800 Message-Id: <1399972998-21772-1-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: netdev-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: netdev@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zhangfei.gao@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Commit be9dad1f9f26604fb suspend phydev when going to HALTED. However not to resume phydev when going to RESUMING. BMCR_PDOWN remains set "ifconfig eth0 down" -> "ifconfig eth0 up". Unless phy_attach_direct is called in open function. Fix the issue via phy_resume in PHY_RESUMING Signed-off-by: Jiancheng Xue Signed-off-by: Zhangfei Gao --- drivers/net/phy/phy.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 1b6d09a..be5d52e 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -715,7 +715,7 @@ void phy_state_machine(struct work_struct *work) struct delayed_work *dwork = to_delayed_work(work); struct phy_device *phydev = container_of(dwork, struct phy_device, state_queue); - int needs_aneg = 0, do_suspend = 0; + int needs_aneg = 0, do_suspend = 0, do_resume = 0; int err = 0; mutex_lock(&phydev->lock); @@ -865,6 +865,8 @@ void phy_state_machine(struct work_struct *work) } phydev->adjust_link(phydev->attached_dev); } + + do_resume = 1; break; } @@ -876,6 +878,9 @@ void phy_state_machine(struct work_struct *work) if (do_suspend) phy_suspend(phydev); + if (do_resume) + phy_resume(phydev); + if (err < 0) phy_error(phydev);