Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4763065imu; Tue, 29 Jan 2019 07:08:44 -0800 (PST) X-Google-Smtp-Source: ALg8bN6VDjvcUC81B3uYxVPXPq8BxTKp9VVPsu4T8HivrAsczKQj2tQI9Y/OykVcqdNMy+fIMvVw X-Received: by 2002:a62:13c3:: with SMTP id 64mr26595333pft.93.1548774524326; Tue, 29 Jan 2019 07:08:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548774524; cv=none; d=google.com; s=arc-20160816; b=hzAjvcKEwso6SLZc9nf+aHQNR7aTO2kjtYF2o1AUR+KINlhMHbqhtQ46OyrevxrJ6p 4Gl686Kc7yg38Ri6yVZKh7SanUaLmFmeX6DSY1en1qDfiKV3uwCCvRGnChdDUmeCMjwa ml+vSYei26dPxiIF9r2MhO42at4LsRvbQTXzOVw+SzV/dS/jzo3Damc8l0B4G0a6AKm2 5UTMTpNfzcM/HnXnefp0M0KgNOQ39viG2AmYiwuCW7v478FqOP7se3urnQ/zmt03VvsK gm4oKg2264HyspgZh7tg9V9u0Ahb7jjeiClhbeJOdUzuoO7Fnz3BD8F2COKtRMIYGNvB IAtA== 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=FiDnMAwWZJkNEd79MJxXJcSyy8g2hsPFyAsguQW1kms=; b=dQZmqq9+zlNKez4pY9j5KcTYLLiB6ydOPhKx0yhOvabxekwDqRowZN/C5oXi0anK1/ qas4EA/2/Mj5/esTVQFF5i5i0c8ExstWG4nokHrtHRsPhWtaERMyy+B+EtNOTNMZSz4H rSznIsj4yvskc4/5fv+BDPRqfqGsPSdCU4tdc8ZbXfrpHNhD5wUkmQBO4UJn3pz5Nq0I FGhFT8TzJ8F/b/V3gKxbfma0o5oN1s5Lmxw4VfNAO8XC/lAPR15ihY1coUEjJ4bhng8i zjbXUJQEoGAd91Nftl6ViZ5lAOj4Z1qP3hA5LROr89Wdc1QABsFHJZ5afgVpC76Y3F/G 3jrw== 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 e15si35264473pgm.25.2019.01.29.07.08.28; Tue, 29 Jan 2019 07:08:44 -0800 (PST) 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 S1728979AbfA2PGY (ORCPT + 99 others); Tue, 29 Jan 2019 10:06:24 -0500 Received: from mga12.intel.com ([192.55.52.136]:8099 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726374AbfA2PBs (ORCPT ); Tue, 29 Jan 2019 10:01:48 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jan 2019 07:01:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,537,1539673200"; d="scan'208";a="129839200" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 29 Jan 2019 07:01:45 -0800 Received: by black.fi.intel.com (Postfix, from userid 1001) id 24CC845; Tue, 29 Jan 2019 17:01:44 +0200 (EET) From: Mika Westerberg To: linux-kernel@vger.kernel.org Cc: Michael Jamet , Yehezkel Bernat , Andreas Noever , Lukas Wunner , "David S . Miller" , Mika Westerberg , Andy Shevchenko , netdev@vger.kernel.org Subject: [PATCH 01/28] net: thunderbolt: Unregister ThunderboltIP protocol handler when suspending Date: Tue, 29 Jan 2019 18:01:16 +0300 Message-Id: <20190129150143.12681-2-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190129150143.12681-1-mika.westerberg@linux.intel.com> References: <20190129150143.12681-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 --- 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