From patchwork Tue Jul 17 11:17:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Couzens X-Patchwork-Id: 142136 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3554304ljj; Tue, 17 Jul 2018 04:49:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd1Qxe9u6L74yeo1dHueZTpylcM9pmukikENVpDVJio1cxhx13rntbexMT0LFD6zLdHnFX0 X-Received: by 2002:a63:d15:: with SMTP id c21-v6mr1309795pgl.322.1531828159155; Tue, 17 Jul 2018 04:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531828159; cv=none; d=google.com; s=arc-20160816; b=Rk2Cu7sbOS4F0Ek8NGwjsFP7/aqfUL2KGmE9ajh2e3fzE/fVV7EvjeBkA2SejXp8tG LPMYH41LnQeOk/DlVSI08LnBUXTtUmfwMW/yGss5Wz8RuMcasWHnQgfkgT3OIslovuAg f89L1cybChNFZ98h0iIdH7FxCItoJFheIOlhAZmUs412Y6zW3NHSrpn7eNKlLGl4MRni ISXOynUPCPCEtvLgwUIQwB2s7fl4MXawHyJkhjZqZhBsKJAI2UzrhQ3BHzeb02wyvQ2o /nRaQ0Z8bwND31yAob/gS5dlYP/M6hC5nX/RslYCvJEZXEgv8L5tkySFlnTlxfTUgZ0j IuUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ovojeTkXbmTGZDX5tmL03ttPrhB/zZWTIZAtPgWD3ic=; b=djBdLeILkVEFx5uclxn1LhD6hNdMna93Pm9pKpEtZk08LwLmkir/41k+GgniFsWBPC aYEgmX4kBvXG0ArEjZX9qpVK4xumz3Hf1866wT5BLOSLelOSbVaylFuaVVM5y64gtjXi /jgIT8O4OjAHaA+QONjOlqR0q+jtgoQ5eRxljSerTMJm7884PG0jOvj9Hkdzzbji17hJ 8ul9ys05dIqVdZVGw1YeRE7iC8j1sQFxG1D9HU/aSlgDrwPaD3IcLrdrx4Q0ldXgwP+e hkGhxh2bx7KgWkvnr2IKDd7G9ivCrzKkWO56SyFcpxkYmMXwqyqxA3TNpYh1W5AE1OPI OB8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h91-v6si693810pld.132.2018.07.17.04.49.18; Tue, 17 Jul 2018 04:49:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731269AbeGQMVd (ORCPT + 5 others); Tue, 17 Jul 2018 08:21:33 -0400 Received: from mail.base45.de ([80.241.60.77]:33795 "EHLO mail.base45.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731066AbeGQMVd (ORCPT ); Tue, 17 Jul 2018 08:21:33 -0400 X-Greylist: delayed 1928 seconds by postgrey-1.27 at vger.kernel.org; Tue, 17 Jul 2018 08:21:32 EDT Received: from ds9.sysmocom.de ([90.187.64.137] helo=lazus.yip) by mail.base45.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1ffNyk-0000oQ-Mu; Tue, 17 Jul 2018 11:17:14 +0000 From: Alexander Couzens To: linux-usb@vger.kernel.org Cc: Robert Foss , netdev@vger.kernel.org, "David S. Miller" , Alexander Couzens Subject: [PATCH] net: usb: asix: replace mii_nway_restart in resume path Date: Tue, 17 Jul 2018 13:17:09 +0200 Message-Id: <20180717111709.8598-1-lynxis@fe80.eu> X-Mailer: git-send-email 2.18.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org mii_nway_restart is not pm aware which results in a rtnl deadlock. Implement mii_nway_restart manual by setting BMCR_ANRESTART if BMCR_ANENABLE is set. To reproduce: * plug an asix based usb network interface * wait until the device enters PM (~5 sec) * `ip link set eth1 up` will never return Fixes: d9fe64e51114 ("net: asix: Add in_pm parameter") Signed-off-by: Alexander Couzens --- drivers/net/usb/asix_devices.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.18.0 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c index 3d4f7959dabb..b1b3d8f7e67d 100644 --- a/drivers/net/usb/asix_devices.c +++ b/drivers/net/usb/asix_devices.c @@ -642,10 +642,12 @@ static void ax88772_restore_phy(struct usbnet *dev) priv->presvd_phy_advertise); /* Restore BMCR */ + if (priv->presvd_phy_bmcr & BMCR_ANENABLE) + priv->presvd_phy_bmcr |= BMCR_ANRESTART; + asix_mdio_write_nopm(dev->net, dev->mii.phy_id, MII_BMCR, priv->presvd_phy_bmcr); - mii_nway_restart(&dev->mii); priv->presvd_phy_advertise = 0; priv->presvd_phy_bmcr = 0; }