Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp439441ybb; Thu, 28 Mar 2019 05:43:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzW39JMuGlwrUlIzznpDw9MOv7HOuVXvNpnpkhB8WWt8oNjlyQrErAxuChPBdyLl355ovv0 X-Received: by 2002:a17:902:d68d:: with SMTP id v13mr28843267ply.55.1553777034452; Thu, 28 Mar 2019 05:43:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553777034; cv=none; d=google.com; s=arc-20160816; b=Y/JkGwsQFN3qbgshCEcksYX5WvROVUED03kVBILHug1pG66oJNpnHZO57N9eMRuUem v2dGJS95QVNcpptlGe3SuBRwZXa/WRtAKeqtz/C5w7Rz9t0OCsNXkhZPel/J5jJbRsTI RPt1UwseJnyIRn0sxtc8g5CGysHygabWPHW3f6i8E5hxHmkO5tIEgZ90SPDZE8rfkL5o 3dNo2ZsO8Bmm5J57d5Yy/QNzswzRnZGJuXhzqMHhF7hnE8aOGpppdyxe6caT6JoPMnnv oSn0CSxTyJVBWAmISZ8npqEF13PQky22ykDUWBdbYuPWLUQsH7u2uCybqD70Zmoi/61r HV3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=zZ64DwdqMUgfOfZdX8i5NsS4eptaQM7Ip3DRudcqMbw=; b=e+vY6Q/EO0CD1fkcbPxGxKN6oos/sIQbFW5nd7Mpa4YV1305/9V8O4d06BmKsq9nm8 27A9QJKqeg0JH3EaKFB9vGUcevQMxMZMWCiapevusp6QMx6vpy6o58nxqRMwuBFUIdl3 AyigUW6Ikunk93Ty5d6NBgsuwd9HxUktkgJi/0RfqGoX/daTqi1u/qzjCLU8AoGjUh3H 6MKO/tvYnrCLB1XNaDBakKsHXGha4o/Ae2F1z8VSGlICLcQl7z4p3Z1+dn/AXpdkKp59 a2S4d+jm51yTVUmsgmA+8BGlQdEJ3y+Gr7kOB8KRqNQth50EBxFw844KHZRdcZy2Dq2w 3BXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d19si1061239pfm.1.2019.03.28.05.43.39; Thu, 28 Mar 2019 05:43:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726344AbfC1Mgi (ORCPT + 99 others); Thu, 28 Mar 2019 08:36:38 -0400 Received: from mga14.intel.com ([192.55.52.115]:13995 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726029AbfC1Mgh (ORCPT ); Thu, 28 Mar 2019 08:36:37 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2019 05:36:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,280,1549958400"; d="scan'208";a="332831858" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 28 Mar 2019 05:36:34 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id BDA6412C; Thu, 28 Mar 2019 14:36:33 +0200 (EET) From: Mika Westerberg To: linux-kernel@vger.kernel.org Cc: Michael Jamet , Yehezkel Bernat , Andreas Noever , Lukas Wunner , "David S . Miller" , Andy Shevchenko , Christian Kellner , Mario.Limonciello@dell.com, Mika Westerberg , netdev@vger.kernel.org Subject: [PATCH v3 01/36] net: thunderbolt: Unregister ThunderboltIP protocol handler when suspending Date: Thu, 28 Mar 2019 15:35:58 +0300 Message-Id: <20190328123633.42882-2-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190328123633.42882-1-mika.westerberg@linux.intel.com> References: <20190328123633.42882-1-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The XDomain protocol messages may start as soon as Thunderbolt control channel is started. This means that if the other host starts sending ThunderboltIP packets early enough they will be passed to the network driver which then gets confused because its resume hook is not called yet. Fix this by unregistering the ThunderboltIP protocol handler when suspending and registering it back on resume. Signed-off-by: Mika Westerberg Acked-by: David S. Miller --- drivers/net/thunderbolt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/thunderbolt.c b/drivers/net/thunderbolt.c index c48c3a1eb1f8..fcf31335a8b6 100644 --- a/drivers/net/thunderbolt.c +++ b/drivers/net/thunderbolt.c @@ -1282,6 +1282,7 @@ static int __maybe_unused tbnet_suspend(struct device *dev) tbnet_tear_down(net, true); } + tb_unregister_protocol_handler(&net->handler); return 0; } @@ -1290,6 +1291,8 @@ static int __maybe_unused tbnet_resume(struct device *dev) struct tb_service *svc = tb_to_service(dev); struct tbnet *net = tb_service_get_drvdata(svc); + tb_register_protocol_handler(&net->handler); + netif_carrier_off(net->dev); if (netif_running(net->dev)) { netif_device_attach(net->dev); -- 2.20.1