From patchwork Wed Mar 22 11:02:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 95710 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp181793qgd; Wed, 22 Mar 2017 04:22:36 -0700 (PDT) X-Received: by 10.84.149.168 with SMTP id m37mr53409529pla.97.1490181756832; Wed, 22 Mar 2017 04:22:36 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i135si1461572pgc.68.2017.03.22.04.22.36; Wed, 22 Mar 2017 04:22:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934231AbdCVLWf (ORCPT + 6 others); Wed, 22 Mar 2017 07:22:35 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:25785 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759083AbdCVLWb (ORCPT ); Wed, 22 Mar 2017 07:22:31 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v2MB2Utk001622; Wed, 22 Mar 2017 06:02:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1490180550; bh=YMPgLPVa3PmT8dFIt50BurUN3PGdbC7o0UMdDvt1axY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=LJaZL3pC/jKyGBcDNcz0PMgWq8FbZ34xd1ADbtw9Ail6TXrhE5YIiL92GEji+C81h f2WbmjryxK+Hek3QwRMcsz9Lw3dczd7D4nRav/CB9yGZvW22EGPW/NI/QMYMqz0KsV 67ieF6zN7Ufbjx4RxrczOfL7qa4G71J6R0IEQpCQ= Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v2MB2PRv013884; Wed, 22 Mar 2017 06:02:25 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.294.0; Wed, 22 Mar 2017 06:02:25 -0500 Received: from lta0400828d.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v2MB2HlU015824; Wed, 22 Mar 2017 06:02:23 -0500 From: Roger Quadros To: CC: , , , , , , Roger Quadros , "stable # v4 . 9+" Subject: [PATCH v2 2/2] net: phy: Don't miss phy_suspend() on PHY_HALTED for PHYs with interrupts Date: Wed, 22 Mar 2017 13:02:04 +0200 Message-ID: <1490180524-28675-3-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490180524-28675-1-git-send-email-rogerq@ti.com> References: <1490180524-28675-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org phy_suspend() doesn't get called as part of phy_stop() for PHYs using interrupts because the phy state machine is never triggered after a phy_stop(). Explicitly trigger the PHY state machine in phy_stop() so that it can see the new PHY state (HALTED) and suspend the PHY. As most PHYLIB consumers will call phy_stop() with rtnl_lock() held from ndo_close() so we use don't wait for workqueue cancellation in phy_trigger_machine() by passing false for the 'sync' argument. Fixes: 3c293f4e08b5 ("net: phy: Trigger state machine on state change and not polling.") Cc: stable # v4.9+ Signed-off-by: Roger Quadros --- drivers/net/phy/phy.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 49dedf8..ab14e7b 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -907,6 +907,7 @@ void phy_stop(struct phy_device *phydev) * of rtnl_lock(), but PHY_HALTED shall guarantee phy_change() * will not reenable interrupts. */ + phy_trigger_machine(phydev, false); } EXPORT_SYMBOL(phy_stop);